1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-21 13:52:35 +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);