本文整理汇总了PHP中Message::addInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Message::addInfo方法的具体用法?PHP Message::addInfo怎么用?PHP Message::addInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Message
的用法示例。
在下文中一共展示了Message::addInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check
/**
* Check permissions for that entry
* @return void
*/
public static function check()
{
$session = \Session::getInstance()->getData();
if (\Input::get('act') == 'delete' && in_array(\Input::get('id'), static::getUndeletableIds())) {
\System::log('Product type ID ' . \Input::get('id') . ' is used in an order and can\'t be deleted', __METHOD__, TL_ERROR);
\Controller::redirect('contao/main.php?act=error');
} elseif (\Input::get('act') == 'deleteAll' && is_array($session['CURRENT']['IDS'])) {
$arrDeletable = array_diff($session['CURRENT']['IDS'], static::getUndeletableIds());
if (count($arrDeletable) != count($session['CURRENT']['IDS'])) {
$session['CURRENT']['IDS'] = array_values($arrDeletable);
\Session::getInstance()->setData($session);
\Message::addInfo($GLOBALS['TL_LANG']['MSC']['undeletableRecords']);
}
}
// Disable variants if no such attributes are available
\Controller::loadDataContainer('tl_iso_product');
$blnVariants = false;
foreach ($GLOBALS['TL_DCA']['tl_iso_product']['fields'] as $strName => $arrConfig) {
$objAttribute = $GLOBALS['TL_DCA']['tl_iso_product']['attributes'][$strName];
if (null !== $objAttribute && $objAttribute->isVariantOption()) {
$blnVariants = true;
break;
}
}
if (!$blnVariants) {
\System::loadLanguageFile('explain');
unset($GLOBALS['TL_DCA']['tl_iso_producttype']['subpalettes']['variants']);
$GLOBALS['TL_DCA']['tl_iso_producttype']['fields']['variants']['input_field_callback'] = function ($dc) {
// Make sure variants are disabled in this product type (see #1114)
\Database::getInstance()->prepare("UPDATE " . $dc->table . " SET variants='' WHERE id=?")->execute($dc->id);
return '<br><p class="tl_info">' . $GLOBALS['TL_LANG']['XPL']['noVariantAttributes'] . '</p>';
};
}
}
示例2: addButton
/**
* @param GetEditModeButtonsEvent $objEvent
*/
public function addButton(GetEditModeButtonsEvent $objEvent)
{
if (!$this->isRightContext($objEvent->getEnvironment())) {
return;
}
// Check the file cache.
$strInitFilePath = '/system/config/initconfig.php';
if (file_exists(TL_ROOT . $strInitFilePath)) {
$strFile = new \File($strInitFilePath);
$arrFileContent = $strFile->getContentAsArray();
foreach ($arrFileContent as $strContent) {
if (!preg_match("/(\\/\\*|\\*|\\*\\/|\\/\\/)/", $strContent)) {
//system/tmp.
if (preg_match("/system\\/tmp/", $strContent)) {
// Set data.
\Message::addInfo($GLOBALS['TL_LANG']['MSC']['disabled_cache']);
}
}
}
}
// Update a field with last sync information
$objSyncTime = \Database::getInstance()->prepare("SELECT cl.syncFrom_tstamp as syncFrom_tstamp, user.name as syncFrom_user, user.username as syncFrom_alias\n FROM tl_synccto_clients as cl\n INNER JOIN tl_user as user\n ON cl.syncTo_user = user.id\n WHERE cl.id = ?")->limit(1)->execute(\Input::get("id"));
if ($objSyncTime->syncFrom_tstamp != 0 && strlen($objSyncTime->syncFrom_user) != 0 && strlen($objSyncTime->syncFrom_alias) != 0) {
$strLastSync = vsprintf($GLOBALS['TL_LANG']['MSC']['last_sync'], array(date($GLOBALS['TL_CONFIG']['timeFormat'], $objSyncTime->syncFrom_tstamp), date($GLOBALS['TL_CONFIG']['dateFormat'], $objSyncTime->syncFrom_tstamp), $objSyncTime->syncFrom_user, $objSyncTime->syncFrom_alias));
// Set data
\Message::addInfo($strLastSync);
}
// Set buttons.
$objEvent->setButtons(array('start_sync' => '<input type="submit" name="start_sync" id="start_sync" class="tl_submit" accesskey="s" value="' . specialchars($GLOBALS['TL_LANG']['MSC']['sync']) . '" />', 'start_sync_all' => '<input type="submit" name="start_sync_all" id="start_sync_all" class="tl_submit" accesskey="o" value="' . specialchars($GLOBALS['TL_LANG']['MSC']['syncAll']) . '" />'));
}
示例3: getLonLat
/**
* Find the longitute and latitude from a location string
* @param type $strAddress
* @param type $strCountry
* @example http://wiki.openstreetmap.org/wiki/Nominatim#Examples
*/
public static function getLonLat($strAddress, $strCountry = null)
{
$strQuery = 'https://nominatim.openstreetmap.org/search?' . 'q=' . rawurlencode($strAddress) . '&format=json' . '&accept-language=' . $GLOBALS['TL_LANGUAGE'] . '&limit=1';
if ($strCountry) {
$strQuery .= '&countrycodes=' . $strCountry;
}
$objRequest = new \Request();
$objRequest->send($strQuery);
// Return on error
if ($objRequest->hasError()) {
\System::log("Failed Request '{$strQuery}' with error '{$objRequest->error}'", __METHOD__, TL_ERROR);
return false;
}
$arrResponse = json_decode($objRequest->response);
// Return on empty response
if (!count($arrResponse)) {
\System::log("Empty Request for address '{$strAddress}': '{$strQuery}'", __METHOD__, TL_ERROR);
return false;
}
// Display copyright and licence in backend
if (TL_MODE == 'BE') {
\Message::addInfo($arrResponse[0]->licence);
}
return array('licence' => $arrResponse[0]->licence, 'address' => $arrResponse[0]->display_name, 'latitude' => $arrResponse[0]->lat, 'longitude' => $arrResponse[0]->lon);
}
示例4: showJsLibraryHint
public function showJsLibraryHint()
{
if ('edit' === \Input::get('act')) {
$gallery = Gallery::findByPk(\Input::get('id'));
if (null !== $gallery && 'elevatezoom' === $gallery->type) {
\Message::addInfo($GLOBALS['TL_LANG']['tl_iso_gallery']['includeJQuery']);
}
}
}
示例5: generateForumlayout
protected function generateForumlayout($activeRecord)
{
Message::addInfo("Generating Layout");
$row = $activeRecord->row();
$row['skipInternalHook'] = true;
$url = Controller::generateFrontendUrl($row, null, null, false);
$frontendRequest = new \Contao\Request();
$frontendRequest->send(Environment::get('url') . '/' . $url);
}
示例6: disableSpecialFieldsFromSyncUser
/**
* Remove synchronised fields from palettes
*
* @param \DataContainer $dc
*/
public function disableSpecialFieldsFromSyncUser(\DataContainer $dc)
{
$objUser = \Database::getInstance()->prepare('SELECT * FROM `tl_user` WHERE id = ?')->execute($dc->id);
if ($objUser->syncacc == true) {
\Message::addInfo($GLOBALS['TL_LANG']['syncAcc']['under_sync']);
$arrDisableFields = $GLOBALS['SYNCACC']['SYNC_FIELDS']['user'];
foreach ($arrDisableFields as $field) {
$GLOBALS['TL_DCA']['tl_user']['fields'][$field]['eval']['readonly'] = true;
}
}
}
示例7: showJsLibraryHint
/**
* Show a hint if a JavaScript library needs to be included in the page layout
*/
public function showJsLibraryHint($dc)
{
//if ($_POST || Input::get('act') != 'edit')
//return;
$objFfm = FormFieldModel::findByPk($dc->id);
if ($objFfm === null) {
return;
}
if ($objFfm->type == 'textarea' && $objFfm->fag_enabled) {
Message::addInfo(sprintf($GLOBALS['TL_LANG']['tl_content']['includeTemplates'], 'moo_autogrow', 'j_autogrow'));
}
}
示例8: showJsLibraryHint
/**
* Show a hint if a JavaScript library needs to be included in the page layout
*/
public function showJsLibraryHint()
{
if ($_POST || Input::get('act') != 'edit') {
return;
}
// Return if the user cannot access the layout module (see #6190)
if (!$this->User->hasAccess('themes', 'modules') || !$this->User->hasAccess('layout', 'themes')) {
return;
}
System::loadLanguageFile('tl_layout');
Message::addInfo(sprintf($GLOBALS['TL_LANG']['tl_image_size']['picturefill'], $GLOBALS['TL_LANG']['tl_layout']['picturefill'][0]));
}
示例9: getFields
public static function getFields($varInputType = array())
{
$arrOptions = array();
foreach (\HeimrichHannot\Haste\Dca\General::getFields('tl_submission', false, $varInputType, array(), false) as $strField) {
if (!in_array($strField, static::getSkipFields())) {
$arrOptions[] = $strField;
}
}
if (empty($arrOptions) && TL_MODE == 'BE' && \Input::get('do') == 'submission') {
\Message::addInfo($GLOBALS['TL_LANG']['MSC']['noSubmissionFields']);
}
return $arrOptions;
}
示例10: disableSpecialFieldsFromSyncMember
/**
* Remove synchronised fields from palettes
*
* @param \DataContainer $dc
*/
public function disableSpecialFieldsFromSyncMember(\DataContainer $dc)
{
$objMember = \Database::getInstance()->prepare('SELECT * FROM `tl_member` WHERE id = ?')->execute($dc->id);
if ($objMember->syncacc == true) {
\Message::addInfo($GLOBALS['TL_LANG']['syncAcc']['under_sync']);
$backendUser = \BackendUser::getInstance();
$backendUser->authenticate();
if (!empty($GLOBALS['SyncAcc']['sa']) && in_array($backendUser->id, $GLOBALS['SyncAcc']['sa'])) {
\Message::addInfo($GLOBALS['TL_LANG']['syncAcc']['under_sync_sa']);
} else {
$arrDisableFields = $GLOBALS['SYNCACC']['SYNC_FIELDS']['member'];
foreach ($arrDisableFields as $field) {
$GLOBALS['TL_DCA']['tl_member']['fields'][$field]['eval']['readonly'] = true;
}
}
}
}
示例11: generateForumlayout
public function generateForumlayout(DataContainer $dc)
{
// Return if there is no active record (override all)
if (!$dc->activeRecord || $dc->activeRecord->type != 'phpbb_forum') {
return;
}
$row = $dc->activeRecord->row();
// If it's a new object with no values we can skip here
if (empty($row['phpbb_path']) && empty($row['phpbb_alias'])) {
return;
}
Message::addInfo("Generating Layout");
$row['skipInternalHook'] = true;
$url = Controller::generateFrontendUrl($row, null, null, false);
$frontendRequest = new \Contao\Request();
$frontendRequest->send(Environment::get('url') . '/' . $url);
}
示例12: checkFileCache
/**
* Check if the file cache is active or not.
*/
public static function checkFileCache()
{
// Check the file cache.
$strInitFilePath = '/system/config/initconfig.php';
if (file_exists(TL_ROOT . $strInitFilePath)) {
$strFile = new \File($strInitFilePath);
$arrFileContent = $strFile->getContentAsArray();
foreach ($arrFileContent as $strContent) {
if (!preg_match("/(\\/\\*|\\*|\\*\\/|\\/\\/)/", $strContent)) {
//system/tmp.
if (preg_match("/system\\/tmp/", $strContent)) {
// Set data.
\Message::addInfo($GLOBALS['TL_LANG']['MSC']['disabled_cache']);
}
}
}
}
}
示例13: compile
/**
* Generate module
*/
protected function compile()
{
// Create files
if (\Input::post('FORM_SUBMIT') == 'tl_entity_import') {
$objModel = EntityImportConfigModel::findByPk($this->objDc->id);
if ($objModel === null) {
return;
}
if (class_exists($objModel->importerClass)) {
// use a particular importer (e.g. NewsImporter)
\Message::addInfo(sprintf($GLOBALS['TL_LANG']['tl_entity_import_config']['importerInfo'], $objModel->importerClass));
$importer = new $objModel->importerClass($objModel);
} else {
\Message::addInfo(sprintf($GLOBALS['TL_LANG']['tl_entity_import_config']['importerInfo'], 'Importer'));
$importer = new Importer($objModel);
}
if ($importer->run(\Input::post('dry-run'))) {
// Confirm and reload
$strMessage = $GLOBALS['TL_LANG']['tl_entity_import_config']['confirm'];
if (\Input::post('dry-run')) {
$strMessage = $GLOBALS['TL_LANG']['tl_entity_import_config']['confirmDry'];
}
\Message::addConfirmation($strMessage);
\Controller::reload();
}
}
$this->Template->base = \Environment::get('base');
$this->Template->href = \Controller::getReferer(true);
$this->Template->title = specialchars($GLOBALS['TL_LANG']['MSC']['backBTTitle']);
$this->Template->action = ampersand(\Environment::get('request'));
$this->Template->selectAll = $GLOBALS['TL_LANG']['MSC']['selectAll'];
$this->Template->button = $GLOBALS['TL_LANG']['MSC']['backBT'];
$this->Template->message = \Message::generate();
$this->Template->submit = specialchars($GLOBALS['TL_LANG']['tl_entity_import_config']['import'][0]);
$this->Template->dryRun = specialchars($GLOBALS['TL_LANG']['tl_entity_import_config']['dryRun'][0]);
$this->Template->headline = sprintf($GLOBALS['TL_LANG']['tl_entity_import_config']['headline'], \Input::get('id'));
$this->Template->explain = $GLOBALS['TL_LANG']['tl_entity_import_config']['make'][1];
$this->Template->label = $GLOBALS['TL_LANG']['tl_entity_import_config']['label'];
}
示例14: addInfoMessage
/**
* Add an info message
*
* @param string $strMessage The info message
*
* @deprecated Use Message::addInfo() instead
*/
protected function addInfoMessage($strMessage)
{
\Message::addInfo($strMessage);
}
示例15: showJsLibraryHint
/**
* Show a hint if a JavaScript library needs to be included in the page layout
*
* @param DataContainer $dc
*/
public function showJsLibraryHint(DataContainer $dc)
{
if ($_POST || Input::get('act') != 'edit') {
return;
}
// Return if the user cannot access the layout module (see #6190)
if (!$this->User->hasAccess('themes', 'modules') || !$this->User->hasAccess('layout', 'themes')) {
return;
}
$objCte = ContentModel::findByPk($dc->id);
if ($objCte === null) {
return;
}
switch ($objCte->type) {
case 'gallery':
Message::addInfo(sprintf($GLOBALS['TL_LANG']['tl_content']['includeTemplates'], 'moo_mediabox', 'j_colorbox'));
break;
case 'sliderStart':
case 'sliderStop':
Message::addInfo(sprintf($GLOBALS['TL_LANG']['tl_content']['includeTemplates'], 'moo_slider', 'j_slider'));
break;
case 'accordionSingle':
case 'accordionStart':
case 'accordionStop':
Message::addInfo(sprintf($GLOBALS['TL_LANG']['tl_content']['includeTemplates'], 'moo_accordion', 'j_accordion'));
break;
case 'player':
case 'youtube':
Message::addInfo(sprintf($GLOBALS['TL_LANG']['tl_content']['includeTemplate'], 'j_mediaelement'));
break;
case 'table':
if ($objCte->sortable) {
Message::addInfo(sprintf($GLOBALS['TL_LANG']['tl_content']['includeTemplates'], 'moo_tablesort', 'j_tablesort'));
}
break;
}
}