本文整理汇总了PHP中Plugins::call方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugins::call方法的具体用法?PHP Plugins::call怎么用?PHP Plugins::call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugins
的用法示例。
在下文中一共展示了Plugins::call方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modifyField
public function modifyField(&$data, $structure, $parameters)
{
if (isset($structure['parameters'])) {
$fieldParameters = $structure['parameters'];
} else {
$fieldParameters = array();
}
$field_parameters = array('fieldId' => $structure['id'], 'fieldType' => $structure['type'], 'fieldParameters' => $fieldParameters);
$field_parameters = array_merge($parameters, $field_parameters);
Plugins::call(Plugins::DATA_EDITOR_PLUGIN_PREPARE_FOR_OUTPUT, $field_parameters, $data);
}
示例2: sortCompareItems
public function sortCompareItems($a, $b)
{
$order_by = $this->tmp_sort_order_by;
$fields = $this->tmp_sort_fields;
$result = 0;
$first_sort_field = $this->getField($fields, $order_by['fieldId']);
Plugins::call(Plugins::DATA_EDITOR_PLUGIN_SORT_COMPARE_VALUES, array('type' => $first_sort_field['type'], 'fieldDefinition' => $first_sort_field, 'a' => $a[$order_by['fieldId']], 'b' => $b[$order_by['fieldId']]), $result);
if (isset($order_by['direction'])) {
if ($order_by['direction'] == 'desc') {
$result = $result * -1;
}
}
if ($result === 0) {
if (isset($order_by['additional'])) {
if (is_array($order_by['additional'])) {
foreach ($order_by['additional'] as $additional_order_by) {
if (isset($additional_order_by['fieldId'])) {
$additional_sort_field = $this->getField($fields, $additional_order_by['fieldId']);
if ($additional_sort_field !== false) {
Plugins::call(Plugins::DATA_EDITOR_PLUGIN_SORT_COMPARE_VALUES, array('type' => $additional_sort_field['type'], 'fieldDefinition' => $additional_sort_field, 'a' => $a[$additional_order_by['fieldId']], 'b' => $b[$additional_order_by['fieldId']]), $result);
if (isset($additional_order_by['direction'])) {
if ($additional_order_by['direction'] == 'desc') {
$result = $result * -1;
}
}
if ($result != 0) {
break;
}
}
}
}
}
}
}
return $result;
}
示例3: generate_url
<li><a href="<?php
echo generate_url(array('page' => 'packages'));
?>
"><img src="images/16/box.png" border="0" align="absmiddle" /> All Packages</a></li>
</ul>
</li>
<?php
}
# if ($packages)
?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"> Plugins<b class="caret"></b></a>
<ul class="dropdown-menu">
<?php
Plugins::call('menu');
?>
<li role="presentation" class="divider"></li>
<?php
if ($_SESSION['userlevel'] >= '10') {
echo ' <li><a href="plugin/view=admin">Plugin Admin</a></li>';
}
?>
</ul>
</li>
<?php
// Custom menubar entries.
if (is_file("includes/print-menubar-custom.inc.php")) {
include "includes/print-menubar-custom.inc.php";
}
示例4: applyPluginsToDataFieldParameters
protected function applyPluginsToDataFieldParameters($hook, $parameters, $field, &$field_parameters)
{
if ($field['type'] == 'array') {
if (is_array($field_parameters['fields'])) {
$plugin_parameters = array('arrayId' => $field['id']);
$plugin_parameters = array_merge($parameters, $plugin_parameters);
for ($i = 0; $i < count($field_parameters['fields']); $i++) {
$changed_field_parameters = array();
if (isset($field_parameters['fields'][$i]['parameters'])) {
$changed_field_parameters = $field_parameters['fields'][$i]['parameters'];
}
$this->applyPluginsToDataFieldParameters($hook, $plugin_parameters, $field_parameters['fields'][$i], $changed_field_parameters);
$field_parameters['fields'][$i]['parameters'] = $changed_field_parameters;
}
}
} else {
$plugin_parameters = array('fieldId' => $field['id'], 'fieldType' => $field['type']);
$plugin_parameters = array_merge($parameters, $plugin_parameters);
$changed_field_parameters = $field_parameters;
Plugins::call($hook, $plugin_parameters, $changed_field_parameters);
$field_parameters = $changed_field_parameters;
}
}
示例5: array
$ports_colour = $warn_colour_a;
} else {
$ports_colour = $list_colour_a;
}
echo '
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
</div>
</div>
<div class="row">
<div class="col-md-6">
';
require 'includes/dev-overview-data.inc.php';
Plugins::call('device_overview_container', array($device));
require 'overview/ports.inc.php';
echo '
</div>
<div class="col-md-6">
';
// Right Pane
require 'overview/processors.inc.php';
require 'overview/mempools.inc.php';
require 'overview/storage.inc.php';
if (is_array($entity_state['group']['c6kxbar'])) {
require 'overview/c6kxbar.inc.php';
}
require 'overview/toner.inc.php';
require 'overview/sensors/charge.inc.php';
require 'overview/sensors/temperatures.inc.php';
示例6: publishAction
public function publishAction()
{
// Parameter auslesen
$elements = Request::postParam('elements');
$recursive = $this->sanitizeBoolean(Request::postParam('recursive', '0'));
// Parameter �berpr�fen
if (!is_array($elements) || $recursive === null) {
$this->error(self::RESULT_ERROR_BAD_REQUEST);
return;
}
// Wenn $elements leer ist, nichts tun
if (count($elements) == 0) {
$this->success();
return;
}
// �berpr�fen, ob die zu ver�ffentlichenden Elemente existieren
$elements_exist = true;
foreach ($elements as $key => $value) {
if (is_numeric($value)) {
$elements[$key] = $this->pages->getProperties($value);
if ($elements[$key] === false) {
$elements_exist = false;
break;
}
} else {
$elements_exist = false;
break;
}
}
// Wenn eines der zu ver�ffentlichenden Elemente jetzt schon nicht mehr existiert, abbrechen
if (!$elements_exist) {
$this->error(self::RESULT_ERROR_DOES_NOT_EXIST);
return;
}
// Nutzerrechte �berpr�fen
if (!$this->helpers->canAccessAllElements($elements, Acl::ACTION_PUBLISH, $recursive)) {
$this->error(self::RESULT_ERROR_NOT_AUHTORIZED);
return;
}
// OnPageTreeBeginBatchPublishPage ausl�sen
$parameters = array();
$data = null;
Plugins::call(Plugins::PAGETREE_BEGIN_BATCH_PUBLISH_PAGE, $parameters, $data);
// Ver�ffentlichen
foreach ($elements as $element) {
if ($this->publishElements(array($element), $recursive) === false) {
$this->error();
return;
}
}
// OnPageTreeEndBatchPublishPage ausl�sen
$parameters = array();
$data = null;
Plugins::call(Plugins::PAGETREE_END_BATCH_PUBLISH_PAGE, $parameters, $data);
// Cache l�schen (da �nderung am Seitenbaum, die Navigation erscheint i.d.R. auf allen Seiten)
PageCache::invalidateAll();
$this->success();
}
示例7: resizeImage
//.........这里部分代码省略.........
if ($resized_image->getHeight() > $force_height) {
$crop_y = floor(($resized_image->getHeight() - $force_height) / 2);
}
$cropped_image = $resized_image->crop($crop_x, $crop_y, $force_width, $force_height);
$resized_image->destroy();
$this->saveImage($cropped_image, $absolute_path_to_dest_file, $jpeqQuality);
$cropped_image->destroy();
} else {
if ($this->equalDimensions($image_dimensions, $resized_image_dimensions)) {
FileUtils::copyFile($source, $absolute_path_to_dest_file);
} else {
$this->saveImage($resized_image, $absolute_path_to_dest_file, $jpeqQuality);
}
$resized_image->destroy();
}
break;
case 'forceWidth':
// Breite vorgegeben
$image = WideImage::load($source);
$image_dimensions = $this->getDimensions($image);
$resized_image = $image->resize($force_width, null, 'outside', 'any');
$resized_image_dimensions = $this->getDimensions($resized_image);
$image->destroy();
if ($max_height > 0 && $resized_image->getHeight() > $max_height) {
$crop_y = 0;
if ($resized_image->getHeight() > $max_height) {
$crop_y = floor(($resized_image->getHeight() - $max_height) / 2);
}
$cropped_image = $resized_image->crop(0, $crop_y, $force_width, $max_height);
$resized_image->destroy();
$this->saveImage($cropped_image, $absolute_path_to_dest_file, $jpeqQuality);
$cropped_image->destroy();
} else {
if ($this->equalDimensions($image_dimensions, $resized_image_dimensions)) {
FileUtils::copyFile($source, $absolute_path_to_dest_file);
} else {
$this->saveImage($resized_image, $absolute_path_to_dest_file, $jpeqQuality);
}
$resized_image->destroy();
}
break;
case 'forceHeight':
// H�he vorgegeben
$image = WideImage::load($source);
$image_dimensions = $this->getDimensions($image);
$resized_image = $image->resize(null, $force_height, 'outside', 'any');
$resized_image_dimensions = $this->getDimensions($resized_image);
$image->destroy();
if ($max_width > 0 && $resized_image->getWidth() > $max_width) {
$crop_x = 0;
if ($resized_image->getWidth() > $max_width) {
$crop_x = floor(($resized_image->getWidth() - $max_width) / 2);
}
$cropped_image = $resized_image->crop($crop_x, 0, $max_width, $force_height);
$resized_image->destroy();
$this->saveImage($cropped_image, $absolute_path_to_dest_file, $jpeqQuality);
$cropped_image->destroy();
} else {
if ($this->equalDimensions($image_dimensions, $resized_image_dimensions)) {
FileUtils::copyFile($source, $absolute_path_to_dest_file);
} else {
$this->saveImage($resized_image, $absolute_path_to_dest_file, $jpeqQuality);
}
$resized_image->destroy();
}
break;
case 'fitIn':
// in angegebenes Rechteck einpassen
$image = WideImage::load($source);
$image_dimensions = $this->getDimensions($image);
if ($max_width == 0) {
$max_width = null;
}
if ($max_height == 0) {
$max_height = null;
}
$resized_image = $image->resize($max_width, $max_height, 'inside', 'down');
$resized_image_dimensions = $this->getDimensions($resized_image);
$image->destroy();
if ($this->equalDimensions($image_dimensions, $resized_image_dimensions)) {
FileUtils::copyFile($source, $absolute_path_to_dest_file);
} else {
$this->saveImage($resized_image, $absolute_path_to_dest_file, $jpeqQuality);
}
$resized_image->destroy();
break;
}
} catch (WideImage_Exception $e) {
$result = false;
}
// im Erfolgsfall zum Stammverzeichnis relativen Pfad zur�ckgeben
if ($result) {
// M�glicherweise wird das Bild nochmal von einem geladenen Plugin bearbeitet
$plugin_parameters = array('source' => $source, 'parameters' => $parameters, 'preview' => $preview, 'customSettings' => $custom_settings);
Plugins::call(Plugins::AFTER_IMAGE_RESIZE, $plugin_parameters, $relative_path_to_dest_file);
return $relative_path_to_dest_file;
} else {
return false;
}
}
示例8: gettabcontentAction
public function gettabcontentAction()
{
$config = Config::getArray();
$html = '';
if ($config['showBackendModulesTab'] === true) {
if (count($config['backendModules']) > 0) {
$groups = $this->getModuleGroups();
if (count($groups) > 0) {
foreach ($groups as $group_id => $group) {
if (count($group['modules']) > 0) {
$html .= '<div class="pixelmanager-backend-modules-group-heading">' . Helpers::htmlEntities($group['caption']) . '</div>' . '<div class="list-group">';
foreach ($group['modules'] as $module_id => $module) {
$module_name = Translate::get($module['name']);
$caption = $module_name;
$plugin_parameters = array('moduleId' => $module_id, 'moduleConfig' => $module);
Plugins::call(Plugins::GET_BACKEND_MODULES_TAB_CAPTION, $plugin_parameters, $caption);
$html .= '<a href="javascript:;" class="list-group-item open-module-in-tab" data-module-id="' . Helpers::htmlEntities($module_id) . '" data-module-url="' . Helpers::htmlEntities($module['url']) . '" data-module-name="' . Helpers::htmlEntities($module_name) . '">' . $caption . '</a>';
}
$html .= '</div>';
}
}
}
}
}
$this->success($html);
}
示例9: route
public function route()
{
$path = Request::path();
// Vorschau-Modus? (Nur für eingeloggte Benutzer des Backends verfügbar)
$this->isPreview = false;
if (isset($_GET['pixelmanager-preview'])) {
if ($_GET['pixelmanager-preview'] == 'true') {
if (Auth::isLoggedIn()) {
$this->isPreview = true;
}
}
}
// Sprache feststellen
if (count($path) > 0) {
$found_language = false;
$found_language = $this->findLanguageByUrl($path[0]);
if ($found_language !== false) {
$this->languageId = $found_language;
array_splice($path, 0, 1);
}
}
if ($this->languageId === false) {
$this->languageId = Config::get()->languages->standard;
}
// Seite feststellen
if (count($path) > 0) {
$this->pageId = $this->pages->getPageIdByPath(Pages::ROOT_ID, $path, $this->languageId);
} else {
$this->pageId = $this->pages->getStartPageId($this->languageId);
}
// Wenn die URL auch keine Seite direkt spezifiziert,
// verweist möglicherweise der erste Teil der URL auf eine Seite
// und der Rest sind Parameter für diese Seite.
// Dazu fangen wir mit der kompletten URL an und dann nehmen wir immer ein
// Teil von rechts weg, bis wir eine URL haben, die eine Seite angibt.
// Dann fragen wir die installieren Plugins, ob für diese Seite
// ein Aufruf von ACCEPT_QUERY_STRING uns TRUE (oder eine alternative PageId) liefert. Falls ja,
// wird diese Seite als die aufgerufene Seite festgelegt und die
// Variable $this->pluginQueryString auf den rechten Teil der URL gesetzt,
// zu dem keine passende Seite gefunde werden konnte.
if ($this->pageId === false && count($path) > 0) {
$test_path = $path;
$query_path_for_plugin = array();
for ($i = count($path) - 1; $i >= 0; $i--) {
$test_page_id = $this->pages->getPageIdByPath(Pages::ROOT_ID, $test_path, $this->languageId);
if ($test_page_id !== false) {
$page_properties = $this->pages->getProperties($test_page_id);
$query_string = implode('/', $query_path_for_plugin);
$parameters = array('pageId' => $test_page_id, 'languageId' => $this->languageId, 'queryString' => $query_string, 'pageProperties' => $page_properties);
$query_string_accepted = false;
Plugins::call(Plugins::ACCEPT_QUERY_STRING, $parameters, $query_string_accepted);
if ($query_string_accepted === true) {
$this->pageId = $test_page_id;
$this->pluginQueryString = $query_string;
break;
} elseif ($query_string_accepted === false) {
// nichts tun
} elseif (is_numeric($query_string_accepted)) {
$test_page = $this->pages->getProperties($query_string_accepted);
if ($test_page !== false) {
$this->pageId = $query_string_accepted;
$this->pluginQueryString = $query_string;
break;
}
}
}
$test_path = array_slice($test_path, 0, count($test_path) - 1);
array_unshift($query_path_for_plugin, $path[$i]);
}
}
// Prüfen, ob die Seite aktiv ist (im Vorschau-Modus trotzdem zulassen)
if ($this->pageId !== false && !$this->isPreview) {
if (!$this->pages->isPageActive($this->pageId)) {
$this->pageId = false;
}
}
if ($this->pageId !== false) {
$this->pageFound = true;
} else {
$this->pageFound = false;
}
// Wenn die Seite gefunden wurde, feststellen, ob die Seite eine Weiterleitung ist
if ($this->pageFound) {
$properties = $this->pages->getProperties($this->pageId);
if ($properties !== false) {
$this->isPageLink = $this->pages->isPageLink($this->pageId, $properties);
if ($this->pages->isPageLinkTranslated($this->pageId, $properties)) {
$this->pageLinkUrl = $this->pages->getTranslatedPageLinkUrl($this->pageId, $this->languageId);
} else {
$this->pageLinkUrl = $this->pages->getPageLinkUrl($this->pageId, $properties);
}
$this->pageLinkNewWindow = $this->pages->getPageLinkNewWindow($this->pageId, $properties);
}
}
}
示例10: getPage
public function getPage($page_id, $language_id, $preview = false)
{
// Smarty initialisieren
$smarty = new Template();
// Seiten-Infos laden
$pages = new Pages();
$page_properties = $pages->getProperties($page_id);
if ($page_properties === false) {
Helpers::fatalError('A page with the ID "' . $page_id . '" does not exist!');
}
// Wenn die Vorschau-Version der Seite angefordert wurde,
// überprüfen, ob überhaupt eine editierte Version der Seite existiert,
// wenn nicht, Vorschau-Modus ignorieren
if ($preview) {
if ($page_properties['status'] == Pages::STATUS_PUBLISHED) {
$preview = false;
}
}
// Seiteneigenes Verzeichnis abhängig von $preview auslesen
if ($preview) {
$page_files = $pages->getPageFilesEditFolder($page_id, $page_properties);
$page_files_url = $pages->getPageFilesEditUrl($page_id, $page_properties);
} else {
$page_files = $pages->getPageFilesPublishedFolder($page_id, $page_properties);
$page_files_url = $pages->getPageFilesPublishedUrl($page_id, $page_properties);
}
$page_url = $pages->getPageUrl($page_id, $language_id, $page_properties);
// Grundlegende Variablen zuweisen, die zwar mit dem Inhalt nichts zu tun haben, aber wichtig sind :-)
$smarty->assign('baseUrl', Config::get()->baseUrl);
$smarty->assign('publicUrl', Config::get()->baseUrl . 'system/custom/frontend/public/');
$smarty->assign('pageUrl', $page_url);
$smarty->assign('pageId', $page_id);
$smarty->assign('languageId', $language_id);
$smarty->assign('templateId', $page_properties['template-id']);
$smarty->assign('uniqueId', $page_properties['unique-id']);
$smarty->assign('pageFiles', $page_files);
$smarty->assign('pageFilesUrl', $page_files_url);
$languages = Config::get()->languages->list->getArrayCopy();
foreach ($languages as $key => $value) {
$languages[$key]['id'] = $key;
}
$smarty->assign('languages', $languages);
// Seiten-Struktur laden
$pages_structure = DataStructure::pagesArray();
if (!isset($pages_structure[$page_properties['template-id']]['structure'])) {
Helpers::fatalError('A page template with the ID "' . $page_properties['template-id'] . '" does not exist!');
}
$page_structure = $pages_structure[$page_properties['template-id']]['structure'];
// Die folgenden Parameter werden an die Modifikatoren und Plugins übergeben
$parameters = array('preview' => $preview, 'pageId' => $page_id, 'languageId' => $language_id, 'templateId' => $page_properties['template-id'], 'uniqueId' => $page_properties['unique-id'], 'pageUrl' => $page_url, 'pageFiles' => $page_files, 'pageFilesUrl' => $page_files_url, 'smarty' => $smarty);
// Seiten-Inhalt laden
$content_object = new PageContent();
if (!$content_object->load($page_id, !$preview)) {
Helpers::fatalError('The content of the page with the ID "' . $page_id . '" could not be loaded!');
}
$page_content = $content_object->getArray($language_id, $smarty, $parameters);
// Globale Elemente laden
$this->loadGlobalElementsPage($smarty, $language_id);
$this->assignGlobalElementsToSmarty($smarty, $language_id);
// Inhalte zuweisen
foreach ($page_structure as $block_id => $block) {
if ($block['type'] == 'datablock') {
$block_data = null;
if (isset($page_content[$block_id])) {
$block_data = $page_content[$block_id];
}
$smarty->assign($block_id, $block_data);
} elseif ($block['type'] == 'container') {
$container_content = '';
if (isset($page_content[$block_id])) {
if (is_array($page_content[$block_id])) {
foreach ($page_content[$block_id] as $container_element_key => $container_element) {
$container_content = $container_content . $this->getElement($page_id, $language_id, $container_element['elementId'], $container_element['content'], $preview);
}
}
}
$smarty->assign($block_id, $container_content);
}
}
// registrierte Plugins aufrufen, vielleicht hat ja noch jemand etwas hinzuzufügen :-)
Plugins::call(Plugins::ASSIGN_PAGE_DATA, $parameters);
// Smarty-Template für die Template-ID der aktuellen Seite zurückgeben
$page_template = $pages_structure[$page_properties['template-id']];
return $smarty->fetch('file:[pages]' . $page_template['template']);
}
示例11: applyPluginsToDataField
protected function applyPluginsToDataField($hook, $parameters, $field, &$data, $languages)
{
if ($field['type'] == 'array') {
if (is_array($data)) {
$field_parameters = array('arrayId' => $field['id']);
$field_parameters = array_merge($parameters, $field_parameters);
foreach ($data as $row_key => $row_data) {
foreach ($field['parameters']['fields'] as $array_field) {
if (isset($data[$row_key][$array_field['id']])) {
$changed_data = $data[$row_key][$array_field['id']];
$this->applyPluginsToDataField($hook, $field_parameters, $array_field, $changed_data, $languages);
$data[$row_key][$array_field['id']] = $changed_data;
}
}
}
}
} else {
$untranslatable = false;
if (isset($field['untranslatable'])) {
$untranslatable = $field['untranslatable'];
}
if (!$untranslatable) {
foreach ($languages as $language_id => $language) {
if (isset($data[$language_id])) {
if (isset($field['parameters'])) {
$fieldParameters = $field['parameters'];
} else {
$fieldParameters = array();
}
$field_parameters = array('fieldId' => $field['id'], 'fieldType' => $field['type'], 'fieldParameters' => $fieldParameters, 'languageId' => $language_id);
$field_parameters = array_merge($parameters, $field_parameters);
$changed_data = $data[$language_id];
Plugins::call($hook, $field_parameters, $changed_data);
$data[$language_id] = $changed_data;
}
}
} else {
if (isset($data)) {
if (isset($field['parameters'])) {
$fieldParameters = $field['parameters'];
} else {
$fieldParameters = array();
}
$field_parameters = array('fieldId' => $field['id'], 'fieldType' => $field['type'], 'fieldUntranslatable' => true, 'fieldParameters' => $fieldParameters);
$field_parameters = array_merge($parameters, $field_parameters);
$changed_data = $data;
Plugins::call($hook, $field_parameters, $changed_data);
$data = $changed_data;
}
}
}
}
示例12: list_dbs
/**
* Get a list of all databases visible to the current database user.
* DB names are cached.
*
* @param boolean $refresh_cache Don't use the cache, but rebuild it.
* @return array[string] List of all available databases.
*/
public function list_dbs($refresh_cache = FALSE)
{
$token = Profiler::start('WebDB', __METHOD__);
if (!$this->_connection) {
return array();
}
// Check cache
$cache = Cache::instance();
$cache_key = 'database_names_' . Auth::instance()->get_user();
$this->_database_names = $cache->get($cache_key);
// If not cached, query DB
if (!is_array($this->_database_names) or $refresh_cache) {
$this->_database_names = array();
$query = mysql_query("SHOW DATABASES", $this->_connection);
while ($row = mysql_fetch_row($query)) {
$this->_database_names[] = $row[0];
}
// Plugins
Plugins::call('classes.webdb.dbms.list-dbs', $this->_database_names);
// Cache
Kohana::$log->add(Kohana_Log::DEBUG, "Caching DB names under {$cache_key}.");
$cache->set($cache_key, $this->_database_names);
}
Profiler::stop($token);
return $this->_database_names;
}
示例13: run
public function run()
{
// Startup-Ereignis
Plugins::call(Plugins::STARTUP, null);
// Router laden
$router_file_name = Config::get()->frontendRouter->classFile;
if (!file_exists($router_file_name)) {
Helpers::fatalError('Frontend router class file not found (' . $router_file_name . ' doesn\'t exist)!', true);
}
require_once $router_file_name;
$router_class_name = Config::get()->frontendRouter->className;
if (!class_exists($router_class_name)) {
Helpers::fatalError('Frontend router class not found (class "' . $router_class_name . '" doesn\'t exist in ' . $router_file_name . ')!', true);
}
$router = new $router_class_name();
Registry::set('frontendRouter', $router);
// PageBuilder laden
$page_builder_file_name = Config::get()->pageBuilder->classFile;
if (!file_exists($page_builder_file_name)) {
Helpers::fatalError('PageBuilder class file not found (' . $page_builder_file_name . ' doesn\'t exist)!', true);
}
require_once $page_builder_file_name;
$page_builder_class_name = Config::get()->pageBuilder->className;
if (!class_exists($page_builder_class_name)) {
Helpers::fatalError('PageBuilder class not found (class "' . $page_builder_class_name . '" doesn\'t exist in ' . $page_builder_file_name . ')!', true);
}
$page_builder = new $page_builder_class_name();
Registry::set('pageBuilder', $page_builder);
// routing
$router->route();
$languageId = $router->getLanguageId();
if ($router->pageFound()) {
$pageId = $router->getPageId();
$error_404 = false;
} else {
$pageId = $router->getErrorPageId();
$error_404 = true;
}
if ($pageId !== false) {
// Ist die Seite ein Link? Dann einfach auf die angegebene URL weiterleiten...
if ($router->isPageLink()) {
Helpers::redirect($router->getPageLinkUrl(), Config::get()->pageLinkRedirectionResponseCode);
exit;
}
// �bersetzungen laden
$config = Config::getArray();
$languages = $config['languages']['list'];
setlocale(LC_ALL, $languages[$languageId]['locale']);
if (is_array($languages[$languageId]['translation'])) {
if (count($languages[$languageId]['translation']) > 0) {
foreach ($languages[$languageId]['translation'] as $translation_file) {
Translate::loadStrings($translation_file, $languageId);
}
}
} else {
if ($languages[$languageId]['translation'] != '') {
Translate::loadStrings($languages[$languageId]['translation'], $languageId);
}
}
// Before-Display-Ereignis
Plugins::call(Plugins::BEFORE_DISPLAY, array('preview' => $router->isPreview(), 'pageId' => $pageId, 'languageId' => $languageId));
if (!$router->isPreview()) {
// Versuchen, die Seite aus dem Cache zu holen
$output = PageCache::getPage($pageId, $languageId);
$output_cached = false;
// Keine Version im Cache verf�gbar, Seite neu erzeugen
if ($output === false) {
$output = $page_builder->getPage($pageId, $languageId);
} else {
$output_cached = true;
}
// Wenn noch nicht im Cache, erzeugte Ausgabe im Cache ablegen
if (!$output_cached) {
PageCache::cachePage($pageId, $languageId, $output);
}
} else {
// Im Vorschau-Modus den Cache nicht verwenden
// Und dem PageBuilder sagen, dass er die Vorschau-Version erstellen soll
$output = $page_builder->getPage($pageId, $languageId, true);
$output_cached = false;
}
// HTTP-Header senden
if ($error_404) {
if (!headers_sent()) {
header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
}
}
$page_builder->outputHeader($pageId, $languageId);
// Header-Senden-Ereignis
Plugins::call(Plugins::SEND_HEADER, array('preview' => $router->isPreview(), 'pageId' => $pageId, 'languageId' => $languageId));
// Modify-Output-Before-Display-Ereignis, bietet die M�glichkeit,
// dass ein Plugin die Ausgabe vor der Ausgabe nochmal ver�ndert,
// unabh�ngig davon, ob die Seite aus dem Cache geladen wurde oder nicht
Plugins::call(Plugins::MODIFY_OUTPUT_BEFORE_DISPLAY, array('preview' => $router->isPreview(), 'pageId' => $pageId, 'languageId' => $languageId, 'isCached' => $output_cached), $output);
// Seite ausgeben
print $output;
// After-Display-Ereignis
Plugins::call(Plugins::AFTER_DISPLAY, array('preview' => $router->isPreview(), 'pageId' => $pageId, 'languageId' => $languageId));
} else {
Helpers::fatalError('Error 404: page not found ', true);
//.........这里部分代码省略.........