mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Voux theme now sets a default social plugin preference during install. "instant edit" links added to custom menus, other news2. (more to come)
This commit is contained in:
@@ -501,6 +501,7 @@ class news_shortcodes extends e_shortcode
|
||||
$tp = e107::getParser();
|
||||
if (ADMIN && getperms('H'))
|
||||
{
|
||||
|
||||
//TODO - discuss - a pref for 'new browser window' loading, or a parm or leave 'new browser window' as default?
|
||||
$default = (deftrue('BOOTSTRAP')) ? $tp->toGlyph('icon-edit',false) : "<img src='".e_IMAGE_ABS."admin_images/edit_16.png' alt=\"".LAN_EDIT."\" class='icon' />";
|
||||
|
||||
@@ -509,7 +510,7 @@ class news_shortcodes extends e_shortcode
|
||||
|
||||
$class = varset($parm['class']);
|
||||
|
||||
return "<a class='e-tip ".$class." hidden-print' rel='external' href='".e_ADMIN_ABS."newspost.php?action=edit&id=".$this->news_item['news_id']."' title=\"".LAN_EDIT."\">".$adop_icon."</a>\n";
|
||||
return "<a class='e-tip e-instant-edit ".$class." hidden-print' rel='external' href='".e_ADMIN_ABS."newspost.php?action=edit&id=".$this->news_item['news_id']."' title=\"".LAN_EDIT."\">".$adop_icon."</a>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -2889,7 +2889,22 @@ e107::getDebug()->log($sc_parameters);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render a direct link admin-edit button on the frontend.
|
||||
* @param $url
|
||||
* @param string $perms
|
||||
* @return string
|
||||
*/
|
||||
public function instantEditButton($url, $perms='0')
|
||||
{
|
||||
if(deftrue("BOOTSTRAP") && getperms($perms))
|
||||
{
|
||||
return "<span class='e-instant-edit hidden-print'><a target='_blank' title='".LAN_EDIT."' href='".$url."'>".e107::getParser()->toGlyph('fa-edit')."</a></span>";
|
||||
}
|
||||
|
||||
return '';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -507,24 +507,17 @@ class e_menu
|
||||
// print_a($template['body']);
|
||||
$text = $head.$tp->parseTemplate($template['body'], true, $page_shortcodes).$foot;
|
||||
// echo "TEMPLATE= ($mpath)".$page['menu_template'];
|
||||
|
||||
|
||||
|
||||
// if($template['noTableRender'] !==true) // XXX Deprecated - causes confusion while themeing. use {SETSTYLE=none} instead.
|
||||
// {
|
||||
$ns->setUniqueId('cmenu-'.$page['menu_name']);
|
||||
$ns->tablerender($caption, $text, 'cmenu-'.$page['menu_template']);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// echo $text;
|
||||
// }
|
||||
|
||||
|
||||
$ns->setUniqueId('cmenu-'.$page['menu_name']);
|
||||
$caption .= e107::getForm()->instantEditButton(e_ADMIN_ABS."cpage.php?mode=menu&action=edit&tab=2&id=".intval($page['page_id']),'J');
|
||||
|
||||
$ns->tablerender($caption, $text, 'cmenu-'.$page['menu_template']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = $tp->toHTML($page['menu_text'], true, 'parse_sc, constants');
|
||||
$ns->setUniqueId('cmenu-'.$page['menu_name']);
|
||||
|
||||
$ns->tablerender($caption, $text, 'cmenu');
|
||||
}
|
||||
|
||||
|
@@ -103,6 +103,16 @@ if(!$OTHERNEWS2_STYLE)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$template['caption'] .= e107::getForm()->instantEditButton(e_ADMIN_ABS."newspost.php?searchquery=&filter_options=news_render_type__3", 'H');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(!defined("OTHERNEWS2_LIMIT")){
|
||||
// define("OTHERNEWS2_LIMIT",5);
|
||||
}
|
||||
|
@@ -11,12 +11,15 @@
|
||||
//@see https://developers.facebook.com/docs/plugins/like-button
|
||||
e107::lan('social',false, true);
|
||||
$pref = e107::pref('social');
|
||||
|
||||
$caption = "Facebook";
|
||||
$caption .= e107::getForm()->instantEditButton(e_PLUGIN_ABS."social/admin_config.php#tab-1",'P');
|
||||
|
||||
|
||||
if(deftrue('SOCIAL_FACEBOOK_INIT') )
|
||||
{
|
||||
e107::js('footer-inline', SOCIAL_FACEBOOK_INIT); // defined in e_header.php
|
||||
|
||||
|
||||
|
||||
$action = vartrue($pref['facebook_like_menu_action'], 'like'); // or 'recommend';
|
||||
$layout = vartrue($pref['facebook_like_menu_layout'], 'standard'); // standard, button_count, button or box_count.
|
||||
$width = vartrue($pref['facebook_like_menu_width'], 150);
|
||||
@@ -28,17 +31,19 @@ if(deftrue('SOCIAL_FACEBOOK_INIT') )
|
||||
$text .= '<div class="fb-like" data-href="'.rtrim($ref.'/').'" data-width="'.$width.'px" data-layout="'.$layout.'" data-colorscheme="'.$theme.'" data-action="'.$action.'" data-show-faces="true" data-share="'.$share.'"></div>';
|
||||
$text .= "</div>";
|
||||
|
||||
e107::getRender()->tablerender('Facebook',$text,'facebook-like-menu');
|
||||
|
||||
|
||||
e107::getRender()->tablerender($caption,$text,'facebook-like-menu');
|
||||
|
||||
}
|
||||
elseif(deftrue('XURL_FACEBOOK'))
|
||||
{
|
||||
$width = vartrue($pref['facebook_like_menu_width'], 350);
|
||||
$text .= '<iframe src="//www.facebook.com/plugins/likebox.php?href='.urlencode(XURL_FACEBOOK).'&width='.$width.'&height=200&colorscheme=light&show_faces=true&header=false&stream=false&show_border=false" scrolling="no" style="border:none; overflow:hidden; width:350px;height:200px;max-width:100%;" allowtransparency="true" frameborder="0"></iframe>';
|
||||
e107::getRender()->tablerender('Facebook',$text,'facebook-like-menu');
|
||||
e107::getRender()->tablerender($caption,$text,'facebook-like-menu');
|
||||
}
|
||||
elseif(ADMIN)
|
||||
{
|
||||
$text = "<div class='alert alert-danger'>".LAN_SOCIAL_100."</div>";
|
||||
e107::getRender()->tablerender('Facebook',$text,'facebook-like-menu');
|
||||
e107::getRender()->tablerender($caption,$text,'facebook-like-menu');
|
||||
}
|
@@ -178,6 +178,15 @@
|
||||
'vimeo' => '',
|
||||
)]]></core>
|
||||
</prefs>
|
||||
<pluginPrefs>
|
||||
<social name="sharing_providers"><![CDATA[array (
|
||||
'email' => '1',
|
||||
'facebook-like' => '1',
|
||||
'twitter' => '1',
|
||||
'google-plus1' => '1',
|
||||
'pinterest' => '1',
|
||||
)]]></social>
|
||||
</pluginPrefs>
|
||||
<database>
|
||||
<dbTable name="core_media">
|
||||
<item>
|
||||
|
@@ -85,12 +85,14 @@ $NEWS_TEMPLATE['default']['item'] = '
|
||||
<article class="default-item">
|
||||
<div class="news-header">
|
||||
<span class="news-category">{NEWSCATEGORY}</span>
|
||||
<h2 class="news-title">{NEWSTITLELINK}</h2>
|
||||
<h2 class="news-title">{NEWSTITLELINK} </h2>
|
||||
</div>
|
||||
{NEWSIMAGE: item=1}
|
||||
<div class="news-description">
|
||||
{NEWSMETADIZ}
|
||||
{ADMINOPTIONS}
|
||||
<p><a class="more-link" href="{NEWSURL}">Continue Reading <i class="fa fa-long-arrow-right"></i></a></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@@ -184,7 +184,7 @@ div.bbcode { margin: 15px 0px; clear: both; } /* layout control via bbcodes */
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
|
||||
.e-instant-edit { position: absolute; right: 10px; text-align: right; display: inline-block; z-index:1000; margin-right:10px; }
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user