1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 21:27:25 +02:00

Social App UI cleanup. Tooltips may now be disabled in the social shortcodes if needed.

This commit is contained in:
Cameron
2016-03-12 19:36:47 -08:00
parent bf46e608fe
commit af1bbb1c8a
2 changed files with 77 additions and 27 deletions

View File

@@ -170,6 +170,11 @@ class social_ui extends e_admin_ui
"keys" => array ( "id" => "", "secret" => "" ),
"scope" => ""
),
/*
"Instagram" => array (
"enabled" => true,
"keys" => array ( "id" => "", "secret" => "" )
),*/
"LinkedIn" => array (
"enabled" => true,
@@ -212,6 +217,7 @@ class social_ui extends e_admin_ui
"Foursquare" => "https://www.foursquare.com/oauth/",
"Github" => "https://github.com/settings/applications/new",
"Steam" => "http://steamcommunity.com/dev/apikey",
"Instagram" => "http://instagram.com/developer"
);
@@ -294,14 +300,23 @@ class social_ui extends e_admin_ui
</tr>
<tr>
<td>Application Keys and IDs <br /></td>
<td>
<tr><td colspan='2'>
<table class='table table-bordered table-striped'>
<colgroup>
<col class='col-label' />
<col style='width:10%' />
<col class='col-control' />
<col class='col-control' />
<col style='width:20%' />
</colgroup>
<thead>
<tr>
<th>Provider</th>
<th>Key/ID</th>
<th>Secret</th>
<th class='center'>Signup/Login</th>
</tr>
</thead>
";
@@ -312,46 +327,68 @@ class social_ui extends e_admin_ui
foreach($this->social_logins as $prov=>$val)
{
$textKeys = '';
$textScope = '';
$keyCount= array();
$label = varset($this->social_external[$prov]) ? "<a class='e-tip' rel='external' title='Get a key from the provider' href='".$this->social_external[$prov]."'>".$prov."</a>" : $prov;
$radio_label = strtolower($prov);
$text .= "
<tr>
<td><label for='social-login-".$radio_label."-enabled'>".$label."</label></td>
<td>
";
foreach($val as $k=>$v)
{
switch ($k) {
case 'enabled':
$eopt = array('class'=>'e-expandit');
$text .= $frm->radio_switch('social_login['.$prov.'][enabled]', vartrue($pref['social_login'][$prov]['enabled']),'','',$eopt);
$textEnabled = $frm->radio_switch('social_login['.$prov.'][enabled]', vartrue($pref['social_login'][$prov]['enabled']),'','',$eopt);
break;
case 'keys':
// $cls = vartrue($pref['single_login'][$prov]['keys'][$tk]) ? "class='e-hideme'" : '';
$sty = vartrue($pref['social_login'][$prov]['keys'][vartrue($tk)]) ? "" : "e-hideme";
$text .= "<div class='e-expandit-container {$sty}' id='option-{$prov}' >";
// $text .= "<div class='e-expandit-container {$sty}' id='option-{$prov}' >";
foreach($v as $tk=>$idk)
{
$eopt = array('placeholder'=> $tk, 'size'=>'xxlarge');
$text .= "<br />".$frm->text('social_login['.$prov.'][keys]['.$tk.']', vartrue($pref['social_login'][$prov]['keys'][$tk]), 100, $eopt);
$eopt = array( 'size'=>'block-level');
$keyCount[] = 1;
$textKeys .= "<td>".$frm->text('social_login['.$prov.'][keys]['.$tk.']', vartrue($pref['social_login'][$prov]['keys'][$tk]), 100, $eopt)."</td>";
}
$text .= "</div>";
// $text .= "</div>";
break;
case 'scope':
$text .= $frm->hidden('social_login['.$prov.'][scope]','email');
$textScope .= $frm->hidden('social_login['.$prov.'][scope]','email');
break;
default:
break;
}
}
$text .= "</td>
if(empty($keyCount))
{
$textKeys = "<td>&nbsp;</td><td>&nbsp;</td>";
}
elseif(count($keyCount) == 1)
{
$textKeys .= "<td>&nbsp;</td>";
}
$text .= $textKeys."<td class='center'>".$textEnabled.$textScope."</td>";
$text .= "
</tr>
";
}
@@ -427,7 +464,7 @@ class social_ui extends e_admin_ui
";
$tabs = array();
$tabs[] = array('caption'=>"Apps", 'text'=>$text);
$tabs[] = array('caption'=>"Applications", 'text'=>$text);
$tabs[] = array('caption'=>'Pages', 'text'=>$text2);
$ret = $frm->open('social','post',null, 'class=form-horizontal').$frm->tabs($tabs);

View File

@@ -77,6 +77,15 @@ class social_shortcodes extends e_shortcode
$class = (vartrue($parm['size'])) ? 'fa-'.$parm['size'] : '';
$tooltipPos = vartrue($parm['tip-pos'], 'top');
if(isset($parm['tip']))
{
$tooltip = ($parm['tip'] == 'false' || empty($parm['tooltip'])) ? '' : 'e-tip';
}
else
{
$tooltip = 'e-tip';
}
if(!empty($parm['type']))
{
$newList = array();
@@ -98,7 +107,7 @@ class social_shortcodes extends e_shortcode
if($data['href'] != '')
{
$text .= '<a rel="external" href="'.$data['href'].'" data-tooltip-position="'.$tooltipPos.'" class="e-tip social-icon social-'.$id.'" title="'.$data['title'].'"><span class="fa fa-'.$id.' '.$class.'"></span></a>';
$text .= '<a rel="external" href="'.$data['href'].'" data-tooltip-position="'.$tooltipPos.'" class="'.$tooltip.' social-icon social-'.$id.'" title="'.$data['title'].'"><span class="fa fa-'.$id.' '.$class.'"></span></a>';
$text .= "\n";
}
}
@@ -185,11 +194,8 @@ class social_shortcodes extends e_shortcode
$providers = $this->getProviders();
if(empty($parm)) // No parms so use prefs instead.
if(empty($parm['providers'])) // No parms so use prefs instead.
{
$parm['dropdown'] = ($pref['sharing_mode'] == 'dropdown') ? 1 : 0;
$parm['providers'] = !empty($pref['sharing_providers']) ? array_keys($pref['sharing_providers']) : array_keys($providers);
}
else
@@ -197,7 +203,10 @@ class social_shortcodes extends e_shortcode
$parm['providers'] = array_keys($providers);
}
if(empty($parm['dropdown']))
{
$parm['dropdown'] = ($pref['sharing_mode'] == 'dropdown') ? 1 : 0;
}
$url = varset($parm['url'], $defaultUrl);
@@ -210,11 +219,6 @@ class social_shortcodes extends e_shortcode
$size = varset($parm['size'], 'md');
$data = array('u'=> rawurlencode($url), 't'=> rawurlencode($title), 'd' => rawurlencode($description), 'm' => rawurlencode($media));
if(!vartrue($parm['dropdown']))
@@ -235,6 +239,15 @@ class social_shortcodes extends e_shortcode
$hashtags = $this->getHashtags($tags);
if(isset($parm['tip']))
{
$tooltip = ($parm['tip'] == 'false' || empty($parm['tooltip'])) ? '' : 'e-tip';
}
else
{
$tooltip = 'e-tip';
}
$twitterAccount = basename(XURL_TWITTER);
@@ -268,7 +281,7 @@ class social_shortcodes extends e_shortcode
$opt[$k] = "<a class='e-tip btn ".$butSize." btn-default social-share' target='_blank' title='".$val["title"]."' href='".$shareUrl."'>".$tp->toIcon($val["icon"])."</a>";
$opt[$k] = "<a class='".$tooltip." btn ".$butSize." btn-default social-share' target='_blank' title='".$val["title"]."' href='".$shareUrl."'>".$tp->toIcon($val["icon"])."</a>";
}
// Show only Email, Facebook, Twitter and Google.
@@ -301,7 +314,7 @@ class social_shortcodes extends e_shortcode
$text = '<div class="btn-group hidden-print '.$dir.'">
<a class="e-tip btn btn-dropdown btn-default btn-'.$size.' dropdown-toggle" data-toggle="dropdown" href="#" title="Share">'.$label.'</a>
<a class="'.$tooltip.' btn btn-dropdown btn-default btn-'.$size.' dropdown-toggle" data-toggle="dropdown" href="#" title="Share">'.$label.'</a>
<ul class="dropdown-menu" role="menu" style="min-width:435px">