public static function render() { $SectionValues = \CmsDev\Content\Section::get(); $Template = $SectionValues->Template; if ($Template === '') { $Template = 'home'; } /* ------------------------------------------------------------------------------- */ /* ------------------------- LOAD SEARCH ENGINE -------------------------------- */ /* ------------------------------------------------------------------------------- */ if (\SKTURL_Here == 'Google_Search') { $Template = 'System/Google_Search'; $LoadTemplate = \SKTPATH_TemplateSite . 'SKT_Theme_Pages/System/Google_Search.php'; } /* ------------------------------------------------------------------------------- */ /* ------------------------- LOGIN AS ADMINISTRATOR ---------------------------- */ /* ------------------------------------------------------------------------------- */ if (\SKTURL_Here === 'admin' or \SKTURL_Here === 'admin?invalid-admin' or \SKTURL_Here === 'admin') { if (isset($_POST['SKT_AdminName']) && isset($_POST['SKT_AdminPassword'])) { $checkAction = \CmsDev\Security\loginIntent::checkAction('Admin'); } $Template = 'System/admin'; } if (isset($_GET['invalid-admin'])) { $MessageBox = SKT_INFO\Asistance::get(); $MessageBox->TipError(\SKT_ADMIN_User_Invalid, true); $Template = 'System/admin'; } if (\THIS_URL_REAL === 'CloseAdmin') { $checkAction = \CmsDev\Security\loginIntent::checkAction('close'); exit; } /* ------------------------------------------------------------------------------- */ /* ------------------------- USERS, LOGIN, REGISTER, CONNECT -------------------- */ /* ------------------------------------------------------------------------------- */ if (\SKTURL_Here === 'UserProfile') { $Template = 'System/Profile'; } if (\SKTURL_Here === 'UserRegistration') { $Template = 'System/NewUser'; } if (\SKTURL_Here === 'PasswordRecovery') { $Template = 'System/PasswordRecovery'; } if (\SKTURL_Here === 'UserLogin' || \THIS_URL_REAL == 'UserLogin?invalid-user') { $Template = 'System/user'; } if (\SKTURL_Here === 'ValidateUser') { $Template = 'System/ValidateUser'; } if (\SKTURL_Here === 'UserLogout') { $checkAction = \CmsDev\Security\loginIntent::checkAction('close'); exit; } if (\SKTURL_Here === 'index.php' || \THIS_URL_REAL === '?logout') { \CmsDev\Header\refresh::refreshNow(\SERVER_DIR); exit; } if (\THIS_URL_REAL === 'login_with_facebook') { \CmsDev\Header\refresh::refreshNow(\SERVER_DIR . '?login_with_facebook'); exit; } if (isset($_POST['SKT_UserName']) && isset($_POST['SKT_Password'])) { \CmsDev\Security\loginIntent::checkAction('login'); } if (isset($_GET['invalid-user'])) { $MessageBox = SKT_INFO\Asistance::get(); $MessageBox->TipError(\SKT_ADMIN_User_Invalid, true); } if (defined("error")) { if (\error == 'error500') { $Template = 'System/500'; } elseif (\error == 'error404') { $Template = 'System/404'; } elseif (\error == 'error403') { $Template = 'System/403'; } } if (isset($_GET['usr'])) { $Template = 'System/Company'; } if (isset($_GET['empresas'])) { $Template = 'Empresas'; } if (isset($_GET['Detail'])) { $Template = 'System/Detail'; } if (isset($_GET['Type']) && $_GET['Type'] == 'Search') { $Template = 'System/Search'; $LoadTemplate = \SKTPATH_TemplateSite . 'SKT_Theme_Pages/System/Search.php'; } /* ------------------------------------------------------------------------------- */ /* ------------------------- LOAD DYNAMIC SECTION ------------------------------ */ /* ------------------------------------------------------------------------------- */ if (!isset($_GET['SKTGoTo']) && !isset($_GET['SKTFiles']) && !isset($_GET['SKTDir']) && !isset($_GET['SKTFiles']) && !isset($_GET['SKTFSys'])) { if (\is_file(\SKTPATH_TemplateSite . 'SKT_Theme_Pages/' . $Template . '.php')) { include \SKTPATH_TemplateSite . 'SKT_Theme_Pages/' . $Template . '.php'; } else { echo \SKTPATH_TemplateSite . 'SKT_Theme_Pages/' . $Template . '.php'; include \SKTPATH_TemplateSite . 'SKT_Theme_Pages/System/500.php'; } } }
$isfile = TRUE; $SKTAJAX = FALSE; \define('RAND_GLOBAL_INSTANCE', \md5(\rand(5, 9999999) . \microtime())); global $SKT; require_once 'AutoLoad.php'; require_once 'util/functions.php'; spl_autoload_register('Autoloader::autoload'); $SKTDB = \CmsDev\Sql\db_Skt::connect(); include dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . "_TemplateSite" . DIRECTORY_SEPARATOR . \SKT_TEMPLATE . DIRECTORY_SEPARATOR . "Config.php"; define('SKT_ThisLaguage', CmsDev\Language\CheckLanguage::get()); \CmsDev\Language\AdminGlosary::UpdateFromFile(); \CmsDev\Language\AdminGlosary::get(); \CmsDev\Language\SiteGlosary::UpdateFromFile(); \CmsDev\Language\SiteGlosary::get(); \CmsDev\Init\definedParams::get(); $SectionValues = \CmsDev\Content\Section::get(); if (isset($_GET['SKTGoTo']) || isset($_GET['SKTFiles']) || isset($_GET['SKTDir']) || isset($_GET['SKTFiles']) || isset($_GET['SKTFSys']) || isset($_GET['SKT_HELP'])) { $isvalid = TRUE; $SKTAJAX = TRUE; $isfile = FALSE; } $RequireInit = FALSE; if ($SectionValues->URLName != '') { $isvalid = TRUE; $SKTAJAX = FALSE; $isPage = TRUE; $isfile = FALSE; $SKT_ValidateType = 'URLNAME=' . $SectionValues->URLName; } $SKT['SKTListFieldType'] = array("int" => '0', "varchar" => '1', "text" => '2', "link" => '3', "enum" => '4', "html" => '5', "Basic html" => '7', "date" => '6'); $SKT['SKTListFieldSize'] = 40;
public static function nav($Sections_Menu, $ID = 1, $URLNameParent = '') { $ShowHidden = " RecycleBin = '0' AND"; $SKTDB = \CmsDev\Sql\db_Skt::connect(); $SectionValues = \CmsDev\Content\Section::get(); $Language = $SectionValues->Language; $LoggedInAdmin = \CmsDev\Security\loginIntent::action('validateAdmin'); if ($LoggedInAdmin === true) { $ShowHidden = ""; } $result = $SKTDB->get_results("SELECT ID,Title,Description,URLName,SID,Position,SectionType,RecycleBin,DisplayOnMenu, LinkActive, Link_ID\r\n FROM " . \DB_PREFIX . "sections\r\n WHERE (" . $ShowHidden . " Language = '" . $Language . "' AND SectionType = '1' AND DisplayOnMenu = '" . $Sections_Menu['DisplayMenu'] . "') \r\n OR (" . $ShowHidden . " Language = '" . $Language . "' AND SectionType = '1' AND DisplayOnMenu = '4') \r\n ORDER BY SID, Position, Title", ARRAY_A); if ($result) { $menu = array('items' => array(), 'parents' => array()); foreach ($result as $items) { $menu['items'][$items['ID']] = $items; $menu['parents'][$items['SID']][] = $items['ID']; } return static::globalNav($ID, $menu, $URLNameParent, $Sections_Menu, false); } }
private function section() { $SKT = \CmsDev\util\globals::getVar('SKT'); $SKTDB = SKTDB\db_Skt::connect(); $SectionValues = \CmsDev\Content\Section::get(); $ParentSectionValues = $SectionValues->ParentSectionValues; $Parent_2_SectionValues = $SectionValues->Parent_2_SectionValues; $Parent_3_SectionValues = $SectionValues->Parent_3_SectionValues; $Parent_4_SectionValues = $SectionValues->Parent_4_SectionValues; $Parent_5_SectionValues = $SectionValues->Parent_5_SectionValues; $query = $SKTDB->query("SELECT * FROM " . \DB_PREFIX . "sections WHERE SID = '0'"); $query2 = $SKTDB->get_col_info($info_type = "name", $col_offset = -1); $cols = array(); foreach ($query2 as $name) { array_push($cols, $name); } foreach ($cols as $col) { $val[$col] = $SectionValues->{$col}; \define($this->fixdef('SKT_SECTION_' . $col), $SectionValues->{$col}); } if (\is_object($ParentSectionValues)) { foreach ($cols as $col) { $val['Parent\'][\'' . $col] = $ParentSectionValues->{$col}; \define($this->fixdef('SKT_PARENT_' . $col), $ParentSectionValues->{$col}); } } else { foreach ($cols as $col) { \define($this->fixdef('SKT_PARENT_' . $col), ''); } } if (\is_object($Parent_2_SectionValues)) { foreach ($cols as $col) { $val['Parent2\'][\'' . $col] = $Parent_2_SectionValues->{$col}; \define($this->fixdef('SKT_PARENT2_' . $col), $Parent_2_SectionValues->{$col}); } } else { foreach ($cols as $col) { \define($this->fixdef('SKT_PARENT2_' . $col), ''); } } if (\is_object($Parent_3_SectionValues)) { foreach ($cols as $col) { $val['Parent3\'][\'' . $col] = $Parent_3_SectionValues->{$col}; \define($this->fixdef('SKT_PARENT3_' . $col), $Parent_3_SectionValues->{$col}); } } else { foreach ($cols as $col) { \define($this->fixdef('SKT_PARENT3_' . $col), ''); } } if (\is_object($Parent_4_SectionValues)) { foreach ($cols as $col) { $val['Parent4\'][\'' . $col] = $Parent_4_SectionValues->{$col}; \define($this->fixdef('SKT_PARENT4_' . $col), $Parent_4_SectionValues->{$col}); } } else { foreach ($cols as $col) { \define($this->fixdef('SKT_PARENT4_' . $col), ''); } } if (\is_object($Parent_5_SectionValues)) { foreach ($cols as $col) { $val['Parent5\'][\'' . $col] = $Parent_5_SectionValues->{$col}; \define($this->fixdef('SKT_PARENT5_' . $col), $Parent_5_SectionValues->{$col}); } } else { foreach ($cols as $col) { \define($this->fixdef('SKT_PARENT5_' . $col), ''); } } $count = count($val); $p1 = $p2 = $p3 = $p4 = $p5 = 0; $SECTION = ''; if ($count > 0) { $this->DevShowParams .= '<h3><a href="#">' . \SKT_ADMIN_DP_Section . '</a></h3><table width="250" border="0" cellspacing="0" cellpadding="0" class="TableInfo"><tr><th scope="row" class="defined">defined</th><td scope="row" class="value">value</td></tr>'; foreach ($val as $variable => $value) { if ($p1 === 0 && strstr($variable, 'Parent')) { $this->DevShowParams .= '<tr><th scope="col" colspan="2">Parent Section ' . $val['Parent\'][\'Title'] . '</th></tr>'; $p1++; } else { if ($p2 === 0 && strstr($variable, 'Parent2')) { $this->DevShowParams .= '<tr><th scope="col" colspan="2">Parent (2) Section ' . $val['Parent2\'][\'Title'] . '</th></tr>'; $p2++; } else { if ($p3 === 0 && strstr($variable, 'Parent3')) { $this->DevShowParams .= '<tr><th scope="col" colspan="2">Parent (3) Section ' . $val['Parent3\'][\'Title'] . '</th></tr>'; $p3++; } else { if ($p4 === 0 && strstr($variable, 'Parent4')) { $this->DevShowParams .= '<tr><th scope="col" colspan="2">Parent (4) Section ' . $val['Parent4\'][\'Title'] . '</th></tr>'; $p4++; } else { if ($p5 === 0 && strstr($variable, 'Parent5')) { $this->DevShowParams .= '<tr><th scope="col" colspan="2">Parent (5) Section ' . $val['Parent5\'][\'Title'] . '</th></tr>'; $p5++; } } } } } if (!strstr($variable, 'Parent')) { $SECTION = 'SECTION_'; } else { $SECTION = ''; } $this->DevShowParams .= '<tr><th class="defined" scope="row">SKT_' . $SECTION . $this->fixdef($variable) . '</th><th scope="row" class="value"><span>' . $value . '</span></th></tr>'; } $this->DevShowParams .= '</table>'; } }
public function nav($Sections_Menu, $ID = 1, $URLNameParent = '') { $this->ID = $ID; $this->URLNameParent = $URLNameParent; $this->Sections_Menu = $Sections_Menu; $ShowHidden = " RecycleBin = '0' AND"; $this->SKTDB = \CmsDev\Sql\db_Skt::connect(); $this->SectionValues = \CmsDev\Content\Section::get(); $this->Language = $this->SectionValues->Language; $this->LoggedInAdmin = \CmsDev\Security\loginIntent::action('validateAdmin'); if ($this->LoggedInAdmin === true) { $ShowHidden = ""; } $result = $this->SKTDB->get_results("SELECT *\r\n FROM " . \DB_PREFIX . "sections\r\n WHERE (" . $ShowHidden . " Language = '" . $this->Language . "' AND SectionType = '1' AND DisplayOnMenu = '" . $this->Sections_Menu['Nav_DisplayMenu'] . "') \r\n OR (" . $ShowHidden . " Language = '" . $this->Language . "' AND SectionType = '1' AND DisplayOnMenu = '4') \r\n ORDER BY SID, Position, Title", ARRAY_A); //var_dump($result); //exit(); if ($result) { $this->menu = array('items' => array(), 'parents' => array()); foreach ($result as $items) { $this->menu['items'][$items['ID']] = $items; $this->menu['parents'][$items['SID']][] = $items['ID']; } return static::globalNav(); } }