Skip to content

Commit

Permalink
refs #1654: First version of new standard skin
Browse files Browse the repository at this point in the history
 - Work in progress.

 - We need some template language for skins.
   Currently we have to modify PHP codes to change HTML markups,
   but if we have a template engine, the modification can be confined
   within HTML only.

   Example:

     <li [##_no_more_prev_##]><a ...
     dress('no_more_prev', isset($paging['prev']) ? '' : 'class="disabled"', $view, $useSkinCache);

     can be rewritten as (following Jinja's syntax):

     <li{% if no_more_prev %} class="disabled"{% endif %}><a ...
  • Loading branch information
achimnol committed Mar 5, 2014
1 parent 39e3c89 commit 5cc9389
Show file tree
Hide file tree
Showing 15 changed files with 1,116 additions and 6 deletions.
13 changes: 7 additions & 6 deletions library/view/paging.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ function getPagingView( & $paging, & $template, & $itemTemplate, $useSkinCache =
$postfix = isset($paging['postfix']) ? $paging['postfix'] : '';
ob_start();
if (isset($paging['first'])) {
$itemView = "$itemTemplate <span class=\"interword\">...</span> ";
$itemView = "$itemTemplate <li><a class=\"disabled\">&#8230;</a></li> ";
dress('paging_rep_link_num', '<span>1</span>', $itemView, $useSkinCache);
dress('paging_rep_link', "href='$url$prefix{$paging['first']}$postfix'", $itemView, $useSkinCache);
print ($itemView);
} else if ($paging['page'] > 5) {
$itemView = "$itemTemplate <span class=\"interword\">...</span> ";
$itemView = "$itemTemplate <li><a class=\"disabled\">&#8230;</a></li> ";
dress('paging_rep_link_num', '<span>1</span>', $itemView, $useSkinCache);
dress('paging_rep_link', "href='$url{$prefix}1$postfix'", $itemView, $useSkinCache);
print ($itemView);
Expand Down Expand Up @@ -53,6 +53,7 @@ function getPagingView( & $paging, & $template, & $itemTemplate, $useSkinCache =
}
if (($page == $paging['page']) && ($page <= $paging['pages'])) {
$itemView = $itemTemplate;
dress('paging_rep_item_prop', "class=\"active\"", $itemView, $useSkinCache);
dress('paging_rep_link_num', "<span class=\"selected\" >$page</span>", $itemView, $useSkinCache);
dress('paging_rep_link', '', $itemView, $useSkinCache);
print ($itemView);
Expand All @@ -76,12 +77,12 @@ function getPagingView( & $paging, & $template, & $itemTemplate, $useSkinCache =
}
}
if (isset($paging['last'])) {
$itemView = " <span class=\"interword\">...</span> $itemTemplate";
$itemView = " <li class=\"disabled\"><a>&#8230;</a></li> $itemTemplate";
dress('paging_rep_link_num', "<span>{$paging['pages']}</span>", $itemView, $useSkinCache);
dress('paging_rep_link', "href='$url$prefix{$paging['last']}$postfix'", $itemView, $useSkinCache);
print ($itemView);
} else if (($paging['pages'] - $paging['page']) > 4) {
$itemView = " <span class=\"interword\">...</span> $itemTemplate";
$itemView = " <li class=\"disabled\"><a>&#8230;</a></li> $itemTemplate";
dress('paging_rep_link_num', "<span>{$paging['pages']}</span>", $itemView, $useSkinCache);
dress('paging_rep_link', "href='$url$prefix{$paging['pages']}$postfix'", $itemView, $useSkinCache);
print ($itemView);
Expand All @@ -92,8 +93,8 @@ function getPagingView( & $paging, & $template, & $itemTemplate, $useSkinCache =
dress('prev_page', isset($paging['prev']) ? "href='$url$prefix{$paging['prev']}$postfix'" : '', $view, $useSkinCache);
dress('paging_rep', $itemsView, $view, $useSkinCache);
dress('next_page', isset($paging['next']) ? "href='$url$prefix{$paging['next']}$postfix'" : '', $view, $useSkinCache);
dress('no_more_prev', isset($paging['prev']) ? '' : 'no-more-prev', $view, $useSkinCache);
dress('no_more_next', isset($paging['next']) ? '' : 'no-more-next', $view, $useSkinCache);
dress('no_more_prev', isset($paging['prev']) ? '' : 'class="disabled"', $view, $useSkinCache);
dress('no_more_next', isset($paging['next']) ? '' : 'class="disabled"', $view, $useSkinCache);

return $view;
}
Expand Down
Binary file added skin/blog/lucid/images/atom_12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skin/blog/lucid/images/editor/img_dual.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skin/blog/lucid/images/editor/img_embed.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skin/blog/lucid/images/editor/img_flash.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skin/blog/lucid/images/editor/img_gallery.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skin/blog/lucid/images/editor/img_imazing.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skin/blog/lucid/images/editor/img_jukebox.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skin/blog/lucid/images/editor/img_triple.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skin/blog/lucid/images/rss_12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions skin/blog/lucid/index.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<skin version="2.0">
<information>
<name>Lucid</name>
<version>1.0</version>
<description>
<![CDATA[Persona for Textcube 2.0. Valids HTML5. Based on Bootstrap & designed for mobility-first.]]>
</description>
<license>
<![CDATA[GNU GPLv3]]>
</license>
</information>
<author>
<name>daybreaker</name>
<homepage>http://daybreaker.info</homepage>
<email>[email protected]</email>
</author>
<default>
<recentEntries>5</recentEntries>
<recentComments>5</recentComments>
<recentTrackbacks>5</recentTrackbacks>
<itemsOnGuestbook>6</itemsOnGuestbook>
<tagsInCloud>20</tagsInCloud>
<sortInCloud>1</sortInCloud>
<expandComment>0</expandComment>
<expandTrackback>0</expandTrackback>
<lengthOfRecentNotice>40</lengthOfRecentNotice>
<lengthOfRecentEntry>40</lengthOfRecentEntry>
<lengthOfRecentComment>40</lengthOfRecentComment>
<lengthOfRecentTrackback>40</lengthOfRecentTrackback>
<lengthOfLink>40</lengthOfLink>
<showListOnCategory>1</showListOnCategory>
<showListOnArchive>1</showListOnArchive>
<commentMessage>
<none>No Comment</none>
<single>A comment</single>
</commentMessage>
<trackbackMessage>
<none>No Trackback</none>
<single>A trackback</single>
</trackbackMessage>
<contentWidth>576</contentWidth>
</default>
</skin>
Loading

0 comments on commit 5cc9389

Please sign in to comment.