array( 'controller' => 'meta_admin_ui', 'path' => null, 'ui' => 'e_admin_form_ui', 'uipath' => null ) ); protected $adminMenu = array( 'main/meta' => array('caption' => LAN_MANAGE, 'perm' => '0', 'icon'=>'fas-cogs'), ); protected $adminMenuAliases = array(// 'main/edit' => 'main/list' ); protected $menuTitle = METLAN_00; protected $adminMenuIcon = 'e-meta-24'; } class meta_admin_ui extends e_admin_ui { protected $pluginTitle = METLAN_00; protected $pluginName = 'core'; function init() { if(isset($_POST['metasubmit'])) { $this->save(); } } function save() { $fields = array( 'meta_description', 'meta_keywords', 'meta_copyright', 'meta_author', 'meta_tag', 'meta_bodystart', 'meta_bodyend', ); $cfg = e107::getConfig(); foreach($fields as $key) { if(isset($_POST[$key])) { $cfg->setPref($key . '/' . e_LANGUAGE, trim($_POST[$key])); } } $cfg->set('meta_news_summary', varset($_POST['meta_news_summary'])); $cfg->save(true, true, true); } public function renderHelp() { $caption = LAN_HELP; $text = htmlentities(METLAN_7); return array('caption' => $caption, 'text' => $text); } public function metaPage() { $mes = e107::getMessage(); $frm = $this->getUI(); $ns = e107::getRender(); $pref = e107::getPref(); $tp = e107::getParser(); $meta_diz = vartrue($pref['meta_description'], array()); $meta_keywords = vartrue($pref['meta_keywords'], array()); $meta_copyright = vartrue($pref['meta_copyright'], array()); $meta_author = vartrue($pref['meta_author'], array()); $customTagHead = vartrue($pref['meta_tag'], array()); $customTagBodyStart = vartrue($pref['meta_bodystart'], array()); $customTagBodyEnd = vartrue($pref['meta_bodyend'], array()); $text = "
" . METLAN_00 . " (" . e_LANGUAGE . ")" . "
" . LAN_DESCRIPTION . " "; $text .= $frm->textarea('meta_description', $tp->toForm(varset($meta_diz[e_LANGUAGE])), 3, 80, array('size' => 'xxlarge')); // $text .= ""; $text .= "
" . LAN_KEYWORDS . " "; $text .= $frm->tags('meta_keywords', $tp->toForm(varset($meta_keywords[e_LANGUAGE]))); // $text .= ""; $text .= "
" . LAN_COPYRIGHT . "
" . LAN_AUTHOR . "
" . $this->metaLabel(METLAN_4, '') . " "; $text .= $frm->textarea('meta_tag', str_replace("<", "<", $tp->toForm(varset($customTagHead[e_LANGUAGE]))), 5, 100, array('size' => 'block-level', 'placeholder' => "eg. ")); $text .= "
" . $this->metaLabel(METLAN_5, '') . " "; $text .= $frm->textarea('meta_bodystart', str_replace("<", "<", $tp->toForm(varset($customTagBodyStart[e_LANGUAGE]))), 5, 100, array('size' => 'block-level', 'placeholder' => "eg. ")); $text .= "
" . $this->metaLabel(METLAN_6, '') . " "; $text .= $frm->textarea('meta_bodyend', str_replace("<", "<", $tp->toForm(varset($customTagBodyEnd[e_LANGUAGE]))), 5, 100, array('size' => 'block-level', 'placeholder' => "eg. ")); $text .= "
" . METLAN_3 . "
" . $frm->checkbox('meta_news_summary', 1, varset($pref['meta_news_summary'])) . "
" . $frm->admin_button('metasubmit', 'no-value', 'update', LAN_UPDATE) . "
"; $caption = htmlentities(METLAN_00); $installedLangs = e107::getLanguage()->installed('count'); if($installedLangs > 1) { $caption .= " (" . e_LANGUAGE . ")"; } return $text; // $ns->tablerender($caption, $mes->render() . $text); } function metaLabel($text, $small) { $small = htmlentities($small); // $text = str_replace(['(', ')'], ['', ''], $text); return e107::getParser()->lanVars($text, $small, true); } } new meta_admin(); $e_sub_cat = 'meta'; require_once('auth.php'); e107::getAdminUI()->runPage(); require_once("footer.php");