当前位置: 首页>>代码示例>>PHP>>正文


PHP BackendTemplate::output方法代码示例

本文整理汇总了PHP中BackendTemplate::output方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendTemplate::output方法的具体用法?PHP BackendTemplate::output怎么用?PHP BackendTemplate::output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BackendTemplate的用法示例。


在下文中一共展示了BackendTemplate::output方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: generate

 public function generate()
 {
     \System::loadLanguageFile('iso_upgrade');
     $this->Template = new \BackendTemplate($this->strTemplate);
     $this->Template->base = \Environment::get('base');
     $this->Template->action = \Environment::get('request');
     $this->Template->slabel = $GLOBALS['TL_LANG']['UPG']['submit'];
     $this->compile();
     $this->Template->output();
     exit;
 }
开发者ID:Aziz-JH,项目名称:core,代码行数:11,代码来源:Assistant.php

示例2: run

 /**
  * Run the controller and parse the login template
  */
 public function run()
 {
     /** @var \BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_login');
     // Show a cookie warning
     if (\Input::get('referer', true) != '' && empty($_COOKIE)) {
         $objTemplate->noCookies = $GLOBALS['TL_LANG']['MSC']['noCookies'];
     }
     $strHeadline = sprintf($GLOBALS['TL_LANG']['MSC']['loginTo'], \Config::get('websiteTitle'));
     $objTemplate->theme = \Backend::getTheme();
     $objTemplate->messages = \Message::generate();
     $objTemplate->base = \Environment::get('base');
     $objTemplate->language = $GLOBALS['TL_LANGUAGE'];
     $objTemplate->languages = \System::getLanguages(true);
     $objTemplate->title = specialchars($strHeadline);
     $objTemplate->charset = \Config::get('characterSet');
     $objTemplate->action = ampersand(\Environment::get('request'));
     $objTemplate->userLanguage = $GLOBALS['TL_LANG']['tl_user']['language'][0];
     $objTemplate->headline = $strHeadline;
     $objTemplate->curLanguage = \Input::post('language') ?: str_replace('-', '_', $GLOBALS['TL_LANGUAGE']);
     $objTemplate->curUsername = \Input::post('username') ?: '';
     $objTemplate->uClass = $_POST && empty($_POST['username']) ? ' class="login_error"' : '';
     $objTemplate->pClass = $_POST && empty($_POST['password']) ? ' class="login_error"' : '';
     $objTemplate->loginButton = specialchars($GLOBALS['TL_LANG']['MSC']['loginBT']);
     $objTemplate->username = $GLOBALS['TL_LANG']['tl_user']['username'][0];
     $objTemplate->password = $GLOBALS['TL_LANG']['MSC']['password'][0];
     $objTemplate->feLink = $GLOBALS['TL_LANG']['MSC']['feLink'];
     $objTemplate->frontendFile = \Environment::get('base');
     $objTemplate->disableCron = \Config::get('disableCron');
     $objTemplate->ie6warning = sprintf($GLOBALS['TL_LANG']['ERR']['ie6warning'], '<a href="http://ie6countdown.com">', '</a>');
     $objTemplate->default = $GLOBALS['TL_LANG']['MSC']['default'];
     $objTemplate->output();
 }
开发者ID:rheintechnology,项目名称:core,代码行数:36,代码来源:BackendIndex.php

示例3: run

 /**
  * Run the controller and parse the template
  */
 public function run()
 {
     /** @var \BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_preview');
     $objTemplate->base = \Environment::get('base');
     $objTemplate->language = $GLOBALS['TL_LANGUAGE'];
     $objTemplate->title = specialchars($GLOBALS['TL_LANG']['MSC']['fePreview']);
     $objTemplate->charset = \Config::get('characterSet');
     $objTemplate->site = \Input::get('site', true);
     if (\Input::get('url')) {
         $objTemplate->url = \Environment::get('base') . \Input::get('url');
     } elseif (\Input::get('page')) {
         $objTemplate->url = $this->redirectToFrontendPage(\Input::get('page'), \Input::get('article'), true);
     } else {
         $objTemplate->url = \Environment::get('base');
     }
     // Switch to a particular member (see #6546)
     if (\Input::get('user') && $this->User->isAdmin) {
         $objUser = \MemberModel::findByUsername(\Input::get('user'));
         if ($objUser !== null) {
             $strHash = sha1(session_id() . (!\Config::get('disableIpCheck') ? \Environment::get('ip') : '') . 'FE_USER_AUTH');
             // Remove old sessions
             $this->Database->prepare("DELETE FROM tl_session WHERE tstamp<? OR hash=?")->execute(time() - \Config::get('sessionTimeout'), $strHash);
             // Insert the new session
             $this->Database->prepare("INSERT INTO tl_session (pid, tstamp, name, sessionID, ip, hash) VALUES (?, ?, ?, ?, ?, ?)")->execute($objUser->id, time(), 'FE_USER_AUTH', session_id(), \Environment::get('ip'), $strHash);
             // Set the cookie
             $this->setCookie('FE_USER_AUTH', $strHash, time() + \Config::get('sessionTimeout'), null, null, false, true);
             $objTemplate->user = \Input::post('user');
         }
     }
     \Config::set('debugMode', false);
     $objTemplate->output();
 }
开发者ID:StephenGWills,项目名称:sample-contao-app,代码行数:36,代码来源:BackendPreview.php

示例4: outputAndExit

 /**
  * Output the template file and exit
  */
 protected function outputAndExit()
 {
     $this->Template->theme = \Backend::getTheme();
     $this->Template->base = \Environment::get('base');
     $this->Template->language = $GLOBALS['TL_LANGUAGE'];
     $this->Template->charset = \Config::get('characterSet');
     $this->Template->pageOffset = \Input::cookie('BE_PAGE_OFFSET');
     $this->Template->action = ampersand(\Environment::get('request'));
     $this->Template->noCookies = $GLOBALS['TL_LANG']['MSC']['noCookies'];
     $this->Template->title = specialchars($GLOBALS['TL_LANG']['tl_install']['installTool'][0]);
     $this->Template->expandNode = $GLOBALS['TL_LANG']['MSC']['expandNode'];
     $this->Template->collapseNode = $GLOBALS['TL_LANG']['MSC']['collapseNode'];
     $this->Template->loadingData = $GLOBALS['TL_LANG']['MSC']['loadingData'];
     $this->Template->ie6warning = sprintf($GLOBALS['TL_LANG']['ERR']['ie6warning'], '<a href="http://ie6countdown.com">', '</a>');
     $this->Template->hasComposer = is_dir(TL_ROOT . '/system/modules/!composer');
     $this->Template->output();
     exit;
 }
开发者ID:eknoes,项目名称:core,代码行数:21,代码来源:BackendInstall.php

示例5: run

 /**
  * Run the controller
  */
 public function run()
 {
     // Parse the changelog file
     $strBuffer = file_get_contents(TL_ROOT . '/system/docs/CHANGELOG.md');
     // Remove carriage returns (see #4190)
     $strBuffer = str_replace("\r", '', $strBuffer);
     // Convert to HTML
     $strBuffer = \Michelf\MarkdownExtra::defaultTransform($strBuffer);
     /** @var \BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_changelog');
     // Assign the template variables
     $objTemplate->content = $strBuffer;
     $objTemplate->theme = \Backend::getTheme();
     $objTemplate->base = \Environment::get('base');
     $objTemplate->language = $GLOBALS['TL_LANGUAGE'];
     $objTemplate->title = specialchars($GLOBALS['TL_LANG']['MSC']['changelog']);
     $objTemplate->charset = \Config::get('characterSet');
     \Config::set('debugMode', false);
     $objTemplate->output();
 }
开发者ID:StephenGWills,项目名称:sample-contao-app,代码行数:23,代码来源:BackendChangelog.php

示例6: run

 /**
  * Run the controller.
  */
 public function run()
 {
     // user have to be authenticated
     $this->User->authenticate();
     // disable Avisota
     if ($this->Input->get('disable')) {
         $inactiveModules = deserialize($GLOBALS['TL_CONFIG']['inactiveModules'], true);
         $inactiveModules[] = 'Avisota';
         $this->Config->update("\$GLOBALS['TL_CONFIG']['inactiveModules']", serialize($inactiveModules));
         $this->Config->save();
         $_SESSION[TL_INFO][] = $GLOBALS['TL_LANG']['avisotaCompatibilityController']['disabled'];
         $this->redirect('contao/main.php');
     }
     $template = new BackendTemplate('be_avisota_compatibility_controller');
     $template->theme = $this->getTheme();
     $template->base = $this->Environment->base;
     $template->language = $GLOBALS['TL_LANGUAGE'];
     $template->title = $GLOBALS['TL_CONFIG']['websiteTitle'];
     $template->charset = $GLOBALS['TL_CONFIG']['characterSet'];
     $template->request = ampersand($this->Environment->request);
     $template->top = $GLOBALS['TL_LANG']['MSC']['backToTop'];
     $template->mysqlVersion = \Database::getInstance()->query('SHOW VARIABLES WHERE Variable_name = \'version\'')->Value;
     $template->output();
 }
开发者ID:Ainschy,项目名称:contao-core,代码行数:27,代码来源:AvisotaCompatibilityController.php

示例7: executePreActions

 /**
  * Ajax actions that do not require a data container object
  */
 public function executePreActions()
 {
     switch ($this->strAction) {
         // Toggle navigation menu
         case 'toggleNavigation':
             $bemod = $this->Session->get('backend_modules');
             $bemod[$this->Input->post('id')] = intval($this->Input->post('state'));
             $this->Session->set('backend_modules', $bemod);
             exit;
             break;
             // Load a navigation menu group
         // Load a navigation menu group
         case 'loadNavigation':
             $bemod = $this->Session->get('backend_modules');
             $bemod[$this->Input->post('id')] = intval($this->Input->post('state'));
             $this->Session->set('backend_modules', $bemod);
             $this->import('BackendUser', 'User');
             $navigation = $this->User->navigation();
             $objTemplate = new BackendTemplate('be_navigation');
             $objTemplate->modules = $navigation[$this->Input->post('id')]['modules'];
             $objTemplate->output();
             exit;
             break;
         case 'loadJasonNavigation':
             $this->import('BackendUser', 'User');
             $navigation = $this->User->navigation();
             $session = $this->Session->getData();
             foreach ($GLOBALS['BE_MOD'] as $strGroupName => $arrGroupModules) {
                 $session['backend_modules'][$strGroupName] = 1;
             }
             $this->Session->setData($session);
             $this->Session->set('backend_modules', '');
             $this->prepareJsonNavigationArray($navigation);
             //echo json_encode($navigation);
             exit;
             break;
         case 'getNewExtVersion':
             exit;
             break;
             // Toggle nodes of the file or page tree
         // Toggle nodes of the file or page tree
         case 'toggleStructure':
         case 'toggleFileManager':
         case 'togglePagetree':
         case 'toggleFiletree':
             $this->strAjaxId = preg_replace('/.*_([0-9a-zA-Z]+)$/i', '$1', $this->Input->post('id'));
             $this->strAjaxKey = str_replace('_' . $this->strAjaxId, '', $this->Input->post('id'));
             if ($this->Input->get('act') == 'editAll') {
                 $this->strAjaxKey = preg_replace('/(.*)_[0-9a-zA-Z]+$/i', '$1', $this->strAjaxKey);
                 $this->strAjaxName = preg_replace('/.*_([0-9a-zA-Z]+)$/i', '$1', $this->Input->post('name'));
             }
             $nodes = $this->Session->get($this->strAjaxKey);
             $nodes[$this->strAjaxId] = intval($this->Input->post('state'));
             $this->Session->set($this->strAjaxKey, $nodes);
             exit;
             break;
             // Load nodes of the file or page tree
         // Load nodes of the file or page tree
         case 'loadStructure':
         case 'loadFileManager':
         case 'loadPagetree':
         case 'loadFiletree':
             $this->strAjaxId = preg_replace('/.*_([0-9a-zA-Z]+)$/i', '$1', $this->Input->post('id'));
             $this->strAjaxKey = str_replace('_' . $this->strAjaxId, '', $this->Input->post('id'));
             if ($this->Input->get('act') == 'editAll') {
                 $this->strAjaxKey = preg_replace('/(.*)_[0-9a-zA-Z]+$/i', '$1', $this->strAjaxKey);
                 $this->strAjaxName = preg_replace('/.*_([0-9a-zA-Z]+)$/i', '$1', $this->Input->post('name'));
             }
             $nodes = $this->Session->get($this->strAjaxKey);
             $nodes[$this->strAjaxId] = intval($this->Input->post('state'));
             $this->Session->set($this->strAjaxKey, $nodes);
             break;
             // Toggle the visibility of content elements
         // Toggle the visibility of content elements
         case 'toggleVisibility':
             $this->Database->prepare("UPDATE tl_content SET invisible='" . (intval($this->Input->post('state') == 1) ? '' : 1) . "' WHERE id=?")->execute($this->Input->post('id'));
             $this->markNodeAsDirty($this->Input->post('id'), 'tl_content');
             exit;
             break;
         case 'toggleFieldset':
             $fs = $this->Session->get('fieldset_states');
             $fs[$this->Input->post('table')][$this->Input->post('id')] = intval($this->Input->post('state'));
             $this->Session->set('fieldset_states', $fs);
             exit;
             break;
             // Check whether the temporary directory is writeable
         // Check whether the temporary directory is writeable
         case 'liveUpdate':
             $GLOBALS['TL_CONFIG']['liveUpdateId'] = $this->Input->post('id');
             $this->Config->update("\$GLOBALS['TL_CONFIG']['liveUpdateId']", $this->Input->post('id'));
             try {
                 $objFile = new File('system/tmp/' . md5(uniqid('', true)));
                 $objFile->close();
                 $objFile->delete();
             } catch (Exception $e) {
                 if ($e->getCode() == 0) {
                     $this->loadLanguageFile('tl_maintenance');
//.........这里部分代码省略.........
开发者ID:jens-wetzel,项目名称:use2,代码行数:101,代码来源:extAjax.php

示例8: compareTemplate

 /**
  * Compares the current to the original template
  *
  * @param DataContainer $dc
  *
  * @return string
  */
 public function compareTemplate(DataContainer $dc)
 {
     $strCurrentPath = $dc->id;
     $strName = pathinfo($strCurrentPath, PATHINFO_FILENAME);
     $strExtension = pathinfo($strCurrentPath, PATHINFO_EXTENSION);
     $arrTemplates = TemplateLoader::getFiles();
     $blnOverridesAnotherTpl = isset($arrTemplates[$strName]);
     $strPrefix = '';
     if (($pos = strpos($strName, '_')) !== false) {
         $strPrefix = substr($strName, 0, $pos + 1);
     }
     $strBuffer = '';
     $strCompareName = null;
     $strComparePath = null;
     // By default it's the original template to compare against
     if ($blnOverridesAnotherTpl) {
         $strCompareName = $strName;
         $strComparePath = $arrTemplates[$strCompareName] . '/' . $strCompareName . '.' . $strExtension;
         if ($strComparePath !== null) {
             $strBuffer .= '<p class="tl_info" style="margin-bottom:1em">' . sprintf($GLOBALS['TL_LANG']['tl_templates']['overridesAnotherTpl'], $strComparePath) . '</p>';
         }
     }
     // User selected template to compare against
     if (\Input::post('from') && isset($arrTemplates[\Input::post('from')])) {
         $strCompareName = \Input::post('from');
         $strComparePath = $arrTemplates[$strCompareName] . '/' . $strCompareName . '.' . $strExtension;
     }
     if ($strComparePath !== null) {
         $objCurrentFile = new \File($strCurrentPath, true);
         $objCompareFile = new \File($strComparePath, true);
         // Abort if one file is missing
         if (!$objCurrentFile->exists() || !$objCompareFile->exists()) {
             $this->redirect('contao/main.php?act=error');
         }
         $objDiff = new Diff($objCompareFile->getContentAsArray(), $objCurrentFile->getContentAsArray());
         $strDiff = $objDiff->Render(new DiffRenderer(array('field' => $strCurrentPath)));
         // Identical versions
         if ($strDiff == '') {
             $strBuffer .= '<p>' . $GLOBALS['TL_LANG']['MSC']['identicalVersions'] . '</p>';
         } else {
             $strBuffer .= $strDiff;
         }
     } else {
         $strBuffer .= '<p class="tl_info">' . $GLOBALS['TL_LANG']['tl_templates']['pleaseSelect'] . '</p>';
     }
     // Templates to compare against
     $arrComparable = array();
     $intPrefixLength = strlen($strPrefix);
     foreach ($arrTemplates as $k => $v) {
         if (substr($k, 0, $intPrefixLength) === $strPrefix) {
             $arrComparable[$k] = array('version' => $k, 'info' => $k . '.' . $strExtension);
         }
     }
     /** @var \BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_diff');
     // Template variables
     $objTemplate->staticTo = $strCurrentPath;
     $objTemplate->versions = $arrComparable;
     $objTemplate->from = $strCompareName;
     $objTemplate->showLabel = specialchars($GLOBALS['TL_LANG']['MSC']['showDifferences']);
     $objTemplate->content = $strBuffer;
     $objTemplate->theme = \Backend::getTheme();
     $objTemplate->base = \Environment::get('base');
     $objTemplate->language = $GLOBALS['TL_LANGUAGE'];
     $objTemplate->title = specialchars($GLOBALS['TL_LANG']['MSC']['showDifferences']);
     $objTemplate->charset = \Config::get('characterSet');
     \Config::set('debugMode', false);
     $objTemplate->output();
     exit;
 }
开发者ID:StephenGWills,项目名称:sample-contao-app,代码行数:77,代码来源:tl_templates.php

示例9: run

 /**
  * Run the controller and parse the template
  */
 public function run()
 {
     /** @var \BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_picker');
     $objTemplate->main = '';
     // Ajax request
     if ($_POST && \Environment::get('isAjaxRequest')) {
         $this->objAjax = new \Ajax(\Input::post('action'));
         $this->objAjax->executePreActions();
     }
     $strTable = \Input::get('table');
     $strField = \Input::get('field');
     // Define the current ID
     define('CURRENT_ID', \Input::get('table') ? $this->Session->get('CURRENT_ID') : \Input::get('id'));
     $this->loadDataContainer($strTable);
     $strDriver = 'DC_' . $GLOBALS['TL_DCA'][$strTable]['config']['dataContainer'];
     $objDca = new $strDriver($strTable);
     $objDca->field = $strField;
     // Set the active record
     if ($this->Database->tableExists($strTable)) {
         /** @var \Model $strModel $strModel */
         $strModel = \Model::getClassFromTable($strTable);
         if (class_exists($strModel)) {
             $objModel = $strModel::findByPk(\Input::get('id'));
             if ($objModel !== null) {
                 $objDca->activeRecord = $objModel;
             }
         }
     }
     // AJAX request
     if ($_POST && \Environment::get('isAjaxRequest')) {
         $this->objAjax->executePostActions($objDca);
     }
     $this->Session->set('filePickerRef', \Environment::get('request'));
     $arrValues = array_filter(explode(',', \Input::get('value')));
     // Call the load_callback
     if (is_array($GLOBALS['TL_DCA'][$strTable]['fields'][$strField]['load_callback'])) {
         foreach ($GLOBALS['TL_DCA'][$strTable]['fields'][$strField]['load_callback'] as $callback) {
             if (is_array($callback)) {
                 $this->import($callback[0]);
                 $arrValues = $this->{$callback[0]}->{$callback[1]}($arrValues, $objDca);
             } elseif (is_callable($callback)) {
                 $arrValues = $callback($arrValues, $objDca);
             }
         }
     }
     /** @var \PageSelector $strClass */
     $strClass = $GLOBALS['BE_FFL']['pageSelector'];
     /** @var \PageSelector $objPageTree */
     $objPageTree = new $strClass($strClass::getAttributesFromDca($GLOBALS['TL_DCA'][$strTable]['fields'][$strField], $strField, $arrValues, $strField, $strTable, $objDca));
     $objTemplate->main = $objPageTree->generate();
     $objTemplate->theme = \Backend::getTheme();
     $objTemplate->base = \Environment::get('base');
     $objTemplate->language = $GLOBALS['TL_LANGUAGE'];
     $objTemplate->title = specialchars($GLOBALS['TL_LANG']['MSC']['pagepicker']);
     $objTemplate->charset = \Config::get('characterSet');
     $objTemplate->addSearch = true;
     $objTemplate->search = $GLOBALS['TL_LANG']['MSC']['search'];
     $objTemplate->action = ampersand(\Environment::get('request'));
     $objTemplate->value = $this->Session->get('page_selector_search');
     $objTemplate->breadcrumb = $GLOBALS['TL_DCA']['tl_page']['list']['sorting']['breadcrumb'];
     if ($this->User->hasAccess('page', 'modules')) {
         $objTemplate->manager = $GLOBALS['TL_LANG']['MSC']['pageManager'];
         $objTemplate->managerHref = 'contao/main.php?do=page&amp;popup=1';
     }
     if (\Input::get('switch') && $this->User->hasAccess('files', 'modules')) {
         $objTemplate->switch = $GLOBALS['TL_LANG']['MSC']['filePicker'];
         $objTemplate->switchHref = str_replace('contao/page.php', 'contao/file.php', ampersand(\Environment::get('request')));
     }
     \Config::set('debugMode', false);
     $objTemplate->output();
 }
开发者ID:eknoes,项目名称:core,代码行数:75,代码来源:BackendPage.php

示例10: run

 /**
  * Run the controller and parse the template
  */
 public function run()
 {
     if ($this->strFile == '') {
         die('No file given');
     }
     // Make sure there are no attempts to hack the file system
     if (preg_match('@^\\.+@i', $this->strFile) || preg_match('@\\.+/@i', $this->strFile) || preg_match('@(://)+@i', $this->strFile)) {
         die('Invalid file name');
     }
     // Limit preview to the files directory
     if (!preg_match('@^' . preg_quote(\Config::get('uploadPath'), '@') . '@i', $this->strFile)) {
         die('Invalid path');
     }
     // Check whether the file exists
     if (!file_exists(TL_ROOT . '/' . $this->strFile)) {
         die('File not found');
     }
     // Check whether the file is mounted (thanks to Marko Cupic)
     if (!$this->User->hasAccess($this->strFile, 'filemounts')) {
         die('Permission denied');
     }
     // Open the download dialogue
     if (\Input::get('download')) {
         $objFile = new \File($this->strFile, true);
         $objFile->sendToBrowser();
     }
     /** @var \BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_popup');
     // Add the resource (see #6880)
     if (($objModel = \FilesModel::findByPath($this->strFile)) === null) {
         if (\Dbafs::shouldBeSynchronized($this->strFile)) {
             $objModel = \Dbafs::addResource($this->strFile);
         }
     }
     if ($objModel !== null) {
         $objTemplate->uuid = \StringUtil::binToUuid($objModel->uuid);
         // see #5211
     }
     // Add the file info
     if (is_dir(TL_ROOT . '/' . $this->strFile)) {
         $objFile = new \Folder($this->strFile, true);
         $objTemplate->filesize = $this->getReadableSize($objFile->size) . ' (' . number_format($objFile->size, 0, $GLOBALS['TL_LANG']['MSC']['decimalSeparator'], $GLOBALS['TL_LANG']['MSC']['thousandsSeparator']) . ' Byte)';
     } else {
         $objFile = new \File($this->strFile, true);
         // Image
         if ($objFile->isImage) {
             $objTemplate->isImage = true;
             $objTemplate->width = $objFile->width;
             $objTemplate->height = $objFile->height;
             $objTemplate->src = $this->urlEncode($this->strFile);
         }
         $objTemplate->href = ampersand(\Environment::get('request'), true) . '&amp;download=1';
         $objTemplate->filesize = $this->getReadableSize($objFile->filesize) . ' (' . number_format($objFile->filesize, 0, $GLOBALS['TL_LANG']['MSC']['decimalSeparator'], $GLOBALS['TL_LANG']['MSC']['thousandsSeparator']) . ' Byte)';
     }
     $objTemplate->icon = $objFile->icon;
     $objTemplate->mime = $objFile->mime;
     $objTemplate->ctime = \Date::parse(\Config::get('datimFormat'), $objFile->ctime);
     $objTemplate->mtime = \Date::parse(\Config::get('datimFormat'), $objFile->mtime);
     $objTemplate->atime = \Date::parse(\Config::get('datimFormat'), $objFile->atime);
     $objTemplate->path = specialchars($this->strFile);
     $objTemplate->theme = \Backend::getTheme();
     $objTemplate->base = \Environment::get('base');
     $objTemplate->language = $GLOBALS['TL_LANGUAGE'];
     $objTemplate->title = specialchars($this->strFile);
     $objTemplate->charset = \Config::get('characterSet');
     $objTemplate->headline = basename(utf8_convert_encoding($this->strFile, \Config::get('characterSet')));
     $objTemplate->label_uuid = $GLOBALS['TL_LANG']['MSC']['fileUuid'];
     $objTemplate->label_imagesize = $GLOBALS['TL_LANG']['MSC']['fileImageSize'];
     $objTemplate->label_filesize = $GLOBALS['TL_LANG']['MSC']['fileSize'];
     $objTemplate->label_ctime = $GLOBALS['TL_LANG']['MSC']['fileCreated'];
     $objTemplate->label_mtime = $GLOBALS['TL_LANG']['MSC']['fileModified'];
     $objTemplate->label_atime = $GLOBALS['TL_LANG']['MSC']['fileAccessed'];
     $objTemplate->label_path = $GLOBALS['TL_LANG']['MSC']['filePath'];
     $objTemplate->download = specialchars($GLOBALS['TL_LANG']['MSC']['fileDownload']);
     \Config::set('debugMode', false);
     $objTemplate->output();
 }
开发者ID:StephenGWills,项目名称:sample-contao-app,代码行数:80,代码来源:BackendPopup.php

示例11: compare


//.........这里部分代码省略.........
             $intTo = \Input::post('to');
             $to = deserialize($arrVersions[\Input::post('to')]['data']);
         } elseif (\Input::get('to') && isset($arrVersions[\Input::get('to')])) {
             $intTo = \Input::get('to');
             $to = deserialize($arrVersions[\Input::get('to')]['data']);
         } else {
             $intTo = $intIndex;
             $to = deserialize($arrVersions[$intTo]['data']);
         }
         // From
         if (\Input::post('from') && isset($arrVersions[\Input::post('from')])) {
             $intFrom = \Input::post('from');
             $from = deserialize($arrVersions[\Input::post('from')]['data']);
         } elseif (\Input::get('from') && isset($arrVersions[\Input::get('from')])) {
             $intFrom = \Input::get('from');
             $from = deserialize($arrVersions[\Input::get('from')]['data']);
         } elseif ($intIndex > 1) {
             $intFrom = $intIndex - 1;
             $from = deserialize($arrVersions[$intFrom]['data']);
         }
         // Only continue if both version numbers are set
         if ($intTo > 0 && $intFrom > 0) {
             \System::loadLanguageFile($this->strTable);
             $this->loadDataContainer($this->strTable);
             // Get the order fields
             $objDcaExtractor = \DcaExtractor::getInstance($this->strTable);
             $arrOrder = $objDcaExtractor->getOrderFields();
             // Find the changed fields and highlight the changes
             foreach ($to as $k => $v) {
                 if ($from[$k] != $to[$k]) {
                     if ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['inputType'] == 'password' || $GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['eval']['doNotShow'] || $GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['eval']['hideInput']) {
                         continue;
                     }
                     $blnIsBinary = $GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['inputType'] == 'fileTree' || in_array($k, $arrOrder);
                     // Decrypt the values
                     if ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['eval']['encrypt']) {
                         $to[$k] = \Encryption::decrypt($to[$k]);
                         $from[$k] = \Encryption::decrypt($from[$k]);
                     }
                     // Convert serialized arrays into strings
                     if (is_array($tmp = deserialize($to[$k])) && !is_array($to[$k])) {
                         $to[$k] = $this->implodeRecursive($tmp, $blnIsBinary);
                     }
                     if (is_array($tmp = deserialize($from[$k])) && !is_array($from[$k])) {
                         $from[$k] = $this->implodeRecursive($tmp, $blnIsBinary);
                     }
                     unset($tmp);
                     // Convert binary UUIDs to their hex equivalents (see #6365)
                     if ($blnIsBinary && \Validator::isBinaryUuid($to[$k])) {
                         $to[$k] = \String::binToUuid($to[$k]);
                     }
                     if ($blnIsBinary && \Validator::isBinaryUuid($from[$k])) {
                         $to[$k] = \String::binToUuid($from[$k]);
                     }
                     // Convert date fields
                     if ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['eval']['rgxp'] == 'date') {
                         $to[$k] = \Date::parse(\Config::get('dateFormat'), $to[$k] ?: '');
                         $from[$k] = \Date::parse(\Config::get('dateFormat'), $from[$k] ?: '');
                     } elseif ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['eval']['rgxp'] == 'time') {
                         $to[$k] = \Date::parse(\Config::get('timeFormat'), $to[$k] ?: '');
                         $from[$k] = \Date::parse(\Config::get('timeFormat'), $from[$k] ?: '');
                     } elseif ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['eval']['rgxp'] == 'datim' || $k == 'tstamp') {
                         $to[$k] = \Date::parse(\Config::get('datimFormat'), $to[$k] ?: '');
                         $from[$k] = \Date::parse(\Config::get('datimFormat'), $from[$k] ?: '');
                     }
                     // Convert strings into arrays
                     if (!is_array($to[$k])) {
                         $to[$k] = explode("\n", $to[$k]);
                     }
                     if (!is_array($from[$k])) {
                         $from[$k] = explode("\n", $from[$k]);
                     }
                     $objDiff = new \Diff($from[$k], $to[$k]);
                     $strBuffer .= $objDiff->Render(new DiffRenderer(array('field' => $GLOBALS['TL_DCA'][$this->strTable]['fields'][$k]['label'][0] ?: (isset($GLOBALS['TL_LANG']['MSC'][$k]) ? is_array($GLOBALS['TL_LANG']['MSC'][$k]) ? $GLOBALS['TL_LANG']['MSC'][$k][0] : $GLOBALS['TL_LANG']['MSC'][$k] : $k))));
                 }
             }
         }
     }
     // Identical versions
     if ($strBuffer == '') {
         $strBuffer = '<p>' . $GLOBALS['TL_LANG']['MSC']['identicalVersions'] . '</p>';
     }
     /** @var \BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_diff');
     // Template variables
     $objTemplate->content = $strBuffer;
     $objTemplate->versions = $arrVersions;
     $objTemplate->to = $intTo;
     $objTemplate->from = $intFrom;
     $objTemplate->showLabel = specialchars($GLOBALS['TL_LANG']['MSC']['showDifferences']);
     $objTemplate->theme = \Backend::getTheme();
     $objTemplate->base = \Environment::get('base');
     $objTemplate->language = $GLOBALS['TL_LANGUAGE'];
     $objTemplate->title = specialchars($GLOBALS['TL_LANG']['MSC']['showDifferences']);
     $objTemplate->charset = \Config::get('characterSet');
     $objTemplate->action = ampersand(\Environment::get('request'));
     \Config::set('debugMode', false);
     $objTemplate->output();
     exit;
 }
开发者ID:juergen83,项目名称:contao,代码行数:101,代码来源:Versions.php

示例12: output

 /**
  * Output the template file
  */
 protected function output()
 {
     // Default headline
     if ($this->Template->headline == '') {
         $this->Template->headline = \Config::get('websiteTitle');
     }
     // Default title
     if ($this->Template->title == '') {
         $this->Template->title = $this->Template->headline;
     }
     // File picker reference
     if (\Input::get('popup') && \Input::get('act') != 'show' && (\Input::get('do') == 'page' || \Input::get('do') == 'files') && $this->Session->get('filePickerRef')) {
         $this->Template->managerHref = ampersand($this->Session->get('filePickerRef'));
         $this->Template->manager = strpos($this->Session->get('filePickerRef'), 'contao/page.php') !== false ? $GLOBALS['TL_LANG']['MSC']['pagePickerHome'] : $GLOBALS['TL_LANG']['MSC']['filePickerHome'];
     }
     $this->Template->theme = \Backend::getTheme();
     $this->Template->base = \Environment::get('base');
     $this->Template->language = $GLOBALS['TL_LANGUAGE'];
     $this->Template->title = specialchars($this->Template->title);
     $this->Template->charset = \Config::get('characterSet');
     $this->Template->account = $GLOBALS['TL_LANG']['MOD']['login'][1];
     $this->Template->preview = $GLOBALS['TL_LANG']['MSC']['fePreview'];
     $this->Template->previewTitle = specialchars($GLOBALS['TL_LANG']['MSC']['fePreviewTitle']);
     $this->Template->pageOffset = \Input::cookie('BE_PAGE_OFFSET');
     $this->Template->logout = $GLOBALS['TL_LANG']['MSC']['logoutBT'];
     $this->Template->logoutTitle = specialchars($GLOBALS['TL_LANG']['MSC']['logoutBTTitle']);
     $this->Template->backendModules = $GLOBALS['TL_LANG']['MSC']['backendModules'];
     $this->Template->username = $GLOBALS['TL_LANG']['MSC']['user'] . ' ' . $GLOBALS['TL_USERNAME'];
     $this->Template->skipNavigation = specialchars($GLOBALS['TL_LANG']['MSC']['skipNavigation']);
     $this->Template->request = ampersand(\Environment::get('request'));
     $this->Template->top = $GLOBALS['TL_LANG']['MSC']['backToTop'];
     $this->Template->modules = $this->User->navigation();
     $this->Template->home = $GLOBALS['TL_LANG']['MSC']['home'];
     $this->Template->homeTitle = $GLOBALS['TL_LANG']['MSC']['homeTitle'];
     $this->Template->backToTop = specialchars($GLOBALS['TL_LANG']['MSC']['backToTopTitle']);
     $this->Template->expandNode = $GLOBALS['TL_LANG']['MSC']['expandNode'];
     $this->Template->collapseNode = $GLOBALS['TL_LANG']['MSC']['collapseNode'];
     $this->Template->loadingData = $GLOBALS['TL_LANG']['MSC']['loadingData'];
     $this->Template->loadFonts = \Config::get('loadGoogleFonts');
     $this->Template->isAdmin = $this->User->isAdmin;
     $this->Template->isCoreOnlyMode = \Config::get('coreOnlyMode');
     $this->Template->coreOnlyMode = $GLOBALS['TL_LANG']['MSC']['coreOnlyMode'];
     $this->Template->coreOnlyOff = specialchars($GLOBALS['TL_LANG']['MSC']['coreOnlyOff']);
     $this->Template->coreOnlyHref = $this->addToUrl('smo=1');
     $this->Template->isMaintenanceMode = \Config::get('maintenanceMode');
     $this->Template->maintenanceMode = $GLOBALS['TL_LANG']['MSC']['maintenanceMode'];
     $this->Template->maintenanceOff = specialchars($GLOBALS['TL_LANG']['MSC']['maintenanceOff']);
     $this->Template->maintenanceHref = $this->addToUrl('mmo=1');
     $this->Template->buildCacheLink = $GLOBALS['TL_LANG']['MSC']['buildCacheLink'];
     $this->Template->buildCacheText = $GLOBALS['TL_LANG']['MSC']['buildCacheText'];
     $this->Template->buildCacheHref = $this->addToUrl('bic=1');
     $this->Template->isPopup = \Input::get('popup');
     // Hide the cache message in the repository manager (see #5966)
     if (!\Config::get('bypassCache') && $this->User->isAdmin) {
         $this->Template->needsCacheBuild = (\Input::get('do') != 'repository_manager' || !isset($_GET['install']) && !isset($_GET['uninstall']) && !isset($_GET['update'])) && !is_dir(TL_ROOT . '/system/cache/dca');
     }
     // Front end preview links
     if (defined('CURRENT_ID') && CURRENT_ID != '') {
         // Pages
         if (\Input::get('do') == 'page') {
             $this->Template->frontendFile = '?page=' . CURRENT_ID;
         } elseif (\Input::get('do') == 'article') {
             if (($objArticle = \ArticleModel::findByPk(CURRENT_ID)) !== null) {
                 $this->Template->frontendFile = '?page=' . $objArticle->pid;
             }
         }
     }
     $this->Template->output();
 }
开发者ID:bytehead,项目名称:contao-core,代码行数:72,代码来源:BackendMain.php

示例13: run

 /**
  * Run the controller and parse the template
  */
 public function run()
 {
     $table = \Input::get('table');
     $field = \Input::get('field');
     \System::loadLanguageFile($table);
     $this->loadDataContainer($table);
     /** @var \BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_help');
     $objTemplate->rows = array();
     $objTemplate->explanation = '';
     $arrData = $GLOBALS['TL_DCA'][$table]['fields'][$field];
     // Back end modules
     if ($table == 'tl_user_group' && $field == 'modules') {
         $rows = array();
         foreach (array_keys($GLOBALS['BE_MOD']) as $group) {
             $rows[] = array('headspan', $arrData['reference'][$group]);
             foreach ($GLOBALS['BE_MOD'][$group] as $module => $class) {
                 $rows[] = $arrData['reference'][$module];
             }
         }
         $objTemplate->rows = $rows;
     } elseif ($table == 'tl_module' && $field == 'type') {
         $rows = array();
         foreach (array_keys($GLOBALS['FE_MOD']) as $group) {
             $rows[] = array('headspan', $arrData['reference'][$group]);
             foreach ($GLOBALS['FE_MOD'][$group] as $module => $class) {
                 $rows[] = $arrData['reference'][$module];
             }
         }
         $objTemplate->rows = $rows;
     } elseif ($table == 'tl_content' && $field == 'type') {
         $rows = array();
         foreach (array_keys($GLOBALS['TL_CTE']) as $group) {
             $rows[] = array('headspan', $arrData['reference'][$group]);
             foreach ($GLOBALS['TL_CTE'][$group] as $element => $class) {
                 $rows[] = $arrData['reference'][$element];
             }
         }
         $objTemplate->rows = $rows;
     } elseif (!empty($arrData['reference'])) {
         $rows = array();
         if (is_array($arrData['options'])) {
             $options = $arrData['options'];
         } elseif (is_array($arrData['options_callback'])) {
             $this->import($arrData['options_callback'][0]);
             $options = $this->{$arrData['options_callback'][0]}->{$arrData['options_callback'][1]}(new \DC_Table($table));
         } else {
             $options = array_keys($arrData['reference']);
         }
         // Unset the predefined image sizes
         unset($options['image_sizes']);
         foreach ($options as $key => $option) {
             if (is_array($option)) {
                 if (is_array($arrData['reference'][$key])) {
                     $rows[] = array('headspan', $arrData['reference'][$key][0]);
                 } else {
                     $rows[] = array('headspan', $arrData['reference'][$key]);
                 }
                 foreach ($option as $opt) {
                     $rows[] = $arrData['reference'][$opt];
                 }
             } else {
                 if (!is_array($arrData['reference'][$option])) {
                     $rows[] = array('headspan', $arrData['reference'][$option]);
                 } else {
                     $rows[] = $arrData['reference'][$option];
                 }
             }
         }
         $objTemplate->rows = $rows;
     }
     // Add an explanation
     if (isset($arrData['explanation'])) {
         \System::loadLanguageFile('explain');
         $key = $arrData['explanation'];
         if (!is_array($GLOBALS['TL_LANG']['XPL'][$key])) {
             $objTemplate->explanation = trim($GLOBALS['TL_LANG']['XPL'][$key]);
         } else {
             $objTemplate->rows = $GLOBALS['TL_LANG']['XPL'][$key];
         }
     }
     $objTemplate->theme = \Backend::getTheme();
     $objTemplate->base = \Environment::get('base');
     $objTemplate->language = $GLOBALS['TL_LANGUAGE'];
     $objTemplate->title = specialchars($GLOBALS['TL_LANG']['MSC']['helpWizardTitle']);
     $objTemplate->charset = \Config::get('characterSet');
     $objTemplate->headline = $arrData['label'][0] ?: $field;
     $objTemplate->helpWizard = $GLOBALS['TL_LANG']['MSC']['helpWizard'];
     \Config::set('debugMode', false);
     $objTemplate->output();
 }
开发者ID:StephenGWills,项目名称:sample-contao-app,代码行数:94,代码来源:BackendHelp.php

示例14: run

 /**
  * Run the controller
  */
 public function run()
 {
     // Redirect to the back end home page
     if (\Input::post('FORM_SUBMIT') == 'invalid_token_url') {
         list($strUrl) = explode('?', $this->Session->get('INVALID_TOKEN_URL'));
         $this->redirect($strUrl);
     }
     /** @var \BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_confirm');
     // Prepare the URL
     $url = preg_replace('/(\\?|&)rt=[^&]*/', '', $this->Session->get('INVALID_TOKEN_URL'));
     $objTemplate->href = ampersand($url . (strpos($url, '?') !== false ? '&rt=' : '?rt=') . REQUEST_TOKEN);
     $vars = array();
     list(, $request) = explode('?', $url, 2);
     // Extract the arguments
     foreach (explode('&', $request) as $arg) {
         list($key, $value) = explode('=', $arg, 2);
         $vars[$key] = $value;
     }
     $arrInfo = array();
     // Provide more information about the link (see #4007)
     foreach ($vars as $k => $v) {
         switch ($k) {
             default:
                 $arrInfo[$k] = $v;
                 break;
             case 'do':
                 $arrInfo['do'] = $GLOBALS['TL_LANG']['MOD'][$v][0];
                 break;
             case 'id':
                 $arrInfo['id'] = 'ID ' . $v;
                 break;
         }
     }
     // Use the first table if none is given
     if (!isset($arrInfo['table'])) {
         foreach ($GLOBALS['BE_MOD'] as $category => $modules) {
             if (isset($GLOBALS['BE_MOD'][$category][$vars['do']])) {
                 $arrInfo['table'] = $GLOBALS['BE_MOD'][$category][$vars['do']]['tables'][0];
                 break;
             }
         }
     }
     \System::loadLanguageFile($arrInfo['table']);
     // Override the action label
     if (isset($arrInfo['clipboard'])) {
         $arrInfo['act'] = $GLOBALS['TL_LANG']['MSC']['clearClipboard'];
     } elseif (isset($arrInfo['mode']) && !isset($arrInfo['act'])) {
         if ($arrInfo['mode'] == 'create') {
             $arrInfo['act'] = $GLOBALS['TL_LANG'][$arrInfo['table']]['new'][0];
         } elseif ($arrInfo['mode'] == 'cut' || $arrInfo['mode'] == 'copy') {
             $arrInfo['act'] = $GLOBALS['TL_LANG'][$arrInfo['table']][$arrInfo['mode']][0];
         }
     } else {
         $arrInfo['act'] = $GLOBALS['TL_LANG'][$arrInfo['table']][$arrInfo['act']][0];
     }
     unset($arrInfo['pid']);
     unset($arrInfo['clipboard']);
     unset($arrInfo['ref']);
     unset($arrInfo['mode']);
     // Template variables
     $objTemplate->confirm = true;
     $objTemplate->link = specialchars($url);
     $objTemplate->info = $arrInfo;
     $objTemplate->labels = $GLOBALS['TL_LANG']['CONFIRM'];
     $objTemplate->explain = $GLOBALS['TL_LANG']['ERR']['invalidTokenUrl'];
     $objTemplate->cancel = $GLOBALS['TL_LANG']['MSC']['cancelBT'];
     $objTemplate->continue = $GLOBALS['TL_LANG']['MSC']['continue'];
     $objTemplate->theme = \Backend::getTheme();
     $objTemplate->base = \Environment::get('base');
     $objTemplate->language = $GLOBALS['TL_LANGUAGE'];
     $objTemplate->title = specialchars($GLOBALS['TL_LANG']['MSC']['invalidTokenUrl']);
     $objTemplate->charset = \Config::get('characterSet');
     $objTemplate->output();
 }
开发者ID:bytehead,项目名称:contao-core,代码行数:78,代码来源:BackendConfirm.php

示例15: run

 /**
  * Run the controller and parse the template.
  *
  * @return void
  */
 public function run()
 {
     $template = new \BackendTemplate('be_picker');
     $template->main = '';
     // Ajax request.
     // @codingStandardsIgnoreStart - We need POST access here.
     if ($_POST && \Environment::get('isAjaxRequest')) {
         $ajax = new \Ajax(\Input::post('action'));
         $ajax->executePreActions();
     }
     $strTable = \Input::get('table');
     $strField = \Input::get('field');
     // Define the current ID.
     define('CURRENT_ID', $strTable ? \Session::getInstance()->get('CURRENT_ID') : \Input::get('id'));
     $dispatcher = $GLOBALS['container']['event-dispatcher'];
     /** @var \Symfony\Component\EventDispatcher\EventDispatcher $dispatcher */
     $propagator = new EventPropagator($dispatcher);
     $translator = new TranslatorChain();
     $translator->add(new LangArrayTranslator($dispatcher));
     $factory = new DcGeneralFactory();
     $this->itemContainer = $factory->setContainerName($strTable)->setTranslator($translator)->setEventPropagator($propagator)->createDcGeneral();
     $information = (array) $GLOBALS['TL_DCA'][$strTable]['fields'][$strField];
     // Merge with the information from the data container.
     $property = $this->itemContainer->getEnvironment()->getDataDefinition()->getPropertiesDefinition()->getProperty($strField);
     $extra = $property->getExtra();
     $information['eval']['sourceName'] = $extra['sourceName'];
     $information['eval']['fieldType'] = $extra['fieldType'];
     /** @var \ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\TreePicker $objTreeSelector */
     $objTreeSelector = new $GLOBALS['BE_FFL']['DcGeneralTreePicker'](\Widget::getAttributesFromDca($information, $strField, array_filter(explode(',', \Input::get('value'))), $strField, $strTable, new DcCompat($this->itemContainer->getEnvironment())));
     // AJAX request.
     if (isset($ajax)) {
         $objTreeSelector->generateAjax();
         $ajax->executePostActions(new DcCompat($this->itemContainer->getEnvironment()));
     }
     $template->main = $objTreeSelector->generatePopup();
     $template->theme = \Backend::getTheme();
     $template->base = \Environment::get('base');
     $template->language = $GLOBALS['TL_LANGUAGE'];
     $template->title = specialchars($GLOBALS['TL_LANG']['MSC']['treepicker']);
     $template->charset = $GLOBALS['TL_CONFIG']['characterSet'];
     $template->addSearch = $objTreeSelector->searchField;
     $template->search = $GLOBALS['TL_LANG']['MSC']['search'];
     $template->action = ampersand(\Environment::get('request'));
     $template->value = \Session::getInstance()->get($objTreeSelector->getSearchSessionKey());
     $template->manager = $GLOBALS['TL_LANG']['MSC']['treepickerManager'];
     $template->breadcrumb = $GLOBALS['TL_DCA'][$objTreeSelector->foreignTable]['list']['sorting']['breadcrumb'];
     $template->managerHref = '';
     // Add the manager link.
     if ($objTreeSelector->managerHref) {
         $template->managerHref = 'contao/main.php?' . ampersand($objTreeSelector->managerHref) . '&amp;popup=1';
     }
     // Prevent debug output at all cost.
     $GLOBALS['TL_CONFIG']['debugMode'] = false;
     $template->output();
 }
开发者ID:amenk,项目名称:dc-general,代码行数:60,代码来源:generaltree.php


注:本文中的BackendTemplate::output方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。