本文整理汇总了PHP中Pages::isGlobalElementsPageTemplateAvailable方法的典型用法代码示例。如果您正苦于以下问题:PHP Pages::isGlobalElementsPageTemplateAvailable方法的具体用法?PHP Pages::isGlobalElementsPageTemplateAvailable怎么用?PHP Pages::isGlobalElementsPageTemplateAvailable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pages
的用法示例。
在下文中一共展示了Pages::isGlobalElementsPageTemplateAvailable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defaultAction
public function defaultAction()
{
if (Translate::getId() != '') {
$config = Config::getArray();
$languages = $config['backendLanguages']['list'];
$language_id = Translate::getId();
$strings = array();
if (is_array($languages[$language_id]['translationClientside'])) {
if (count($languages[$language_id]['translationClientside']) > 0) {
foreach ($languages[$language_id]['translationClientside'] as $translation_file) {
$temp = (include $translation_file);
$strings = array_merge($strings, $temp);
}
}
} else {
if ($languages[$language_id]['translationClientside'] != '') {
$strings = (include $languages[$language_id]['translationClientside']);
}
}
$this->view->assign('backendTranslation', $strings);
} else {
$this->view->assign('backendTranslation', array());
}
$useGlobalElementsPage = false;
$pages = new Pages();
if ($pages->isGlobalElementsPageTemplateAvailable()) {
if ($pages->isGlobalElementsPageAvailable()) {
$useGlobalElementsPage = true;
}
}
$this->view->assign('useGlobalElementsPage', $useGlobalElementsPage);
$this->view->assign('globalElementsPageId', $pages->getGlobalElementsPageId());
}
示例2: Pages
}
} else {
if ($languages[$language_id]['translationServerside'] != '') {
Translate::loadStrings($languages[$language_id]['translationServerside'], $language_id);
}
}
// Datenstruktur laden (ist hier eigentlich nocht nicht nötig,
// aber so wird überprüft, ob alle nötigen Dateien existieren
// und die Arrays zurückgegebeb werden)
DataStructure::load();
// Plugins laden
Plugins::load();
// Falls die gesonderte Seite mit den globalen Elementen verwendet werden soll,
// diese ggf. anlegen
$pages = new Pages();
if ($pages->isGlobalElementsPageTemplateAvailable()) {
$pages->createGlobalElementsPage();
}
// Request-Pfad auslesen
$path = Request::path();
// Feststellen, ob ein Modul geladen werden soll, oder Grundsystem
$is_module = false;
if (isset($path[0]) && isset($path[1]) && isset($path[2])) {
if ($path[0] == 'modules' && trim($path[1]) != '' && trim($path[2]) != '') {
$is_module = true;
}
}
if ($is_module) {
// ************************************************************************************
// Modul
// ************************************************************************************
示例3: assignGlobalElementsToSmarty
public function assignGlobalElementsToSmarty($smarty, $language_id)
{
$pages = new Pages();
if ($pages->isGlobalElementsPageTemplateAvailable()) {
if ($pages->isGlobalElementsPageAvailable()) {
$global_elements_page_id = $pages->getGlobalElementsPageId();
$global_elements_page_properties = $pages->getProperties($global_elements_page_id);
if ($global_elements_page_properties !== false) {
$global_elements = array();
foreach ($this->global_elements_page_structure as $block_id => $block) {
if ($block['type'] == 'datablock') {
$block_data = null;
if (isset($this->global_elements_page_content[$block_id])) {
$block_data = $this->global_elements_page_content[$block_id];
}
$field_data = $this->getFieldsData($block['fields'], $block_data, $language_id);
$global_elements[$block_id] = $field_data;
} elseif ($block['type'] == 'container') {
$container_content = '';
if (isset($this->global_elements_page_content[$block_id])) {
if (is_array($this->global_elements_page_content[$block_id])) {
foreach ($this->global_elements_page_content[$block_id] as $container_element_key => $container_element) {
$container_content = $container_content . $this->getElement($global_elements_page_id, $language_id, $container_element['elementId'], $container_element['content'], false);
}
}
}
$global_elements[$block_id] = $container_content;
}
}
$smarty->assign('globalElements', $global_elements);
}
}
}
}