function sublinks_shortcode($parm) { global $sql, $linkstyle; if ($parm) { list($page, $cat) = explode(":", $parm); } $page = $page ? $page : e_PAGE; $cat = $cat ? $cat : 1; require_once e_HANDLER . "sitelinks_class.php"; $sublinks = new sitelinks(); if (function_exists("linkstyle")) { $style = linkstyle($linkstyle); } else { $style = ""; } $text = "\n\n<!-- Sublinks Start -->\n\n"; $text .= $style['prelink']; $sql->db_Select("links", "link_id", "link_url= '{$page}' AND link_category = {$cat} LIMIT 1"); $row = $sql->db_Fetch(); $parent = $row['link_id']; $link_total = $sql->db_Select("links", "*", "link_class IN (" . USERCLASS_LIST . ") AND link_parent={$parent} ORDER BY link_order ASC"); while ($linkInfo = $sql->db_Fetch()) { $text .= $sublinks->makeLink($linkInfo, TRUE, $style, false); } $text .= $style['postlink']; $text .= "\n\n<!-- Sublinks End -->\n\n"; return $text; }
function getOtherNav($type) { $tp = e107::getParser(); $frm = e107::getForm(); if ($type == 'home') { $menu_vars['home']['text'] = ""; // ADLAN_53; $menu_vars['home']['link'] = e_HTTP . 'index.php'; $menu_vars['home']['image'] = $tp->toGlyph('fa-home'); // "<i class='fa fa-home'></i>" ; // "<img src='".E_16_NAV_LEAV."' alt='".ADLAN_151."' class='icon S16' />"; $menu_vars['home']['image_src'] = ADLAN_151; $menu_vars['home']['sort'] = 1; $menu_vars['home']['sub_class'] = 'sub'; // Sub Links for 'home'. require_once e_HANDLER . "sitelinks_class.php"; $slinks = new sitelinks(); $slinks->getlinks(1); $tmp = array(); $c = 0; foreach ($slinks->eLinkList['head_menu'] as $k => $lk) { $subid = 'home_' . $k; $subid = $c; $link = substr($lk['link_url'], 0, 1) != "/" && substr($lk['link_url'], 0, 3) != "{e_" && substr($lk['link_url'], 0, 4) != 'http' ? "{e_BASE}" . $lk['link_url'] : $lk['link_url']; $tmp[$c]['text'] = $tp->toHtml($lk['link_name'], '', 'defs'); $tmp[$c]['description'] = $tp->toHtml($lk['link_description'], '', 'defs'); $tmp[$c]['link'] = $tp->replaceConstants($link, 'full'); $tmp[$c]['image'] = vartrue($lk['link_button']) ? "<img class='icon S16' src='" . $tp->replaceConstants($lk['link_button']) . "' alt='" . $tp->toAttribute($lk['link_description'], '', 'defs') . "' />" : ""; $tmp[$c]['image_large'] = ''; $tmp[$c]['image_src'] = vartrue($lk['link_button']); $tmp[$c]['image_large_src'] = ''; // $tmp[$c]['perm'] = ''; $c++; } $menu_vars['home']['sub'] = $tmp; // -------------------- } elseif ($type == 'logout') { $tmp = array(); $tmp[1]['text'] = LAN_SETTINGS; $tmp[1]['description'] = ADLAN_151; $tmp[1]['link'] = e_BASE . 'usersettings.php'; $tmp[1]['image'] = "<i class='S16 e-settings-16'></i>"; // "<img src='".E_16_CAT_SETT."' alt='".ADLAN_151."' class='icon S16' />"; $tmp[1]['image_large'] = ''; $tmp[1]['image_src'] = ''; $tmp[1]['image_large_src'] = ''; $tmp[2]['text'] = "Personalize"; // TODO - generic LAN in lan_admin.php $tmp[2]['description'] = "Customize administration panels"; $tmp[2]['link'] = e_ADMIN . 'admin.php?mode=customize'; $tmp[2]['image'] = "<i class='S16 e-admins-16'></i>"; //E_16_ADMIN; // "<img src='".E_16_NAV_ADMIN."' alt='".ADLAN_151."' class='icon S16' />"; $tmp[2]['image_large'] = ''; $tmp[2]['image_src'] = ''; $tmp[2]['image_large_src'] = ''; // $tmp[2]['perm'] = ''; $tmp[3]['text'] = LAN_LOGOUT; $tmp[3]['description'] = ADLAN_151; $tmp[3]['link'] = e_ADMIN_ABS . 'admin.php?logout'; $tmp[3]['image'] = "<i class='S16 e-logout-16'></i>"; // "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />"; $tmp[3]['image_large'] = ''; $tmp[3]['image_src'] = ''; $tmp[3]['image_large_src'] = ''; $tmp[4]['text'] = LAN_LOGOUT; $tmp[4]['description'] = ADLAN_151; $tmp[4]['link'] = e_ADMIN_ABS . 'admin.php?logout'; $tmp[4]['image'] = ""; $tmp[4]['image_large'] = ''; $tmp[4]['image_src'] = ''; $tmp[4]['image_large_src'] = ''; $tmp[4]['link_class'] = 'divider'; $tmp[5]['text'] = "e107 Website"; $tmp[5]['description'] = ''; $tmp[5]['link'] = 'http://e107.org'; $tmp[5]['image'] = E_16_E107; $tmp[5]['image_large'] = ''; $tmp[5]['image_src'] = ''; $tmp[5]['image_large_src'] = ''; $tmp[5]['link_class'] = ''; $tmp[6]['text'] = "e107 on Twitter"; $tmp[6]['description'] = ''; $tmp[6]['link'] = 'http://twitter.com/e107'; $tmp[6]['image'] = E_16_TWITTER; // "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />"; $tmp[6]['image_large'] = ''; $tmp[6]['image_src'] = ''; $tmp[6]['image_large_src'] = ''; $tmp[6]['link_class'] = ''; $tmp[7]['text'] = "e107 on Facebook"; $tmp[7]['description'] = ''; $tmp[7]['link'] = 'https://www.facebook.com/e107CMS'; $tmp[7]['image'] = E_16_FACEBOOK; // "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />"; $tmp[7]['image_large'] = ''; $tmp[7]['image_src'] = ''; $tmp[7]['image_large_src'] = ''; $tmp[7]['link_class'] = ''; $tmp[8]['text'] = "e107 on Github"; $tmp[8]['description'] = ''; $tmp[8]['link'] = 'https://github.com/e107inc'; $tmp[8]['image'] = E_16_GITHUB; // "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />"; $tmp[8]['image_large'] = ''; $tmp[8]['image_src'] = ''; $tmp[8]['image_large_src'] = ''; $tmp[8]['link_class'] = ''; $menu_vars['logout']['text'] = ADMINNAME; // ""; // ADMINNAME; $menu_vars['logout']['link'] = '#'; $menu_vars['logout']['image'] = $tp->toGlyph('fa-user'); // "<i class='icon-user'></i>"; // "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />"; $menu_vars['logout']['image_src'] = LAN_LOGOUT; $menu_vars['logout']['sub'] = $tmp; } if ($type == 'language') { $slng = e107::getLanguage(); $languages = $slng->installed(); //array('English','French'); $multiDoms = array(); if ($langSubs = explode("\n", e107::getPref('multilanguage_subdomain'))) { foreach ($langSubs as $v) { $multiDoms[] = trim($v); } } sort($languages); if (count($languages) > 1) { $c = 0; foreach ($languages as $lng) { $checked = "<i > </i> "; $code = $slng->convert($lng); if ($lng == e_LANGUAGE) { $checked = $tp->toGlyph('ok') . " "; $link = '#'; } elseif (in_array(e_DOMAIN, $multiDoms)) { $code = $lng == e107::getPref('sitelanguage') ? 'www' : $code; $link = str_replace($_SERVER['HTTP_HOST'], $code . '.' . e_DOMAIN, e_REQUEST_URL); // includes query string } else { $get = $_GET; $get['elan'] = $code; $qry = http_build_query($get); $link = e_REQUEST_SELF . '?' . $qry; } $tmp[$c]['text'] = $lng; $tmp[$c]['description'] = ''; $tmp[$c]['link'] = $link; $tmp[$c]['image'] = $checked; $tmp[$c]['image_large'] = ''; $tmp[$c]['image_src'] = ''; $tmp[$c]['image_large_src'] = ''; $c++; } $menu_vars['language']['text'] = strtoupper(e_LAN); // e_LANGUAGE; $menu_vars['language']['link'] = '#'; $menu_vars['language']['image'] = $tp->toGlyph('fa-globe'); // "<i class='icon-globe'></i>" ; $menu_vars['language']['image_src'] = null; $menu_vars['language']['sub'] = $tmp; } } return $menu_vars; }
function getOtherNav($type) { $tp = e107::getParser(); if ($type == 'home') { $menu_vars['home']['text'] = ""; // ADLAN_53; $menu_vars['home']['link'] = e_HTTP . 'index.php'; $menu_vars['home']['image'] = "<i class='icon-home icon-white'></i>"; // "<img src='".E_16_NAV_LEAV."' alt='".ADLAN_151."' class='icon S16' />"; $menu_vars['home']['image_src'] = ADLAN_151; $menu_vars['home']['perm'] = ''; $menu_vars['home']['sort'] = 1; $menu_vars['home']['sub_class'] = 'sub'; // Sub Links for 'home'. require_once e_HANDLER . "sitelinks_class.php"; $slinks = new sitelinks(); $slinks->getlinks(1); $tmp = array(); $c = 0; foreach ($slinks->eLinkList['head_menu'] as $k => $lk) { $subid = 'home_' . $k; $subid = $c; $link = substr($lk['link_url'], 0, 1) != "/" && substr($lk['link_url'], 0, 3) != "{e_" && substr($lk['link_url'], 0, 4) != 'http' ? "{e_BASE}" . $lk['link_url'] : $lk['link_url']; $tmp[$c]['text'] = $tp->toHtml($lk['link_name'], '', 'defs'); $tmp[$c]['description'] = $tp->toHtml($lk['link_description'], '', 'defs'); $tmp[$c]['link'] = $tp->replaceConstants($link, 'full'); $tmp[$c]['image'] = vartrue($lk['link_button']) ? "<img class='icon S16' src='" . $tp->replaceConstants($lk['link_button']) . "' alt='" . $tp->toAttribute($lk['link_description'], '', 'defs') . "' />" : ""; $tmp[$c]['image_large'] = ''; $tmp[$c]['image_src'] = ''; $tmp[$c]['image_large_src'] = ''; $tmp[$c]['perm'] = ''; $c++; } $menu_vars['home']['sub'] = $tmp; // -------------------- } elseif ($type == 'logout') { $tmp = array(); $tmp[1]['text'] = ADLAN_CL_1; $tmp[1]['description'] = ADLAN_151; $tmp[1]['link'] = e_BASE . 'usersettings.php'; $tmp[1]['image'] = "<img src='" . E_16_CAT_SETT . "' alt='" . ADLAN_151 . "' class='icon S16' />"; $tmp[1]['image_large'] = ''; $tmp[1]['image_src'] = ''; $tmp[1]['image_large_src'] = ''; $tmp[1]['perm'] = ''; $tmp[2]['text'] = "Personalize"; // TODO - generic LAN in lan_admin.php $tmp[2]['description'] = "Customize administration panels"; $tmp[2]['link'] = e_ADMIN . 'admin.php?mode=customize'; $tmp[2]['image'] = E_16_ADMIN; // "<img src='".E_16_NAV_ADMIN."' alt='".ADLAN_151."' class='icon S16' />"; $tmp[2]['image_large'] = ''; $tmp[2]['image_src'] = ''; $tmp[2]['image_large_src'] = ''; $tmp[2]['perm'] = ''; $tmp[3]['text'] = ADLAN_46; $tmp[3]['description'] = ADLAN_151; $tmp[3]['link'] = e_ADMIN_ABS . 'admin.php?logout'; $tmp[3]['image'] = "<img src='" . E_16_NAV_LGOT . "' alt='" . ADLAN_151 . "' class='icon S16' />"; $tmp[3]['image_large'] = ''; $tmp[3]['image_src'] = ''; $tmp[3]['image_large_src'] = ''; $tmp[3]['perm'] = ''; $menu_vars['logout']['text'] = ""; // ADMINNAME; $menu_vars['logout']['link'] = '#'; $menu_vars['logout']['image'] = "<i class='icon-user icon-white'></i>"; // "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />"; $menu_vars['logout']['image_src'] = ADLAN_46; $menu_vars['logout']['perm'] = ''; $menu_vars['logout']['sub'] = $tmp; } if ($type == 'language') { $languages = array('English', 'French'); $c = 0; foreach ($languages as $lng) { $checked = $lng == e_LANGUAGE ? "<i class='icon-ok icon-black'></i> " : " "; $tmp[$c]['text'] = $lng . " (TO DO)"; $tmp[$c]['description'] = ''; $tmp[$c]['link'] = '#'; $tmp[$c]['image'] = $checked; $tmp[$c]['image_large'] = ''; $tmp[$c]['image_src'] = ''; $tmp[$c]['image_large_src'] = ''; $tmp[$c]['perm'] = ''; $c++; } $menu_vars['language']['text'] = ""; // e_LANGUAGE; $menu_vars['language']['link'] = '#'; $menu_vars['language']['image'] = "<i class='icon-globe icon-white'></i>"; $menu_vars['language']['image_src'] = ADLAN_46; $menu_vars['language']['perm'] = ''; $menu_vars['language']['sub'] = $tmp; } return $menu_vars; }