本文整理汇总了PHP中Contao\System类的典型用法代码示例。如果您正苦于以下问题:PHP System类的具体用法?PHP System怎么用?PHP System使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了System类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Initialize the controller
*
* 1. Import the user
* 2. Call the parent constructor
* 3. Authenticate the user
* 4. Load the language files
* DO NOT CHANGE THIS ORDER!
*/
public function __construct()
{
$this->import('BackendUser', 'User');
parent::__construct();
$this->User->authenticate();
\System::loadLanguageFile('default');
}
开发者ID:contao,项目名称:core-bundle,代码行数:16,代码来源:BackendAlerts.php
示例2: run
/**
* Run the controller and parse the template
*
* @return Response
*/
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);
$objTemplate->switchHref = \System::getContainer()->get('router')->generate('contao_backend_switch');
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 = \System::getContainer()->get('router')->generate('contao_root', [], UrlGeneratorInterface::ABSOLUTE_URL);
}
// Switch to a particular member (see #6546)
if (\Input::get('user') && $this->User->isAdmin) {
$objUser = \MemberModel::findByUsername(\Input::get('user'));
if ($objUser !== null) {
$strHash = $this->getSessionHash('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', \System::getContainer()->get('session')->getId(), \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');
}
}
return $objTemplate->getResponse();
}
开发者ID:jamesdevine,项目名称:core-bundle,代码行数:38,代码来源:BackendPreview.php
示例3: runTests
/**
* Runs the actual tests.
*/
protected function runTests()
{
// Environment::get('ip') needs the request stack
System::setContainer($this->mockContainerWithContaoScopes());
$agent = Environment::get('agent');
$this->assertEquals('mac', $agent->os);
$this->assertEquals('mac chrome webkit ch33', $agent->class);
$this->assertEquals('chrome', $agent->browser);
$this->assertEquals('ch', $agent->shorty);
$this->assertEquals(33, $agent->version);
$this->assertEquals('webkit', $agent->engine);
$this->assertEquals([33, 0, 1750, 149], $agent->versions);
$this->assertFalse($agent->mobile);
$this->assertEquals('HTTP/1.1', Environment::get('serverProtocol'));
$this->assertEquals($this->getRootDir() . '/core/index.php', Environment::get('scriptFilename'));
$this->assertEquals('/core/index.php', Environment::get('scriptName'));
$this->assertEquals($this->getRootDir(), Environment::get('documentRoot'));
$this->assertEquals('/core/en/academy.html?do=test', Environment::get('requestUri'));
$this->assertEquals(['de-DE', 'de', 'en-GB', 'en'], Environment::get('httpAcceptLanguage'));
$this->assertEquals(['gzip', 'deflate', 'sdch'], Environment::get('httpAcceptEncoding'));
$this->assertEquals('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36', Environment::get('httpUserAgent'));
$this->assertEquals('localhost', Environment::get('httpHost'));
$this->assertEmpty(Environment::get('httpXForwardedHost'));
$this->assertFalse(Environment::get('ssl'));
$this->assertEquals('http://localhost', Environment::get('url'));
$this->assertEquals('http://localhost/core/en/academy.html?do=test', Environment::get('uri'));
$this->assertEquals('123.456.789.0', Environment::get('ip'));
$this->assertEquals('127.0.0.1', Environment::get('server'));
$this->assertEquals('index.php', Environment::get('script'));
$this->assertEquals('en/academy.html?do=test', Environment::get('request'));
$this->assertEquals('en/academy.html?do=test', Environment::get('indexFreeRequest'));
$this->assertEquals('http://localhost' . Environment::get('path') . '/', Environment::get('base'));
$this->assertFalse(Environment::get('isAjaxRequest'));
}
开发者ID:qzminski,项目名称:contao-core-bundle,代码行数:37,代码来源:EnvironmentTest.php
示例4: processPostUpload
/**
* Compress images
*
* @param boolean $arrFiles File array
*/
public function processPostUpload($arrFiles)
{
if (is_array($arrFiles) && $GLOBALS['TL_CONFIG']['tinypng_api_key'] != '') {
$strUrl = 'https://api.tinypng.com/shrink';
$strKey = $GLOBALS['TL_CONFIG']['tinypng_api_key'];
$strAuthorization = 'Basic ' . base64_encode("api:{$strKey}");
foreach ($arrFiles as $file) {
$objFile = FilesModel::findByPath($file);
if (in_array($objFile->extension, array('png', 'jpg', 'jpeg'))) {
$strFile = TL_ROOT . '/' . $file;
$objRequest = new Request();
$objRequest->method = 'post';
$objRequest->data = file_get_contents($strFile);
$objRequest->setHeader('Content-type', 'image/png');
$objRequest->setHeader('Authorization', $strAuthorization);
$objRequest->send($strUrl);
$arrResponse = json_decode($objRequest->response);
if ($objRequest->code == 201) {
file_put_contents($strFile, fopen($arrResponse->output->url, "rb", false));
$objFile->tstamp = time();
$objFile->path = $file;
$objFile->hash = md5_file(TL_ROOT . '/' . $file);
$objFile->save();
System::log('Compression was successful. (File: ' . $file . ')', __METHOD__, TL_FILES);
} else {
System::log('Compression failed. (' . $arrResponse->message . ') (File: ' . $file . ')', __METHOD__, TL_FILES);
}
}
}
}
}
开发者ID:christianbarkowsky,项目名称:contao-tiny-compress-images,代码行数:36,代码来源:TinyCompressImages.php
示例5: getCurrencies
/**
* @return array
*/
public function getCurrencies()
{
$return = array();
$arrAux = array();
\Contao\System::loadLanguageFile('currencies');
$this->loadCurrencies();
if (is_array($this->arrCurrencies)) {
foreach ($this->arrCurrencies as $strKey => $strName) {
$arrAux[$strKey] = isset($GLOBALS['TL_LANG']['CUR'][$strKey]) ? Utf8::toAscii($GLOBALS['TL_LANG']['CUR'][$strKey]) : $strName;
}
}
asort($arrAux);
if (is_array($arrAux)) {
foreach (array_keys($arrAux) as $strKey) {
$return[$strKey] = isset($GLOBALS['TL_LANG']['CUR'][$strKey]) ? $GLOBALS['TL_LANG']['CUR'][$strKey] : $this->arrCurrencies[$strKey];
}
}
// HOOK: add custom logic
if (isset($GLOBALS['TL_HOOKS']['getCurrencies']) && is_array($GLOBALS['TL_HOOKS']['getCurrencies'])) {
foreach ($GLOBALS['TL_HOOKS']['getCurrencies'] as $callback) {
$return = static::importStatic($callback[0])->{$callback}[1]($return, $this->arrCurrencies);
}
}
return $return;
}
开发者ID:Craffft,项目名称:currencies-bundle,代码行数:28,代码来源:Currencies.php
示例6: run
/**
* Generate the module
*
* @return string
*/
public function run()
{
$arrJobs = array();
/** @var BackendTemplate|object $objTemplate */
$objTemplate = new \BackendTemplate('be_purge_data');
$objTemplate->isActive = $this->isActive();
$objTemplate->message = \Message::generateUnwrapped();
// Run the jobs
if (\Input::post('FORM_SUBMIT') == 'tl_purge') {
$purge = \Input::post('purge');
if (!empty($purge) && is_array($purge)) {
foreach ($purge as $group => $jobs) {
foreach ($jobs as $job) {
list($class, $method) = $GLOBALS['TL_PURGE'][$group][$job]['callback'];
$this->import($class);
$this->{$class}->{$method}();
}
}
}
\Message::addConfirmation($GLOBALS['TL_LANG']['tl_maintenance']['cacheCleared']);
$this->reload();
}
// Tables
foreach ($GLOBALS['TL_PURGE']['tables'] as $key => $config) {
$arrJobs[$key] = array('id' => 'purge_' . $key, 'title' => $GLOBALS['TL_LANG']['tl_maintenance_jobs'][$key][0], 'description' => $GLOBALS['TL_LANG']['tl_maintenance_jobs'][$key][1], 'group' => 'tables', 'affected' => '');
// Get the current table size
foreach ($config['affected'] as $table) {
$objCount = $this->Database->execute("SELECT COUNT(*) AS count FROM " . $table);
$arrJobs[$key]['affected'] .= '<br>' . $table . ': <span>' . sprintf($GLOBALS['TL_LANG']['MSC']['entries'], $objCount->count) . ', ' . $this->getReadableSize($this->Database->getSizeOf($table), 0) . '</span>';
}
}
$strCachePath = str_replace(TL_ROOT . DIRECTORY_SEPARATOR, '', \System::getContainer()->getParameter('kernel.cache_dir'));
// Folders
foreach ($GLOBALS['TL_PURGE']['folders'] as $key => $config) {
$arrJobs[$key] = array('id' => 'purge_' . $key, 'title' => $GLOBALS['TL_LANG']['tl_maintenance_jobs'][$key][0], 'description' => $GLOBALS['TL_LANG']['tl_maintenance_jobs'][$key][1], 'group' => 'folders', 'affected' => '');
// Get the current folder size
foreach ($config['affected'] as $folder) {
$total = 0;
$folder = sprintf($folder, $strCachePath);
// Only check existing folders
if (is_dir(TL_ROOT . '/' . $folder)) {
$objFiles = Finder::create()->in(TL_ROOT . '/' . $folder)->files();
$total = iterator_count($objFiles);
}
$arrJobs[$key]['affected'] .= '<br>' . $folder . ': <span>' . sprintf($GLOBALS['TL_LANG']['MSC']['files'], $total) . '</span>';
}
}
// Custom
foreach ($GLOBALS['TL_PURGE']['custom'] as $key => $job) {
$arrJobs[$key] = array('id' => 'purge_' . $key, 'title' => $GLOBALS['TL_LANG']['tl_maintenance_jobs'][$key][0], 'description' => $GLOBALS['TL_LANG']['tl_maintenance_jobs'][$key][1], 'group' => 'custom');
}
$objTemplate->jobs = $arrJobs;
$objTemplate->action = ampersand(\Environment::get('request'));
$objTemplate->headline = $GLOBALS['TL_LANG']['tl_maintenance']['clearCache'];
$objTemplate->job = $GLOBALS['TL_LANG']['tl_maintenance']['job'];
$objTemplate->description = $GLOBALS['TL_LANG']['tl_maintenance']['description'];
$objTemplate->submit = \StringUtil::specialchars($GLOBALS['TL_LANG']['tl_maintenance']['clearCache']);
$objTemplate->help = \Config::get('showHelp') && $GLOBALS['TL_LANG']['tl_maintenance']['cacheTables'][1] != '' ? $GLOBALS['TL_LANG']['tl_maintenance']['cacheTables'][1] : '';
return $objTemplate->parse();
}
开发者ID:contao,项目名称:core-bundle,代码行数:65,代码来源:PurgeData.php
示例7: purgePageCache
/**
* Overwrite for Automator::purgePageCache
* Makes sure the forum layout is regenerated
*/
public function purgePageCache()
{
$automator = new Automator();
$automator->purgePageCache();
System::getContainer()->get('phpbb_bridge.connector')->generateForumLayoutFiles();
$this->log('Purged the phpbb forum cache', __METHOD__, TL_CRON);
}
开发者ID:ctsmedia,项目名称:contao-phpbb-bridge-bundle,代码行数:11,代码来源:ForumMaintenance.php
示例8: run
/**
* Run the controller and parse the login template
*
* @return Response
*/
public function run()
{
/** @var BackendTemplate|object $objTemplate */
$objTemplate = new \BackendTemplate('be_login');
$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 = \StringUtil::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 = \StringUtil::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->default = $GLOBALS['TL_LANG']['MSC']['default'];
$objTemplate->jsDisabled = $GLOBALS['TL_LANG']['MSC']['jsDisabled'];
return $objTemplate->getResponse();
}
开发者ID:contao,项目名称:core-bundle,代码行数:32,代码来源:BackendIndex.php
示例9: getResponse
/**
* Return a response object
*
* The forum Page usually does not get called because the frontend listener
* overrides the url for navigation for example. When called directly the layout parts
* phpBB gets created und pushed to phpbb
*
* @see ContaoFrontendListener
*
* @param \PageModel $objPage
* @param boolean $blnCheckRequest
*
* @return Response
*/
public function getResponse($objPage, $blnCheckRequest = false)
{
$this->prepare($objPage);
// prepare the template contents
$this->Template->main = "%%FORUM%%";
$style = $this->prepareHeadTags($this->Template->stylesheets);
$mooScripts = $this->prepareHeadTags($this->Template->mooScripts);
$framework = $this->prepareHeadTags($this->Template->framework);
$head = $this->prepareHeadTags($this->Template->head);
$this->Template->head = "";
$response = $this->Template->getResponse($blnCheckRequest);
// layout sections
$overall_header = '';
$overall_footer = '';
$sections = $this->generateLayoutSections($response->getContent());
// template vars will be replaced with dynamic content on each request
$overall_header = '{CONTAO_LAYOUT_HEADER}';
$overall_footer = '{CONTAO_LAYOUT_FOOTER}';
// If dynamic generation is set and json format requested we can return and leave (no need to generate files)
if ($this->Input->get('format') == 'json') {
return new JsonResponse($sections);
}
// Generate files for static and generic contents
$phpbbHeaders = "";
$phpbbHeaders .= $framework;
$phpbbHeaders .= $style;
$phpbbHeaders .= $mooScripts;
$phpbbHeaders .= $head;
file_put_contents(__DIR__ . '/../Resources/phpBB/ctsmedia/contaophpbbbridge/styles/all/template/event/overall_header_stylesheets_after.html', $phpbbHeaders);
file_put_contents(__DIR__ . '/../Resources/phpBB/ctsmedia/contaophpbbbridge/styles/all/template/event/simple_header_stylesheets_after.html', $phpbbHeaders);
file_put_contents(__DIR__ . '/../Resources/phpBB/ctsmedia/contaophpbbbridge/styles/all/template/event/overall_header_body_before.html', $overall_header);
file_put_contents(__DIR__ . '/../Resources/phpBB/ctsmedia/contaophpbbbridge/styles/all/template/event/overall_footer_after.html', $overall_footer);
System::getContainer()->get('phpbb_bridge.connector')->updateConfig(array('contao.body_class' => $this->Template->class));
return $response;
}
开发者ID:ctsmedia,项目名称:contao-phpbb-bridge-bundle,代码行数:49,代码来源:Forum.php
示例10: setUp
/**
* {@inheritdoc}
*/
public function setUp()
{
System::setContainer($this->mockContainerWithContaoScopes());
require_once __DIR__ . '/../../src/Resources/contao/config/config.php';
$this->connection = $this->getMock('Doctrine\\DBAL\\Connection', ['fetchAll'], [], '', false);
$this->eventDispatcher = $this->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
$this->imageSizes = new ImageSizes($this->connection, $this->eventDispatcher, $this->mockContaoFramework());
}
开发者ID:Mozan,项目名称:core-bundle,代码行数:11,代码来源:ImageSizesTest.php
示例11: executeCallback
/**
* @param \Closure|array $callback
* @param array $args
*
* @return mixed
*/
private function executeCallback($callback, array $args)
{
// Support Contao's getInstance() method when callback is an array
if (is_array($callback)) {
return call_user_func_array([System::importStatic($callback[0]), $callback[1]], $args);
}
return call_user_func_array($callback, $args);
}
开发者ID:terminal42,项目名称:contao-changelanguage,代码行数:14,代码来源:LabelCallback.php
示例12: __construct
/**
* Get the session data
*/
protected function __construct()
{
if (PHP_SAPI == 'cli') {
$this->session = new SymfonySession(new MockArraySessionStorage());
} else {
$this->session = \System::getContainer()->get('session');
}
$this->sessionBag = $this->session->getBag($this->getSessionBagKey());
}
开发者ID:contao,项目名称:core-bundle,代码行数:12,代码来源:Session.php
示例13: getButtons
/**
* Get buttons.
*
* @param $articleId
*
* @return string
*/
protected function getButtons($articleId)
{
global $container;
System::loadLanguageFile('tl_article');
$translator = $container['translator'];
$buttons = self::getModalEditButton($articleId, $translator);
$buttons .= self::getModalShowButton($articleId, $translator);
return $buttons;
}
开发者ID:avisota,项目名称:contao-message-element-article,代码行数:16,代码来源:ArticleListContentController.php
示例14: purge
/**
* Purge the data
*/
public function purge()
{
// Purge the data
Database::getInstance()->query("TRUNCATE TABLE tl_vimeo_cache");
// Purge the images
$folder = new \Folder(static::$imagesFolder);
$folder->purge();
// Log the action
System::log('Purged the Vimeo cache', __METHOD__, TL_CRON);
}
开发者ID:derhaeuptling,项目名称:contao-vimeo-api,代码行数:13,代码来源:Cache.php
示例15: __construct
/**
* Initialize the controller
*
* 1. Import the user
* 2. Call the parent constructor
* 3. Authenticate the user
* 4. Load the language files
* DO NOT CHANGE THIS ORDER!
*/
public function __construct()
{
$this->import('BackendUser', 'User');
parent::__construct();
$this->User->authenticate();
\System::loadLanguageFile('default');
$strFile = \Input::get('src', true);
$strFile = base64_decode($strFile);
$strFile = preg_replace('@^/+@', '', rawurldecode($strFile));
$this->strFile = $strFile;
}
开发者ID:Mozan,项目名称:core-bundle,代码行数:20,代码来源:BackendPopup.php
示例16: generate
/**
* Generate the widget and return it as string
*
* @return string
*/
public function generate()
{
$arrOptions = array();
if (!$this->multiple && count($this->arrOptions) > 1) {
$this->arrOptions = array($this->arrOptions[0]);
}
// The "required" attribute only makes sense for single checkboxes
if ($this->mandatory && !$this->multiple) {
$this->arrAttributes['required'] = 'required';
}
/** @var AttributeBagInterface $objSessionBag */
$objSessionBag = \System::getContainer()->get('session')->getBag('contao_backend');
$state = $objSessionBag->get('checkbox_groups');
// Toggle the checkbox group
if (\Input::get('cbc')) {
$state[\Input::get('cbc')] = isset($state[\Input::get('cbc')]) && $state[\Input::get('cbc')] == 1 ? 0 : 1;
$objSessionBag->set('checkbox_groups', $state);
$this->redirect(preg_replace('/(&(amp;)?|\\?)cbc=[^& ]*/i', '', \Environment::get('request')));
}
$blnFirst = true;
$blnCheckAll = true;
foreach ($this->arrOptions as $i => $arrOption) {
// Single dimension array
if (is_numeric($i)) {
$arrOptions[] = $this->generateCheckbox($arrOption, $i);
continue;
}
$id = 'cbc_' . $this->strId . '_' . \StringUtil::standardize($i);
$img = 'folPlus.svg';
$display = 'none';
if (!isset($state[$id]) || !empty($state[$id])) {
$img = 'folMinus.svg';
$display = 'block';
}
$arrOptions[] = '<div class="checkbox_toggler' . ($blnFirst ? '_first' : '') . '"><a href="' . $this->addToUrl('cbc=' . $id) . '" onclick="AjaxRequest.toggleCheckboxGroup(this,\'' . $id . '\');Backend.getScrollOffset();return false">' . \Image::getHtml($img) . '</a>' . $i . '</div><fieldset id="' . $id . '" class="tl_checkbox_container checkbox_options" style="display:' . $display . '"><input type="checkbox" id="check_all_' . $id . '" class="tl_checkbox" onclick="Backend.toggleCheckboxGroup(this, \'' . $id . '\')"> <label for="check_all_' . $id . '" style="color:#a6a6a6"><em>' . $GLOBALS['TL_LANG']['MSC']['selectAll'] . '</em></label>';
// Multidimensional array
foreach ($arrOption as $k => $v) {
$arrOptions[] = $this->generateCheckbox($v, standardize($i) . '_' . $k);
}
$arrOptions[] = '</fieldset>';
$blnFirst = false;
$blnCheckAll = false;
}
// Add a "no entries found" message if there are no options
if (empty($arrOptions)) {
$arrOptions[] = '<p class="tl_noopt">' . $GLOBALS['TL_LANG']['MSC']['noResult'] . '</p>';
$blnCheckAll = false;
}
if ($this->multiple) {
return sprintf('<fieldset id="ctrl_%s" class="tl_checkbox_container%s"><legend>%s%s%s%s</legend><input type="hidden" name="%s" value="">%s%s</fieldset>%s', $this->strId, $this->strClass != '' ? ' ' . $this->strClass : '', $this->mandatory ? '<span class="invisible">' . $GLOBALS['TL_LANG']['MSC']['mandatory'] . ' </span>' : '', $this->strLabel, $this->mandatory ? '<span class="mandatory">*</span>' : '', $this->xlabel, $this->strName, $blnCheckAll ? '<input type="checkbox" id="check_all_' . $this->strId . '" class="tl_checkbox" onclick="Backend.toggleCheckboxGroup(this,\'ctrl_' . $this->strId . '\')' . ($this->onclick ? ';' . $this->onclick : '') . '"> <label for="check_all_' . $this->strId . '" style="color:#a6a6a6"><em>' . $GLOBALS['TL_LANG']['MSC']['selectAll'] . '</em></label><br>' : '', str_replace('<br></fieldset><br>', '</fieldset>', implode('<br>', $arrOptions)), $this->wizard);
} else {
return sprintf('<div id="ctrl_%s" class="tl_checkbox_single_container%s"><input type="hidden" name="%s" value="">%s</div>%s', $this->strId, $this->strClass != '' ? ' ' . $this->strClass : '', $this->strName, str_replace('<br></div><br>', '</div>', implode('<br>', $arrOptions)), $this->wizard);
}
}
开发者ID:qzminski,项目名称:contao-core-bundle,代码行数:59,代码来源:CheckBox.php
示例17: onKernelRequest
/**
* Toggles the TL_VIEW cookie and redirects back to the referring page.
*
* @param GetResponseEvent $event The event object
*/
public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
if (!$this->isFrontendMasterRequest($event) || !$request->query->has('toggle_view')) {
return;
}
$this->framework->initialize();
$response = new RedirectResponse(System::getReferer(), 303);
$response->headers->setCookie($this->getCookie($request->query->get('toggle_view'), $request->getBasePath()));
$event->setResponse($response);
}
开发者ID:bytehead,项目名称:core-bundle,代码行数:16,代码来源:ToggleViewListener.php
示例18: generatePurgeField
/**
* Generate the purge cache field
*
* @return string
*/
public function generatePurgeField()
{
System::loadLanguageFile('tl_maintenance');
$template = new BackendTemplate('be_vimeo_rebuilder_user');
$template->elementsCount = count(Rebuilder::getContentElements());
if (($stats = Rebuilder::generateStats()) !== null) {
foreach ($stats as $k => $v) {
$template->{$k} = $v;
}
}
return $template->parse();
}
开发者ID:derhaeuptling,项目名称:contao-vimeo-api,代码行数:17,代码来源:UserContainer.php
示例19: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->getFramework()->initialize();
$output->writeln('Clearing Forum Cache');
System::getContainer()->get('phpbb_bridge.connector')->clearForumCache();
// Generate the layout if not explicitly asked for cache only
if (!$input->getOption('cache-only')) {
$output->writeln('Generating Layout Files');
System::getContainer()->get('phpbb_bridge.connector')->generateForumLayoutFiles();
}
return 0;
}
开发者ID:ctsmedia,项目名称:contao-phpbb-bridge-bundle,代码行数:12,代码来源:CacheCommand.php
示例20: dcaDataFields
/**
* @param array $arrSettings
* @return array
*/
public function dcaDataFields($arrSettings = array())
{
$arrMandatory = $arrSettings['arrMandatory'];
$this->overwriteMandatory = $arrSettings['addMandatory'] ? true : false;
$userID = $this->getUserID();
$fields = array('id' => array('sql' => 'int(10) unsigned NOT NULL auto_increment'), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'title' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['title'], 'inputType' => 'text', 'exclude' => true, 'sorting' => true, 'search' => true, 'eval' => array('maxlength' => 255, 'mandatory' => $this->setCustomMandatory($arrMandatory, 'title', '1'), 'tl_class' => 'w50', 'fmEditable' => true, 'fmGroup' => 'teaser'), 'sql' => "varchar(255) NOT NULL default ''"), 'alias' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['alias'], 'inputType' => 'text', 'exclude' => true, 'eval' => array('rgxp' => 'alias', 'maxlength' => 128, 'tl_class' => 'w50', 'unique' => true, 'fmEditable' => true, 'fmGroup' => 'teaser'), 'save_callback' => array(array('DCAModuleData', 'generateAlias')), 'sql' => "varchar(128) COLLATE utf8_bin NOT NULL default ''"), 'info' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['info'], 'inputType' => 'text', 'exclude' => true, 'search' => true, 'eval' => array('maxlength' => 255, 'tl_class' => 'clr long', 'mandatory' => $this->setCustomMandatory($arrMandatory, 'info'), 'fmEditable' => true, 'fmGroup' => 'teaser'), 'sql' => "varchar(255) NOT NULL default ''"), 'description' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['description'], 'inputType' => 'textarea', 'exclude' => true, 'search' => true, 'eval' => array('tl_class' => 'clr', 'mandatory' => $this->setCustomMandatory($arrMandatory, 'description'), 'rte' => 'tinyMCE', 'fmEditable' => true, 'fmGroup' => 'teaser'), 'sql' => "mediumtext NULL"), 'author' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['author'], 'default' => $userID, 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'foreignKey' => 'tl_user.name', 'eval' => array('doNotCopy' => true, 'chosen' => true, 'includeBlankOption' => true, 'mandatory' => true, 'tl_class' => 'w50', 'fmEditable' => true, 'fmGroup' => 'author'), 'relation' => array('type' => 'hasOne', 'load' => 'eager'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'date' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['date'], 'default' => time(), 'exclude' => true, 'filter' => true, 'sorting' => true, 'flag' => 8, 'inputType' => 'text', 'eval' => array('rgxp' => 'date', 'doNotCopy' => true, 'datepicker' => true, 'mandatory' => $this->setCustomMandatory($arrMandatory, 'date'), 'tl_class' => 'w50 wizard', 'fmEditable' => true, 'fmGroup' => 'date'), 'sql' => "int(10) unsigned NULL"), 'time' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['time'], 'default' => time(), 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'time', 'doNotCopy' => true, 'tl_class' => 'w50', 'mandatory' => $this->setCustomMandatory($arrMandatory, 'time'), 'fmEditable' => true, 'fmGroup' => 'date'), 'sql' => "int(10) unsigned NULL"), 'source' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['source'], 'default' => 'default', 'exclude' => true, 'inputType' => 'select', 'options' => array('default', 'internal', 'external'), 'reference' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack'], 'eval' => array('submitOnChange' => true, 'helpwizard' => true, 'mandatory' => $this->setCustomMandatory($arrMandatory, 'source'), 'fmEditable' => true, 'fmGroup' => 'source'), 'sql' => "varchar(32) NOT NULL default ''"), 'url' => array('label' => &$GLOBALS['TL_LANG']['MSC']['url'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('decodeEntities' => true, 'maxlength' => 255, 'tl_class' => 'w50', 'mandatory' => $this->setCustomMandatory($arrMandatory, 'url', '1'), 'fmEditable' => true, 'fmGroup' => 'source'), 'sql' => "varchar(255) NOT NULL default ''"), 'jumpTo' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['jumpTo'], 'exclude' => true, 'inputType' => 'pageTree', 'foreignKey' => 'tl_page.title', 'eval' => array('fieldType' => 'radio', 'mandatory' => $this->setCustomMandatory($arrMandatory, 'jumpTo', '1'), 'fmEditable' => true, 'fmGroup' => 'source'), 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'belongsTo', 'load' => 'lazy')), 'target' => array('label' => &$GLOBALS['TL_LANG']['MSC']['target'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12', 'mandatory' => $this->setCustomMandatory($arrMandatory, 'target'), 'fmEditable' => true, 'fmGroup' => 'source'), 'sql' => "char(1) NOT NULL default ''"), 'addEnclosure' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['addEnclosure'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'enclosure' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['enclosure'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('multiple' => true, 'fieldType' => 'checkbox', 'filesOnly' => true, 'isDownloads' => true, 'mandatory' => $this->setCustomMandatory($arrMandatory, 'enclosure', '1'), 'extensions' => \Config::get('allowedDownload'), 'fmEditable' => true, 'fmGroup' => 'enclosure'), 'sql' => "blob NULL"), 'addImage' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['addImage'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'mandatory' => $this->setCustomMandatory($arrMandatory, 'addImage')), 'sql' => "char(1) NOT NULL default ''"), 'singleSRC' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['singleSRC'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('filesOnly' => true, 'fieldType' => 'radio', 'mandatory' => $this->setCustomMandatory($arrMandatory, 'singleSRC', '1'), 'extensions' => \Config::get('validImageTypes'), 'fmEditable' => true, 'fmGroup' => 'image'), 'sql' => "binary(16) NULL"), 'alt' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['alt'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'mandatory' => $this->setCustomMandatory($arrMandatory, 'alt'), 'tl_class' => 'w50', 'fmEditable' => true, 'fmGroup' => 'image'), 'sql' => "varchar(255) NOT NULL default ''"), 'imgTitle' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['imgTitle'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'mandatory' => $this->setCustomMandatory($arrMandatory, 'imgTitle'), 'tl_class' => 'w50', 'fmEditable' => true, 'fmGroup' => 'image'), 'sql' => "varchar(255) NOT NULL default ''"), 'floating' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['floating'], 'default' => 'above', 'exclude' => true, 'inputType' => 'radioTable', 'options' => array('above', 'left', 'right', 'below'), 'eval' => array('cols' => 4, 'tl_class' => 'w50'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'sql' => "varchar(32) NOT NULL default ''"), 'size' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['size'], 'exclude' => true, 'inputType' => 'imageSize', 'options' => System::getImageSizes(), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('rgxp' => 'natural', 'includeBlankOption' => true, 'nospace' => true, 'helpwizard' => true, 'tl_class' => 'w50', 'fmEditable' => true, 'fmGroup' => 'image'), 'sql' => "varchar(64) NOT NULL default ''"), 'fullsize' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['fullsize'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12', 'mandatory' => $this->setCustomMandatory($arrMandatory, 'fullsize'), 'fmEditable' => true, 'fmGroup' => 'image'), 'sql' => "char(1) NOT NULL default ''"), 'caption' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['caption'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'allowHtml' => true, 'mandatory' => $this->setCustomMandatory($arrMandatory, 'caption'), 'tl_class' => 'w50', 'fmEditable' => true, 'fmGroup' => 'image'), 'sql' => "varchar(255) NOT NULL default ''"), 'geo_latitude' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['geo_latitude'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 128, 'tl_class' => 'w50', 'mandatory' => $this->setCustomMandatory($arrMandatory, 'geo_latitude'), 'fmEditable' => true, 'fmGroup' => 'map'), 'sql' => "varchar(128) NOT NULL default ''"), 'geo_longitude' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['geo_longitude'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 128, 'tl_class' => 'w50', 'mandatory' => $this->setCustomMandatory($arrMandatory, 'geo_longitude'), 'fmEditable' => true, 'fmGroup' => 'map'), 'sql' => "varchar(128) NOT NULL default ''"), 'geo_address' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['geo_address'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'long', 'mandatory' => $this->setCustomMandatory($arrMandatory, 'geo_address'), 'fmEditable' => true, 'fmGroup' => 'map'), 'sql' => "varchar(255) NOT NULL default ''"), 'addMarker' => array('label' => &$GLOBALS['TL_LANG']['tl_fmodules_language_pack']['addMarker'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange
|
请发表评论