當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Input::setGet方法代碼示例

本文整理匯總了PHP中Input::setGet方法的典型用法代碼示例。如果您正苦於以下問題:PHP Input::setGet方法的具體用法?PHP Input::setGet怎麽用?PHP Input::setGet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Input的用法示例。


在下文中一共展示了Input::setGet方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: toggleVisibility

 /**
  * Disable/enable a user group
  *
  * @param integer       $intId
  * @param boolean       $blnVisible
  * @param DataContainer $dc
  */
 public function toggleVisibility($intId, $blnVisible, DataContainer $dc = null)
 {
     // Set the ID and action
     Input::setGet('id', $intId);
     Input::setGet('act', 'toggle');
     if ($dc) {
         $dc->id = $intId;
         // see #8043
     }
     // Check the field access
     if (!$this->User->hasAccess('tl_member_group::disable', 'alexf')) {
         $this->log('Not enough permissions to activate/deactivate member group ID "' . $intId . '"', __METHOD__, TL_ERROR);
         $this->redirect('contao/main.php?act=error');
     }
     $objVersions = new Versions('tl_member_group', $intId);
     $objVersions->initialize();
     // Trigger the save_callback
     if (is_array($GLOBALS['TL_DCA']['tl_member_group']['fields']['disable']['save_callback'])) {
         foreach ($GLOBALS['TL_DCA']['tl_member_group']['fields']['disable']['save_callback'] as $callback) {
             if (is_array($callback)) {
                 $this->import($callback[0]);
                 $blnVisible = $this->{$callback[0]}->{$callback[1]}($blnVisible, $dc ?: $this);
             } elseif (is_callable($callback)) {
                 $blnVisible = $callback($blnVisible, $dc ?: $this);
             }
         }
     }
     // Update the database
     $this->Database->prepare("UPDATE tl_member_group SET tstamp=" . time() . ", disable='" . ($blnVisible ? '' : 1) . "' WHERE id=?")->execute($intId);
     $objVersions->create();
 }
開發者ID:eknoes,項目名稱:core,代碼行數:38,代碼來源:tl_member_group.php

示例2: generate

 /**
  * Display a wildcard in the back end
  *
  * @return string
  */
 public function generate()
 {
     if (TL_MODE == 'BE') {
         /** @var \BackendTemplate|object $objTemplate */
         $objTemplate = new \BackendTemplate('be_wildcard');
         $objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['newsreader'][0]) . ' ###';
         $objTemplate->title = $this->headline;
         $objTemplate->id = $this->id;
         $objTemplate->link = $this->name;
         $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
         return $objTemplate->parse();
     }
     // Set the item from the auto_item parameter
     if (!isset($_GET['items']) && \Config::get('useAutoItem') && isset($_GET['auto_item'])) {
         \Input::setGet('items', \Input::get('auto_item'));
     }
     // Do not index or cache the page if no news item has been specified
     if (!\Input::get('items')) {
         /** @var \PageModel $objPage */
         global $objPage;
         $objPage->noSearch = 1;
         $objPage->cache = 0;
         return '';
     }
     $this->news_archives = $this->sortOutProtected(deserialize($this->news_archives));
     // Do not index or cache the page if there are no archives
     if (!is_array($this->news_archives) || empty($this->news_archives)) {
         /** @var \PageModel $objPage */
         global $objPage;
         $objPage->noSearch = 1;
         $objPage->cache = 0;
         return '';
     }
     return parent::generate();
 }
開發者ID:StephenGWills,項目名稱:sample-contao-app,代碼行數:40,代碼來源:ModuleNewsReader.php

示例3: generate

 /**
  * @return string
  */
 public function generate()
 {
     // Backend
     if (TL_MODE == 'BE') {
         $objTemplate = new \BackendTemplate('be_wildcard');
         $objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['member_rating'][0]) . ' ###';
         $objTemplate->title = $this->headline;
         $objTemplate->id = $this->id;
         $objTemplate->link = $this->name;
         $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
         return $objTemplate->parse();
     }
     // Set the item from the auto_item parameter
     if ($GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item'])) {
         \Input::setGet('member', \Input::get('auto_item'));
     }
     // activate comment by token via url
     if (strlen(\Input::get('activation_token'))) {
         $this->activateOrDelete();
         exit;
     }
     // set the ratedUser var
     $this->ratedUser = \MemberModel::findByPk(\Input::get('member'));
     if ($this->ratedUser === null) {
         return '';
     }
     // overwrite default template
     if ($this->memberRatingDetailTemplate != '') {
         $this->strTemplate = $this->memberRatingDetailTemplate;
     }
     return parent::generate();
 }
開發者ID:markocupic,項目名稱:member_rating,代碼行數:35,代碼來源:MemberRatingDetail.php

示例4: getPageIdFromUrlStr

 /**
  * @param $arrFragments
  * @return array
  */
 public function getPageIdFromUrlStr($arrFragments)
 {
     if (count($arrFragments) > 0 && !\Config::get('taxonomyDisable')) {
         $setTaxonomy = false;
         $arrFolderUrlFragments = array();
         $arrTempFragments = $arrFragments;
         if (\Config::get('folderUrl') && isset($arrFragments[0]) && !in_array('auto_item', $arrFragments)) {
             $arrFolderUrlFragments = explode('/', $arrFragments[0]);
         }
         $arrTempFragments = count($arrFolderUrlFragments) > 1 ? $arrFolderUrlFragments : $arrTempFragments;
         $setAutoItems = $this->setParameter($arrTempFragments);
         $arrCustomizedFragments = array();
         if ($setAutoItems['specie'] || $setAutoItems['auto_item']) {
             $rootTaxonomy = $this->Database->prepare('SELECT id FROM tl_taxonomies WHERE (alias = ? OR alias = ?) AND published = "1"')->limit(1)->execute($setAutoItems['specie'], $setAutoItems['auto_item']);
             if ($rootTaxonomy->numRows) {
                 $setTaxonomy = true;
             }
         }
         if ($setTaxonomy) {
             $arrCustomizedFragments[] = $arrFragments[0];
             foreach ($setAutoItems as $param => $value) {
                 if ($param === 'auto_item') {
                     $arrCustomizedFragments[] = $param;
                     $arrCustomizedFragments[] = $value;
                     continue;
                 }
                 \Input::setGet($param, $value);
             }
             // overwrite fragments
             $arrFragments = $arrCustomizedFragments;
         }
     }
     return array_unique($arrFragments);
 }
開發者ID:alnv,項目名稱:fmodul,代碼行數:38,代碼來源:CleanUrls.php

示例5: generate

 /**
  * Display a wildcard in the back end
  * @return string
  */
 public function generate()
 {
     if (TL_MODE == 'BE') {
         $objTemplate = new \BackendTemplate('be_wildcard');
         $objTemplate->wildcard = '### FAQ READER ###';
         $objTemplate->title = $this->headline;
         $objTemplate->id = $this->id;
         $objTemplate->link = $this->name;
         $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
         return $objTemplate->parse();
     }
     // Set the item from the auto_item parameter
     if ($GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item'])) {
         \Input::setGet('items', \Input::get('auto_item'));
     }
     // Do not index or cache the page if no FAQ has been specified
     if (!\Input::get('items')) {
         global $objPage;
         $objPage->noSearch = 1;
         $objPage->cache = 0;
         return '';
     }
     $this->faq_categories = deserialize($this->faq_categories);
     // Do not index or cache the page if there are no categories
     if (!is_array($this->faq_categories) || empty($this->faq_categories)) {
         global $objPage;
         $objPage->noSearch = 1;
         $objPage->cache = 0;
         return '';
     }
     return parent::generate();
 }
開發者ID:rikaix,項目名稱:core,代碼行數:36,代碼來源:ModuleFaqReader.php

示例6: generate

 /**
  * Generate the module
  */
 public function generate()
 {
     if (TL_MODE == 'BE') {
         $objTemplate = new \BackendTemplate('be_wildcard');
         $objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['mod_airquality_full'][0]) . ' ###';
         $objTemplate->title = $this->headline;
         $objTemplate->id = $this->id;
         $objTemplate->link = $this->name;
         $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
         return $objTemplate->parse();
     }
     // Set the item from the auto_item parameter
     if (!isset($_GET['items']) && $GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item'])) {
         \Input::setGet('items', \Input::get('auto_item'));
     }
     // Return if there are no items
     if (!\Input::get('items')) {
         return '';
     }
     if (TL_MODE == 'FE') {
         $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/airquality/assets/js/Chart.min.js|static';
         $GLOBALS['TL_CSS'][] = 'system/modules/airquality/assets/styles/style.css';
     }
     return parent::generate();
 }
開發者ID:respinar,項目名稱:contao-airquality,代碼行數:28,代碼來源:ModuleAirQualityFull.php

示例7: toggleVisibility

 /**
  * Disable/enable
  *
  * @param integer       $intId
  * @param boolean       $blnVisible
  * @param DataContainer $dc
  */
 public function toggleVisibility($intId, $blnVisible, DataContainer $dc = null)
 {
     // Set the ID and action
     Input::setGet('id', $intId);
     Input::setGet('act', 'toggle');
     if ($dc) {
         $dc->id = $intId;
         // see #8043
     }
     // Check the field access
     if (!$this->User->hasAccess('tl_articlefilter_groups::published', 'alexf')) {
         $this->log('Not enough permissions to publish/unpublish articlefilter group ID "' . $intId . '"', __METHOD__, TL_ERROR);
         $this->redirect('contao/main.php?act=error');
     }
     // Trigger the save_callback
     if (is_array($GLOBALS['TL_DCA']['tl_articlefilter_groups']['fields']['published']['save_callback'])) {
         foreach ($GLOBALS['TL_DCA']['tl_articlefilter_groups']['fields']['published']['save_callback'] as $callback) {
             if (is_array($callback)) {
                 $this->import($callback[0]);
                 $blnVisible = $this->{$callback[0]}->{$callback[1]}($blnVisible, $dc ?: $this);
             } elseif (is_callable($callback)) {
                 $blnVisible = $callback($blnVisible, $dc ?: $this);
             }
         }
     }
     $time = time();
     // Update the database
     $this->Database->prepare("UPDATE tl_articlefilter_groups SET tstamp={$time}, published='" . ($blnVisible ? 1 : '') . "' WHERE id=?")->execute($intId);
 }
開發者ID:kozi,項目名稱:contao-articlefilter,代碼行數:36,代碼來源:tl_articlefilter_groups.php

示例8: toggleVisibility

 /**
  * Disable/enable a user group
  * @param integer
  * @param boolean
  * @param \DataContainer
  */
 public function toggleVisibility($intId, $blnVisible, DataContainer $dc = null)
 {
     // Check permissions to edit
     Input::setGet('id', $intId);
     Input::setGet('act', 'toggle');
     $this->checkPermission();
     // Check permissions to publish
     if (!$this->User->hasAccess('tl_product_price::published', 'alexf')) {
         $this->log('Not enough permissions to publish/unpublish price item ID "' . $intId . '"', __METHOD__, TL_ERROR);
         $this->redirect('contao/main.php?act=error');
     }
     $objVersions = new Versions('tl_product_price', $intId);
     $objVersions->initialize();
     // Trigger the save_callback
     if (is_array($GLOBALS['TL_DCA']['tl_product_price']['fields']['published']['save_callback'])) {
         foreach ($GLOBALS['TL_DCA']['tl_product_price']['fields']['published']['save_callback'] as $callback) {
             if (is_array($callback)) {
                 $this->import($callback[0]);
                 $blnVisible = $this->{$callback}[0]->{$callback}[1]($blnVisible, $dc ?: $this);
             } elseif (is_callable($callback)) {
                 $blnVisible = $callback($blnVisible, $dc ?: $this);
             }
         }
     }
     // Update the database
     $this->Database->prepare("UPDATE tl_product_price SET tstamp=" . time() . ", published='" . ($blnVisible ? 1 : '') . "' WHERE id=?")->execute($intId);
     $objVersions->create();
     $this->log('A new version of record "tl_product_price.id=' . $intId . '" has been created' . $this->getParentEntries('tl_product_price', $intId), __METHOD__, TL_GENERAL);
 }
開發者ID:respinar,項目名稱:contao-product,代碼行數:35,代碼來源:tl_product_price.php

示例9: generateRelated

 /**
  * Generate the list in related categories mode
  *
  * Use the categories of the current news item. The module must be
  * on the same page as news reader module.
  *
  * @return string
  */
 protected function generateRelated()
 {
     // Set the item from the auto_item parameter
     if (!isset($_GET['items']) && $GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item'])) {
         \Input::setGet('items', \Input::get('auto_item'));
     }
     // Return if there is no item specified
     if (!\Input::get('items')) {
         return '';
     }
     $this->news_archives = $this->sortOutProtected(deserialize($this->news_archives));
     // Return if there are no archives
     if (!is_array($this->news_archives) || empty($this->news_archives)) {
         return '';
     }
     $news = \NewsModel::findPublishedByParentAndIdOrAlias(\Input::get('items'), $this->news_archives);
     // Return if the news item was not found
     if ($news === null) {
         return '';
     }
     $GLOBALS['NEWS_FILTER_CATEGORIES'] = false;
     $GLOBALS['NEWS_FILTER_DEFAULT'] = deserialize($news->categories, true);
     $GLOBALS['NEWS_FILTER_EXCLUDE'] = array($news->id);
     return parent::generate();
 }
開發者ID:codefog,項目名稱:contao-news_categories,代碼行數:33,代碼來源:ModuleNewsList.php

示例10: generate

 public function generate()
 {
     if (TL_MODE == 'BE') {
         $objTemplate = new \BackendTemplate('be_wildcard');
         $objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['memberreader'][0]) . ' ###';
         $objTemplate->title = $this->headline;
         $objTemplate->id = $this->id;
         $objTemplate->link = $this->name;
         $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
         return $objTemplate->parse();
     }
     // logic for this is done in HeimrichHannot\Memberplus\Hooks::getPageIdFromUrlHook
     if (\Input::get('article_reader')) {
         \Input::setGet('items', \Input::get('article_reader'));
     } else {
         if (!isset($_GET['items']) && \Config::get('useAutoItem') && isset($_GET['auto_item'])) {
             \Input::setGet('items', \Input::get('auto_item'));
         }
     }
     if (!\Input::get('items')) {
         return '';
     }
     $this->mlGroups = deserialize($this->mlGroups);
     if (!is_array($this->mlGroups) || empty($this->mlGroups)) {
         return '';
     }
     return parent::generate();
 }
開發者ID:heimrichhannot,項目名稱:contao-member_plus,代碼行數:28,代碼來源:ModuleMemberReader.php

示例11: generate

 /**
  * Display a wildcard in the back end
  * @return string
  */
 public function generate()
 {
     if (TL_MODE == 'BE') {
         $objTemplate = new \BackendTemplate('be_wildcard');
         $objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['newslist_plus'][0]) . ' ###';
         $objTemplate->title = $this->headline;
         $objTemplate->id = $this->id;
         $objTemplate->link = $this->name;
         $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
         return $objTemplate->parse();
     }
     $this->news_archives = $this->sortOutProtected(deserialize($this->news_archives));
     // Return if there are no archives
     if (!is_array($this->news_archives) || empty($this->news_archives)) {
         return '';
     }
     $this->news_featured = 'featured';
     // unset search string for highlighted section
     \Input::setGet('searchKeywords', null);
     $this->objArticles = NewsPlusModel::findPublishedByPids($this->news_archives, array(), array(), $this->news_featured == 'featured', $this->numberOfItems, 0);
     if ($this->objArticles === null) {
         return '';
     }
     return parent::generate();
 }
開發者ID:heimrichhannot,項目名稱:contao-news_plus,代碼行數:29,代碼來源:ModuleNewsListHighlight.php

示例12: generate

 /**
  * Display a wildcard in the back end
  * @return string
  */
 public function generate()
 {
     if (TL_MODE == 'BE') {
         $objTemplate = new \BackendTemplate('be_wildcard');
         $objTemplate->wildcard = '### Filial-REGION-SUCHE ###';
         $objTemplate->title = $this->headline;
         $objTemplate->id = $this->id;
         $objTemplate->link = $this->name;
         $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
         return $objTemplate->parse();
     }
     // Ajax Requests abfangen
     if (\Input::get('id') && $this->Environment->get('isAjaxRequest')) {
         $this->generateAjax();
         exit;
     }
     // template overwrite
     if (strlen($this->mod_bm_template)) {
         $this->strTemplate = $this->mod_bm_template;
     }
     // Set the item from the auto_item parameter
     if (!isset($_GET['s']) && $GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item'])) {
         \Input::setGet('s', \Input::get('auto_item'));
     }
     return parent::generate();
 }
開發者ID:srhinow,項目名稱:branch_management,代碼行數:30,代碼來源:ModuleBmSearchForm.php

示例13: toggleVisibility

 /**
  * Disable/enable a user group
  *
  * @param integer       $intId
  * @param boolean       $blnVisible
  * @param DataContainer $dc
  *
  * @throws Contao\CoreBundle\Exception\AccessDeniedException
  */
 public function toggleVisibility($intId, $blnVisible, DataContainer $dc = null)
 {
     // Set the ID and action
     Input::setGet('id', $intId);
     Input::setGet('act', 'toggle');
     if ($dc) {
         $dc->id = $intId;
         // see #8043
     }
     // Check the field access
     if (!$this->User->hasAccess('tl_member_group::disable', 'alexf')) {
         throw new Contao\CoreBundle\Exception\AccessDeniedException('Not enough permissions to activate/deactivate member group ID ' . $intId . '.');
     }
     $objVersions = new Versions('tl_member_group', $intId);
     $objVersions->initialize();
     // Trigger the save_callback
     if (is_array($GLOBALS['TL_DCA']['tl_member_group']['fields']['disable']['save_callback'])) {
         foreach ($GLOBALS['TL_DCA']['tl_member_group']['fields']['disable']['save_callback'] as $callback) {
             if (is_array($callback)) {
                 $this->import($callback[0]);
                 $blnVisible = $this->{$callback[0]}->{$callback[1]}($blnVisible, $dc ?: $this);
             } elseif (is_callable($callback)) {
                 $blnVisible = $callback($blnVisible, $dc ?: $this);
             }
         }
     }
     // Update the database
     $this->Database->prepare("UPDATE tl_member_group SET tstamp=" . time() . ", disable='" . ($blnVisible ? '' : 1) . "' WHERE id=?")->execute($intId);
     $objVersions->create();
     $this->log('A new version of record "tl_member_group.id=' . $intId . '" has been created' . $this->getParentEntries('tl_member_group', $intId), __METHOD__, TL_GENERAL);
 }
開發者ID:Mozan,項目名稱:core-bundle,代碼行數:40,代碼來源:tl_member_group.php

示例14: __construct

 public function __construct()
 {
     // Set the item from the auto_item parameter
     if (!isset($_GET['store']) && $GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item'])) {
         \Input::setGet('store', \Input::get('auto_item'));
     }
     parent::__construct();
 }
開發者ID:srhinow,項目名稱:branch_management,代碼行數:8,代碼來源:feBmHooks.php

示例15: searchGlossarTerms

 public function searchGlossarTerms($strContent, $strTemplate)
 {
     global $objPage;
     if (!isset($_GET['items']) && $GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item'])) {
         \Input::setGet('items', \Input::get('auto_item'));
     }
     $arrGlossar = array($objPage->glossar);
     if ($objPage->disableGlossar == 1) {
         return $strContent;
     }
     // HOOK: search for terms in Events, faq and news
     $arrGlossar = array($objPage->glossar);
     if (isset($GLOBALS['TL_HOOKS']['glossarContent']) && is_array($GLOBALS['TL_HOOKS']['glossarContent'])) {
         foreach ($GLOBALS['TL_HOOKS']['glossarContent'] as $type => $callback) {
             $this->import($callback[0]);
             $cb_output = $this->{$callback}[0]->{$callback}[1](\Input::get('items'), $strContent, $template, $objPage->language);
             if (!empty($cb_output)) {
                 $arrGlossar[] = $cb_output;
             }
         }
     }
     if (!empty($arrGlossar)) {
         $this->term = implode('|', $arrGlossar);
     }
     $this->term = str_replace('||', '|', $this->term);
     $Glossar = \GlossarModel::findByLanguage($objPage->language);
     if (empty($Glossar)) {
         $Glossar = \GlossarModel::findByFallback(1);
     }
     $arrGlossar = array();
     if (empty($Glossar)) {
         return $strContent;
     }
     while ($Glossar->next()) {
         $arrGlossar[] = $Glossar->id;
     }
     /* replace content with tags to stop glossary replacement */
     if (\Config::get('activateGlossarTags') == 1) {
         $GlossarTags = $this->replaceGlossarTags($strContent);
     }
     $Term = \SwGlossarModel::findBy(array("title IN ('" . str_replace('|', "','", $this->term) . "') AND pid IN ('" . implode("','", $arrGlossar) . "')"), array($Glossar->id), array('order' => ' CHAR_LENGTH(title) DESC'));
     $strContent = $this->replace($strContent, $Term, $Glossar);
     if (\Config::get('glossar_no_fallback') == 1 || $objPage->glossar_no_fallback == 1) {
         /* reinsert glossar hidden content */
         if (\Config::get('activateGlossarTags') == 1) {
             $strContent = $this->insertTagContent($strContent, $GlossarTags);
         }
         return $strContent;
     }
     /* Replace the fallback languages */
     $Term = \SwGlossarModel::findBy(array("title IN ('" . str_replace('|', "','", $objPage->fallback_glossar) . "')"), array(), array('order' => ' CHAR_LENGTH(title) DESC'));
     $strContent = $this->replace($strContent, $Term);
     /* reinsert glossar hidden content */
     if (\Config::get('activateGlossarTags') == 1) {
         $strContent = $this->insertTagContent($strContent, $GlossarTags);
     }
     return $strContent;
 }
開發者ID:kbits,項目名稱:SWGlossar,代碼行數:58,代碼來源:Glossar.php


注:本文中的Input::setGet方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。