1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Cleaned up Admin-UI in URL Aliases

This commit is contained in:
Cameron
2015-09-14 12:36:44 -07:00
parent e14971d81e
commit d824f02838

View File

@@ -23,7 +23,7 @@ e107::coreLan('eurl', true);
// TODO - admin interface support, remove it from globals // TODO - admin interface support, remove it from globals
$e_sub_cat = 'eurl'; $e_sub_cat = 'eurl';
e107::css('inline', " span.e-help { cursor: help } ");
class eurl_admin extends e_admin_dispatcher class eurl_admin extends e_admin_dispatcher
{ {
@@ -832,7 +832,15 @@ class eurl_admin_form_ui extends e_admin_form_ui
$text = ''; $text = '';
$tp = e107::getParser(); $tp = e107::getParser();
$text .= "<tr>
<th>Module</th>
<th></th>
<th></th>
</tr>";
$lng = e107::getLanguage();
foreach ($modules as $module => $obj) foreach ($modules as $module => $obj)
{ {
$cfg = $obj->config->config(); $cfg = $obj->config->config();
@@ -840,21 +848,33 @@ class eurl_admin_form_ui extends e_admin_form_ui
if($module == 'index') if($module == 'index')
{ {
$text .= " $text .= "
<tr> <tr>
<td> <td>
".LAN_EURL_CORE_INDEX." ".LAN_EURL_CORE_INDEX."
</td> </td>
<td> <td>
".LAN_EURL_CORE_INDEX_INFO." <table class='table table-striped table-bordered' style='margin-bottom:0'>
</td> <colgroup>
<td> <col style='width:20%' />
".LAN_EURL_FORM_HELP_EXAMPLE.":<br /><strong>".e107::getUrl()->create('/', '', array('full' => 1))."</strong> <col style='width:40%' />
<col style='width:40%' />
</colgroup>
<tr>
<td colspan='2'>
".LAN_EURL_CORE_INDEX_INFO."
</td>
<td>
".e107::getUrl()->create('/', '', array('full' => 1))."
</tr>
</table>
</td> </td>
</tr> </tr>
"; ";
continue; continue;
} }
$help = array(); $help = array();
$admin = $obj->config->admin(); $admin = $obj->config->admin();
$lan = $lanDef[0]; $lan = $lanDef[0];
@@ -873,37 +893,94 @@ class eurl_admin_form_ui extends e_admin_form_ui
<td> <td>
"; ";
// default language
// default language $text .= "<table class='table table-striped table-bordered' style='margin-bottom:0'>
$text .= $this->text('eurl_aliases['.$lanDef[0].']['.$module.']', $defVal).' ['.$lanDef[1].']'.$this->help(LAN_EURL_FORM_HELP_DEFAULT); <colgroup>
$help[] = '['.$lanDef[1].'] '.LAN_EURL_FORM_HELP_EXAMPLE.':<br /><strong>'.$url.'</strong>'; <col style='width:20%' />
<col style='width:40%' />
<col style='width:40%' />
</colgroup>";
$text .= "<tr>
<th>".ADLAN_132."</th>
<th>".LAN_EURL_NAME_ALIASES."</th>
<th>".LAN_EURL_FORM_HELP_EXAMPLE."</th>
</tr>";
$text .= "<tr>";
$text .= "<td>".$lanDef[1]."</td>";
$text .= "<td class='form-inline'>";
$text .= $this->text('eurl_aliases['.$lanDef[0].']['.$module.']', $defVal, 255, 'size=xlarge');
// $text .= ' ['.$lanDef[1].']';
$text .= "</td><td>";
$text .= $this->help(LAN_EURL_FORM_HELP_DEFAULT);
$text .= "</td>";
// $help[] = '['.$lanDef[1].'] '.LAN_EURL_FORM_HELP_EXAMPLE.':<br /><strong>'.$url.'</strong>';
$text .= "</tr>";
if(e107::getUrl()->router()->isMainModule($module))
{
$help = " <span class='e-tip e-help' title=\"".LAN_EURL_CORE_MAIN."\">".$tp->toGlyph('fa-home')."</span>";
//$readonly = 1; // may be used later.
$readonly = 0;
}
else
{
$help = '';
$readonly=0;
}
if($lans) if($lans)
{ {
foreach ($lans as $code => $lan) foreach ($lans as $code => $lan)
{ {
$url = e107::getUrl()->create($module, '', array('lan' => $code, 'full' => 1, 'encode' => 0)); $url = e107::getUrl()->create($module, '', array('lan' => $code, 'full' => 1, 'encode' => 0));
$defVal = isset($currentAliases[$code]) && in_array($module, $currentAliases[$code]) ? array_search($module, $currentAliases[$code]) : $module; $defVal = isset($currentAliases[$code]) && in_array($module, $currentAliases[$code]) ? array_search($module, $currentAliases[$code]) : $module;
$text .= "<div class='spacer'><!-- --></div>";
$text .= $this->text('eurl_aliases['.$code.']['.$module.']', $defVal).' ['.$lan.']'.$this->help(LAN_EURL_FORM_HELP_ALIAS_1.' <strong>'.$lan.'</strong>');
$help[] = '['.$lan.'] '.LAN_EURL_FORM_HELP_EXAMPLE.':<br /><strong>'.$url.'</strong>'; // $help .= '['.$lan.'] '.LAN_EURL_FORM_HELP_EXAMPLE.':<br /><strong>'.$url.'</strong>';
$text .= "<tr>";
$text .= "<td>".$lan."</td>";
$text .= "<td class='form-inline'>". $this->text('eurl_aliases['.$code.']['.$module.']', $defVal, 255, array('size' => 'xlarge', 'readonly'=>$readonly));
$text .= $help;
$text .= "</td>";
$text .= "<td>";
// $text .= $this->help(LAN_EURL_FORM_HELP_ALIAS_1.' <strong>'.$lan.'</strong>');
// $text .= $this->help(LAN_EURL_FORM_HELP_ALIAS_1.' <strong>'.$lan.'</strong>');
$url = $lng->subdomainUrl($lan,$url);
$text .= $url;
$text .= "</td>";
// $text .= "<td>".
// $text .= '['.$lan.'] '.LAN_EURL_FORM_HELP_EXAMPLE.':<br /><strong>'.$url.'</strong>';
// $text .= "</td>";
$text .= "</tr>";
} }
} }
$text .= "</table>
</td></tr>";
if(e107::getUrl()->router()->isMainModule($module)) /*$text .= "
{
$help = array(LAN_EURL_CORE_MAIN);
}
$text .= "
</td> </td>
<td> <td>
".implode("<div class='spacer'><!-- --></div>", $help)." ".implode("<div class='spacer'><!-- --></div>", $help)."
</td> </td>
</tr> </tr>
"; ";*/
// $text .= "</tr>";
} }
return $text; return $text;