Add screenshots to a styles of invitations

This commit is contained in:
Fedor A. Fetisov 2014-05-28 01:57:10 +04:00
parent 0619cdc9c1
commit eb062a2424
7 changed files with 36 additions and 31 deletions

View File

@ -36,16 +36,6 @@ class InvitationStyle extends AbstractStyle implements StyleInterface
return 'styles/invitations/' . $this->getName();
}
/**
* Loads configurations of the style.
*
* @return array Style configurations
*/
public function getConfigurations()
{
return array();
}
/**
* Stub for StyleInterface::render method.
*

View File

@ -28,15 +28,26 @@ $style_list = InvitationStyle::getAvailableStyles();
$preview = verify_param("preview", "/^\w+$/", "default");
if (!in_array($preview, $style_list)) {
$style_names = array_keys($style_list);
$preview = $style_list[0];
}
$invitation_style = new InvitationStyle($preview);
$style_config = $invitation_style->getConfigurations();
$screenshots = array();
foreach ($style_config['screenshots'] as $name => $desc) {
$screenshots[] = array(
'name' => $name,
'file' => (MIBEW_WEB_ROOT . '/' . $invitation_style->getFilesPath()
. '/screenshots/' . $name . '.png'),
'description' => $desc
);
}
$page['formpreview'] = $preview;
$page['preview'] = $preview;
$page['availablePreviews'] = $style_list;
$page['operatorName'] = (empty($operator['vclocalname'])
? $operator['vccommonname']
: $operator['vclocalname']);
$page['screenshotsList'] = $screenshots;
$page['title'] = getlocal("page.preview.title");
$page['menuid'] = "settings";

View File

@ -0,0 +1,3 @@
<FilesMatch "\.ini$">
Deny from all
</FilesMatch>

View File

@ -0,0 +1,10 @@
; This file determines some invitation style options
; Comments starts with ';'
; Screenshots section describe all screenshots shiped with style
; Params names should be equals to file names without extension. Pictures
; extension should be '.png'
; Params values should be equals to screenshot desription
[screenshots]
invitation = "Appearance of the invitation"
location = "Location of the invitation on a page"

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -1,13 +1,8 @@
{{#extends "_layout"}}
{{#override "menu"}}{{> _menu}}{{/override}}
{{#override "head"}}
<link href="{{mibewRoot}}/styles/invitations/{{preview}}/invite.css" rel="stylesheet" type="text/css" />
{{/override}}
{{#override "content"}}
{{l10n "page.preview.intro"}}
<br />
<br />
@ -32,6 +27,14 @@
</select>
</div>
</div>
{{#each screenshotsList}}
<div class="field">
<div class="flabel">{{description}}</div>
<div class="fvalueframe">
<img class="screenshot" alt="{{name}}" src="{{file}}" />
</div>
</div>
{{/each}}
</div>
</div>
@ -41,17 +44,5 @@
</div>
</div>
</form>
<div id="mibewinvitation">
<div id="mibewinvitationpopup">
<div id="mibewinvitationclose">
<a onclick="void(0);" href="javascript:void(0);">&times;</a>
</div>
<h1 onclick="void(0);">{{operatorName}}</h1>
<div id="mibewinvitationframe">{{l10n "invitation.message"}}</div>
<div id="mibewinvitationaccept" onclick="void(0);">{{l10n "invitation.accept.caption"}}</div>
<div style="clear: both;"></div>
</div>
</div>
{{/override}}
{{/extends}}