private function __construct() { $SKT = SKTGLOBALS::getVar('SKT'); $SKTDB = SKTDB\db_Skt::connect(); $Request = new \CmsDev\Url\Request(); $URLName = $Request->byLevel(0); $RequestReverse = new \CmsDev\Url\Request(); $RequestReverse->reverse(false); $testLanguage = $RequestReverse->byLevel(0); $LanguageArray = $SKT['LANGUAGE']['LIST']; if (in_array($testLanguage, $LanguageArray)) { $Language = $testLanguage; } else { $Language = \LANGUAGE_DEF; } if (\SKT_SECTION_PID != '') { $ProductsValues = $SKTDB->query("SELECT * FROM " . \DB_PREFIX . "products WHERE ProductID = '" . \SKT_SECTION_PID . "'"); } $SKTDB->query("SELECT * FROM " . \DB_PREFIX . "products WHERE UID != '0' LIMIT 1"); $query = $SKTDB->get_col_info(); if ($ProductsValues) { foreach ($query as $name) { $this->{$name} = $ProductsValues->{$name}; } } else { foreach ($query as $name) { $this->{$name} = ''; } } }
public function __toString() { global $SKT; $Request = new \CmsDev\Url\Request(); $Request->reverse(false); $testLanguage = $Request->byLevel(0); if ($testLanguage !== '' && $testLanguage !== null) { $LanguageArray = $SKT['LANGUAGE']['LIST']; if (in_array($testLanguage, $LanguageArray)) { $thisLanguage = $testLanguage; } else { $thisLanguage = \LANGUAGE_DEF; } } else { $thisLanguage = \LANGUAGE_DEF; } return $thisLanguage; }
private function routes() { $SKT = \CmsDev\util\globals::getVar('SKT'); $HTTP = "http://" . $_SERVER['HTTP_HOST']; $bbase = $this->CorrectURL(basename($_SERVER['SCRIPT_FILENAME'])); $LOC = $this->CorrectURL(str_replace($bbase, "", $_SERVER['SCRIPT_FILENAME'])); $this->ThisURL = str_replace($bbase, "", $_SERVER['PHP_SELF']); $this->ThisDIR = str_replace($bbase, "", $_SERVER['SCRIPT_FILENAME']); define("SERVER_DIR", $HTTP); define('LOCAL_DIR', $this->fixDS($LOC)); define('LOCAL_FILESYSTEM', $this->fixDS($LOC . '_FileSystems' . DIRECTORY_SEPARATOR)); $Request = new \CmsDev\Url\Request(); $allRequest = \trim($Request->all(), '/'); if ($allRequest == '') { \define('SUBURL', $allRequest . \LANGUAGE_DEF); } else { \define('SUBURL', $allRequest); } $ThisSectionURLName = $Request->byLevel(0); \define('THIS_URL_REAL', $ThisSectionURLName); $TotalURL = $Request->all(); \define('TOTAL_REQUEST', \SERVER_DIR . $TotalURL); \define('LOCAL_FILESYSTEM_SECTION', $this->fixDS(\LOCAL_FILESYSTEM . \SUBURL) . DIRECTORY_SEPARATOR); \define('URL_VERSION', 'CmsDev/' . \SKT_VERSION . '/'); if (!\is_dir(\LOCAL_DIR . '/_TemplateSite/' . \SKT_TEMPLATE)) { $MessageBox = \CmsDev\Info\Asistance::get(); $MessageBox->TipError('Se está mostrando el template por defecto, ya que no se encontró el directorio "<b>' . \SKT_TEMPLATE . '</b>"'); $TemplateCustom = 'defaultSite'; \define('SKT_TEMPLATE_ERROR', 'ERROR: Se está mostrando el template por defecto.'); } else { \define('SKT_TEMPLATE_ERROR', ''); } //\define('SKTURL_TemplateSite', str_replace(\SUBSITE, '/', $SKT['URL']['SUBSITE'] . '_TemplateSite/' . $TemplateCustom)); \CmsDev\Layout\EditorLayoutsBox::get(); \define('SKTServerURL', \SUBSITE); \define('SKTImageSized', \SUBSITE . 'SKTSize/'); \define('SKTGoTo', \SUBSITE . 'SKTGoTo/'); $arr = array('LanguageFromFile' => \LanguageFromFile, 'SKTServerURL' => \SKTServerURL, 'SKTURL_Here' => \SKTURL_Here, 'SKTImageSized' => \SKTImageSized, 'SKTGoTo' => \SKTGoTo, 'SKTURL_REQUEST_URI' => \SKTURL_REQUEST_URI, 'SKTURL_REQUEST_PARAMS' => \SKTURL_REQUEST_PARAMS, 'VERSION' => \VERSION, 'SKT_TEMPLATE' => \SKT_TEMPLATE, 'SKTPATH' => \SKTPATH, 'SKTPATH_CmsDev' => \SKTPATH_CmsDev, 'SKTPATH_FileSystems' => \SKTPATH_FileSystems, 'SKTPATH_TemplateSite' => \SKTPATH_TemplateSite, 'SKTURL' => \SKTURL, 'SKTURL_CmsDev' => \SKTURL_CmsDev, 'SKTURL_FileSystems' => \SKTURL_FileSystems, 'SKTURL_TemplateSite' => \SKTURL_TemplateSite, 'SERVER_DIR' => \SERVER_DIR, 'LOCAL_DIR' => \LOCAL_DIR, 'LOCAL_FILESYSTEM' => \LOCAL_FILESYSTEM, 'LOCAL_FILESYSTEM_SECTION' => \LOCAL_FILESYSTEM_SECTION, 'TOTAL_REQUEST' => \TOTAL_REQUEST, 'SUBSITE' => $SKT['URL']['SUBSITE'], 'SUBURL' => $allRequest, 'THIS_URL_REAL' => $ThisSectionURLName, 'URL_VERSION' => \URL_VERSION, 'SKT_TEMPLATE_ERROR' => \SKT_TEMPLATE_ERROR); $this->DevShowParams .= '<h3><a href="#">Direcciones</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 ($arr as $variable => $value) { $this->DevShowParams .= '<tr><th class="defined"><span>' . $variable . '</span></th><th scope="row" class="value"><span>' . $value . '</span></th></tr>'; } $this->DevShowParams .= '</table>'; $GoTo = \SKTURL . 'SKTGoTo/'; $GoToURL = array('URL_CheckURLName' => 'CheckURLName', 'URL_CheckUserName' => 'CheckUserName', 'URL_QueryLanguage_Activate_Update' => 'CRUD/Language/Activate', 'URL_QuerySectionMeta' => 'CRUD/Section/SectionMeta', 'URL_QuerySectionData' => 'CRUD/Section/SectionData', 'URL_QueryContentProp' => 'CRUD/Contents/ContentProp', 'URL_Content_Add_Product' => 'CRUD/Product/Add', 'URL_Content_Edit_Product' => 'CRUD/Product/Edit', 'URL_Content_Add_Custom' => 'CRUD/CustomControl/Add', 'URL_Content_Edit_Custom' => 'CRUD/CustomControl/Edit', 'URL_Content_Add_Note' => 'CRUD/Note/Add', 'URL_Content_Edit_Note' => 'CRUD/Note/Edit', 'URL_Content_Add_Photo' => 'CRUD/Image/Add', 'URL_Content_Edit_Photo' => 'CRUD/Image/Edit', 'URL_FileSystemsPopUP' => 'AdminFilesystem/__FileSystemsPopUP', 'URL_QueryCreateContent' => 'Query/CreateContent', 'URL_QueryUpdateContent' => 'Query/UpdateContent', 'URL_QueryDeleteContent' => 'Query/DeleteContent', 'URL_Content_Edit_PlainText' => 'CRUD/PlainText/Edit', 'URL_Content_Edit_HTML' => 'CRUD/HTML/Edit', 'URL_QueryLoadPlainText' => 'Query/LoadPlainText', 'URL_QueryUpdateFileOrder' => 'Query/UpdateFileOrder', 'URL_QueryUpdateSectionProduct' => 'Query/UpdateSectionProduct', 'URL_QueryCreateSectionProduct' => 'Query/CreateSectionProduct', 'URL_View_List_Add_List' => 'CRUD/CustomList/Add_List', 'URL_View_List_SelectList' => 'CRUD/CustomList/SelectList', 'URL_Query_List_Add_List' => 'CRUD/CustomList/Add_List_query', 'URL_Query_Delete_List_query' => 'CRUD/CustomList/Delete_List_query', 'URL_View_List_Properties' => 'CRUD/CustomList/Properties', 'URL_Query_List_Edit_Properties' => 'CRUD/CustomList/Edit_Properties', 'URL_Query_Add_Item_query' => 'CRUD/CustomList/Add_Item_query', 'URL_Query_Edit_Item_query' => 'CRUD/CustomList/Edit_Item_query', 'URL_View_Add_Item' => 'CRUD/CustomList/Add_Item', 'URL_Query_Delete_Item_query' => 'CRUD/CustomList/Delete_Item_query', 'URL_Query_List_Edit_Item' => 'CRUD/CustomList/Edit_Item', 'URL_View_List_Items' => 'CRUD/CustomList/List_items', 'URL_View_List_Index' => 'CRUD/CustomList/index', 'URL_Edit_Item' => 'CRUD/CustomList/Edit_Item', 'URL_Link_Edit' => 'CRUD/Link/Edit', 'URL_Query_Link_Create' => 'Query/CreateLink', 'URL_Query_Link_Edit' => 'Query/EditLink', 'URL_Query_Link_Delete' => 'Query/DeleteLink', 'URL_View_List_Information' => 'CRUD/CustomList/List_Information', 'URL_ViewEditElementsAsList' => 'CRUD/ViewEditElementsAsList/index', 'URL_logs' => 'logs'); $GoToURLJS = ''; foreach ($GoToURL as $variable => $value) { \define($variable, $GoTo . self::uencsec($value)); $GoToURLJS .= 'var ' . $variable . '="' . $GoTo . self::uencsec($value) . '";'; } $GoToURLJS .= 'var PHARLOCATION ="' . \PHARLOCATION . '"; var LOCAL_FILESYSTEM ="' . $LOC . '_FileSystems/";'; \define('GoToURLJS', $GoToURLJS); \define('URL_SKTFSys', \SKTURL . 'SKTFSys/'); }