Skip to content

Commit

Permalink
Allow entry share to be configured
Browse files Browse the repository at this point in the history
In config.ini share=frde. Means facebook, readability, delicious, email
only. Respecting order.
  • Loading branch information
becevka committed Jul 23, 2013
1 parent 58643fa commit bb0aef1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
1 change: 1 addition & 0 deletions defaults.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ auto_mark_as_read=0
anonymizer=
use_system_font=
readability=
share=gtfprde
allow_public_update_access=
36 changes: 22 additions & 14 deletions templates/item.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
$title = $this->viewHelper->lazyimg($title);
$content = $this->viewHelper->lazyimg($content);
$date = $this->viewHelper->dateago($this->item['datetime']);
$sharecfg = \F3::get('share');
$share = array(
"g" => "google",
"f" => "facebook",
"t" => "twitter",
"p" => "pocket",
"r" => "readability",
"d" => "delicious",
"e" => "email"
);
?>
<div id="entry<?PHP echo $this->item['id']; ?>"
class="entry
Expand Down Expand Up @@ -57,13 +67,12 @@

<ul class="entry-smartphone-share">
<li class="entry-newwindow"><?PHP echo \F3::get('lang_open_window')?></li>
<li class="entry-sharegoogle entry-share" title="google">google</li>
<li class="entry-sharetwitter entry-share" title="twitter">twitter</li>
<li class="entry-sharefacebook entry-share" title="facebook">facebook</li>
<li class="entry-sharepocket entry-share" title="pocket">pocket</li>
<li class="entry-sharedelicious entry-share" title="delicious">delicious</li>
<li class="entry-sharereadability entry-share" title="readability">readability</li>
<li class="entry-shareemail entry-share" title="email">email</li>
<?PHP foreach (str_split($sharecfg) as $s) {
$name = $share[$s];
if($name) {
echo '<li class="entry-share'.$name.' entry-share" title="'.$name.'">'.$name.'</li>';
}
} ?>
</ul>
</div>

Expand All @@ -73,13 +82,12 @@
<li class="entry-unread <?PHP echo $this->item['unread']==1 ? 'active' : ''; ?>"><?PHP echo $this->item['unread']==1 ? \F3::get('lang_mark') : \F3::get('lang_unmark'); ?></li>
<li class="entry-newwindow"><?PHP echo \F3::get('lang_open_window')?></li>
<li class="entry-loadimages"><?PHP echo \F3::get('lang_load_img')?> </li>
<li class="entry-sharegoogle entry-share" title="google">&nbsp;</li>
<li class="entry-sharetwitter entry-share" title="twitter">&nbsp;</li>
<li class="entry-sharefacebook entry-share" title="facebook">&nbsp;</li>
<li class="entry-sharepocket entry-share" title="pocket">&nbsp;</li>
<li class="entry-sharedelicious entry-share" title="delicious">&nbsp;</li>
<li class="entry-sharereadability entry-share" title="readability">&nbsp;</li>
<li class="entry-shareemail entry-share" title="email">&nbsp;</li>
<?PHP foreach (str_split($sharecfg) as $s) {
$name = $share[$s];
if($name) {
echo '<li class="entry-share'.$name.' entry-share" title="'.$name.'">&nbsp;</li>';
}
} ?>
<li class="entry-close"></li>
</ul>
</div>

0 comments on commit bb0aef1

Please sign in to comment.