• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP F0FPlatform类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getOptions

 /**
  * Create objects for the options
  *
  * @return  array  The array of option objects
  */
 protected function getOptions()
 {
     $options = array();
     // Initialize some field attributes.
     $key = $this->element['key_field'] ? (string) $this->element['key_field'] : 'value';
     $value = $this->element['value_field'] ? (string) $this->element['value_field'] : (string) $this->element['name'];
     $translate = $this->element['translate'] ? (string) $this->element['translate'] : false;
     $query = (string) $this->element['query'];
     // Get the database object.
     $db = F0FPlatform::getInstance()->getDbo();
     // Set the query and get the result list.
     $db->setQuery($query);
     $items = $db->loadObjectlist();
     // Build the field options.
     if (!empty($items)) {
         foreach ($items as $item) {
             if ($translate == true) {
                 $options[] = JHtml::_('select.option', $item->{$key}, JText::_($item->{$value}));
             } else {
                 $options[] = JHtml::_('select.option', $item->{$key}, $item->{$value});
             }
         }
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
开发者ID:WineWorld,项目名称:joomlatrialcmbg,代码行数:32,代码来源:fieldsql.php


示例2: isEnabled

 /**
  * Is this feature enabled?
  *
  * @return bool
  */
 public function isEnabled()
 {
     if (!F0FPlatform::getInstance()->isFrontend()) {
         return false;
     }
     return $this->cparams->getValue('urlredirection', 1) == 1;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:12,代码来源:urlredir.php


示例3: isAdminAccessAttempt

 /**
  * Checks if a non logged in user is trying to access the administrator application
  *
  * @param bool $onlySubmit bool Return true only if the login form is submitted
  *
  * @return bool
  */
 protected function isAdminAccessAttempt($onlySubmit = false)
 {
     // Not back-end at all. Bail out.
     if (!F0FPlatform::getInstance()->isBackend()) {
         return false;
     }
     // If the user is already logged in we don't have a login attempt
     $user = JFactory::getUser();
     if (!$user->guest) {
         return false;
     }
     // If we have option=com_login&task=login then the user is submitting the login form. Otherwise Joomla! is
     // just displaying the login form.
     $input = JFactory::getApplication()->input;
     $option = $input->getCmd('option', null);
     $task = $input->getCmd('task', null);
     $isPostingLoginForm = $option == 'com_login' && $task == 'login';
     // If the user is submitting the login form we return depending on whether we are asked for posting access
     // or not.
     if ($isPostingLoginForm) {
         return $onlySubmit;
     }
     // This is a regular admin access attempt
     if ($onlySubmit) {
         // Since we were asked to only return true for login form posting and this is not the case we have to
         // return false (the login form is not being posted)
         return false;
     }
     // In any other case we return true.
     return true;
 }
开发者ID:enjoy2000,项目名称:smcd,代码行数:38,代码来源:abstract.php


示例4: isEnabled

	/**
	 * Is this feature enabled?
	 *
	 * @return bool
	 */
	public function isEnabled()
	{
		// We only use this feature in the front-end
		if (F0FPlatform::getInstance()->isBackend())
		{
			return false;
		}

		// The feature must be enabled
		if ($this->cparams->getValue('httpsizer', 0) != 1)
		{
			return false;
		}

		// Make sure we're accessed over SSL (HTTPS)
		$uri = JURI::getInstance();
		$protocol = $uri->toString(array('scheme'));

		if ($protocol != 'https://')
		{
			return false;
		}


		return true;
	}
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:31,代码来源:httpsizer.php


示例5: isEnabled

 /**
  * Is this feature enabled?
  *
  * @return bool
  */
 public function isEnabled()
 {
     if (!F0FPlatform::getInstance()->isFrontend()) {
         return false;
     }
     return $this->cparams->getValue('httpblenable', 0) == 1;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:12,代码来源:projecthoneypot.php


示例6: onCreate

 public function onCreate($tpl = null)
 {
     $document = F0FPlatform::getInstance()->getDocument();
     if ($document instanceof JDocument) {
         if ($this->useHypermedia) {
             $document->setMimeEncoding('application/hal+json');
         } else {
             $document->setMimeEncoding('application/json');
         }
     }
     $key = $this->input->getCmd('key', '');
     $pwd = $this->input->getCmd('pwd', '');
     $json = $this->getModel()->createCoupon($key, $pwd);
     $json = json_encode($json);
     // JSONP support
     $callback = $this->input->get('callback', null);
     if (!empty($callback)) {
         echo $callback . '(' . $json . ')';
     } else {
         $defaultName = $this->input->getCmd('view', 'joomla');
         $filename = $this->input->getCmd('basename', $defaultName);
         $document->setName($filename);
         echo $json;
     }
     return false;
 }
开发者ID:jonatasmm,项目名称:akeebasubs,代码行数:26,代码来源:view.json.php


示例7: isEnabled

 /**
  * Is this feature enabled?
  *
  * @return bool
  */
 public function isEnabled()
 {
     if (!F0FPlatform::getInstance()->isFrontend()) {
         return false;
     }
     return $this->cparams->getValue('custgenerator', 0) != 0;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:12,代码来源:customgenerator.php


示例8: isEnabled

 /**
  * Is this feature enabled?
  *
  * @return bool
  */
 public function isEnabled()
 {
     if (!F0FPlatform::getInstance()->isBackend()) {
         return false;
     }
     return $this->cparams->getValue('nonewadmins', 0) == 1;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:12,代码来源:nonewadmins.php


示例9: cron

 public function cron($cachable = false)
 {
     // Makes sure SiteGround's SuperCache doesn't cache the CRON view
     JResponse::setHeader('X-Cache-Control', 'False', true);
     require_once F0FTemplateUtils::parsePath('admin://components/com_akeebasubs/helpers/cparams.php', true);
     $configuredSecret = AkeebasubsHelperCparams::getParam('secret', '');
     if (empty($configuredSecret)) {
         header('HTTP/1.1 503 Service unavailable due to configuration');
         JFactory::getApplication()->close();
     }
     $secret = $this->input->get('secret', null, 'raw');
     if ($secret != $configuredSecret) {
         header('HTTP/1.1 403 Forbidden');
         JFactory::getApplication()->close();
     }
     $command = $this->input->get('command', null, 'raw');
     $command = trim(strtolower($command));
     if (empty($command)) {
         header('HTTP/1.1 501 Not implemented');
         JFactory::getApplication()->close();
     }
     F0FPlatform::getInstance()->importPlugin('system');
     F0FPlatform::getInstance()->runPlugins('onAkeebasubsCronTask', array($command, array('time_limit' => 10)));
     echo "{$command} OK";
     JFactory::getApplication()->close();
 }
开发者ID:jonatasmm,项目名称:akeebasubs,代码行数:26,代码来源:cron.php


示例10: isEnabled

	/**
	 * Is this feature enabled?
	 *
	 * @return bool
	 */
	public function isEnabled()
	{
		// We only use this feature in the front-end
		if (F0FPlatform::getInstance()->isBackend())
		{
			return false;
		}

		// The feature must be enabled
		if ($this->cparams->getValue('linkmigration', 0) != 1)
		{
			return false;
		}

		// Populate the old domains array
		$this->populateOldDomains();

		// If there are no old domains to migrate from, what exactly am I doing here?
		if (empty($this->oldDomains))
		{
			return false;
		}

		return true;
	}
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:30,代码来源:linkmigration.php


示例11: isEnabled

 /**
  * Is this feature enabled?
  *
  * @return bool
  */
 public function isEnabled()
 {
     if (!F0FPlatform::getInstance()->isBackend()) {
         return false;
     }
     $password = $this->cparams->getValue('adminpw', '');
     return !empty($password);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:13,代码来源:secretword.php


示例12: getForm

 /**
  * A method for getting the form from the model.
  *
  * @param   array    $data      Data for the form.
  * @param   boolean  $loadData  True if the form is to load its own data (default case), false if not.
  * @param   boolean  $source    The name of the form. If not set we'll try the form_name state variable or fall back to default.
  *
  * @return  mixed  A F0FForm object on success, false on failure
  */
 public function getForm($data = array(), $loadData = true, $source = null)
 {
     $f0fPlatform = F0FPlatform::getInstance();
     $isFrontend = $f0fPlatform->isFrontend();
     $this->input->set('option', 'com_content');
     $this->input->set('view', $isFrontend ? 'form' : 'article');
     return parent::getForm($data, $loadData, $source);
 }
开发者ID:johngrange,项目名称:wookeyholeweb,代码行数:17,代码来源:feedcontent.php


示例13: getOptions

 /**
  * Method to get a list of tags
  *
  * @return  array  The field option objects.
  *
  * @since   3.1
  */
 protected function getOptions()
 {
     $options = array();
     $published = $this->element['published'] ? $this->element['published'] : array(0, 1);
     $db = F0FPlatform::getInstance()->getDbo();
     $query = $db->getQuery(true)->select('a.id AS value, a.path, a.title AS text, a.level, a.published')->from('#__tags AS a')->join('LEFT', $db->quoteName('#__tags') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt');
     if ($this->item instanceof F0FTable) {
         $item = $this->item;
     } else {
         $item = $this->form->getModel()->getItem();
     }
     if ($item instanceof F0FTable) {
         // Fake value for selected tags
         $keyfield = $item->getKeyName();
         $content_id = $item->{$keyfield};
         $type = $item->getContentType();
         $selected_query = $db->getQuery(true);
         $selected_query->select('tag_id')->from('#__contentitem_tag_map')->where('content_item_id = ' . (int) $content_id)->where('type_alias = ' . $db->quote($type));
         $db->setQuery($selected_query);
         $this->value = $db->loadColumn();
     }
     // Ajax tag only loads assigned values
     if (!$this->isNested()) {
         // Only item assigned values
         $values = (array) $this->value;
         F0FUtilsArray::toInteger($values);
         $query->where('a.id IN (' . implode(',', $values) . ')');
     }
     // Filter language
     if (!empty($this->element['language'])) {
         $query->where('a.language = ' . $db->quote($this->element['language']));
     }
     $query->where($db->quoteName('a.alias') . ' <> ' . $db->quote('root'));
     // Filter to only load active items
     // Filter on the published state
     if (is_numeric($published)) {
         $query->where('a.published = ' . (int) $published);
     } elseif (is_array($published)) {
         F0FUtilsArray::toInteger($published);
         $query->where('a.published IN (' . implode(',', $published) . ')');
     }
     $query->group('a.id, a.title, a.level, a.lft, a.rgt, a.parent_id, a.published, a.path')->order('a.lft ASC');
     // Get the options.
     $db->setQuery($query);
     try {
         $options = $db->loadObjectList();
     } catch (RuntimeException $e) {
         return false;
     }
     // Prepare nested data
     if ($this->isNested()) {
         $this->prepareOptionsNested($options);
     } else {
         $options = JHelperTags::convertPathsToNames($options);
     }
     return $options;
 }
开发者ID:kidaa30,项目名称:lojinha,代码行数:64,代码来源:tag.php


示例14: isEnabled

 /**
  * Is this feature enabled?
  *
  * @return bool
  */
 public function isEnabled()
 {
     if (!F0FPlatform::getInstance()->isBackend()) {
         return false;
     }
     if (!$this->cparams->getValue('awayschedule_from') || !$this->cparams->getValue('awayschedule_to')) {
         return false;
     }
     return true;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:15,代码来源:awayschedule.php


示例15: isEnabled

 /**
  * Is this feature enabled?
  *
  * @return bool
  */
 public function isEnabled()
 {
     if (!F0FPlatform::getInstance()->isFrontend()) {
         return false;
     }
     if ($this->skipFiltering) {
         return false;
     }
     return $this->cparams->getValue('xssshield', 0) == 1;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:15,代码来源:xssshield.php


示例16:

 /**
  * Returns a new database query class
  *
  * @param   JDatabaseDriver  $db  The DB driver which will provide us with a query object
  *
  * @return F0FQueryAbstract
  */
 public static function &getNew($db = null)
 {
     F0FPlatform::getInstance()->logDeprecated('F0FQueryAbstract is deprecated. Use JDatabaseQuery instead.');
     if (is_null($db)) {
         $ret = F0FPlatform::getInstance()->getDbo()->getQuery(true);
     } else {
         $ret = $db->getQuery(true);
     }
     return $ret;
 }
开发者ID:JozefAB,项目名称:neoacu,代码行数:17,代码来源:abstract.php


示例17: isEnabled

 /**
  * Is this feature enabled?
  *
  * @return bool
  */
 public function isEnabled()
 {
     if (!F0FPlatform::getInstance()->isFrontend()) {
         return false;
     }
     if ($this->cparams->getValue('nofesalogin', 0) != 1) {
         return false;
     }
     return true;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:15,代码来源:nofesalogin.php


示例18: getOptions

 /**
  * Create objects for the options
  *
  * @return  array  The array of option objects
  */
 protected function getOptions()
 {
     $options = array();
     // Get the field $options
     foreach ($this->element->children() as $option) {
         // Only add <option /> elements.
         if ($option->getName() != 'option') {
             continue;
         }
         // Create a new option object based on the <option /> element.
         $options[] = JHtml::_('select.option', (string) $option['value'], JText::alt(trim((string) $option), preg_replace('/[^a-zA-Z0-9_\\-]/', '_', $this->fieldname)), 'value', 'text', (string) $option['disabled'] == 'true');
     }
     // Do we have a class and method source for our options?
     $source_file = empty($this->element['source_file']) ? '' : (string) $this->element['source_file'];
     $source_class = empty($this->element['source_class']) ? '' : (string) $this->element['source_class'];
     $source_method = empty($this->element['source_method']) ? '' : (string) $this->element['source_method'];
     $source_key = empty($this->element['source_key']) ? '*' : (string) $this->element['source_key'];
     $source_value = empty($this->element['source_value']) ? '*' : (string) $this->element['source_value'];
     $source_translate = empty($this->element['source_translate']) ? 'true' : (string) $this->element['source_translate'];
     $source_translate = in_array(strtolower($source_translate), array('true', 'yes', '1', 'on')) ? true : false;
     $source_format = empty($this->element['source_format']) ? '' : (string) $this->element['source_format'];
     if ($source_class && $source_method) {
         // Maybe we have to load a file?
         if (!empty($source_file)) {
             $source_file = F0FTemplateUtils::parsePath($source_file, true);
             if (F0FPlatform::getInstance()->getIntegrationObject('filesystem')->fileExists($source_file)) {
                 include_once $source_file;
             }
         }
         // Make sure the class exists
         if (class_exists($source_class, true)) {
             // ...and so does the option
             if (in_array($source_method, get_class_methods($source_class))) {
                 // Get the data from the class
                 if ($source_format == 'optionsobject') {
                     $options = array_merge($options, $source_class::$source_method());
                 } else {
                     $source_data = $source_class::$source_method();
                     // Loop through the data and prime the $options array
                     foreach ($source_data as $k => $v) {
                         $key = empty($source_key) || $source_key == '*' ? $k : $v[$source_key];
                         $value = empty($source_value) || $source_value == '*' ? $v : $v[$source_value];
                         if ($source_translate) {
                             $value = JText::_($value);
                         }
                         $options[] = JHtml::_('select.option', $key, $value, 'value', 'text');
                     }
                 }
             }
         }
     }
     reset($options);
     return $options;
 }
开发者ID:01J,项目名称:topm,代码行数:59,代码来源:fieldselectable.php


示例19: onBeforeDispatch

 /**
  * onBeforeDispatch.
  *
  * @return	void
  */
 public function onBeforeDispatch()
 {
     $result = parent::onBeforeDispatch();
     if ($result && !F0FPlatform::getInstance()->isCli()) {
         $view = $this->input->getCmd('view');
         Extly::loadStyle(false, $view != 'composer');
         $document = JFactory::getDocument();
         $document->addStyleSheet(JUri::root() . 'media/com_autotweet/css/style.css?version=' . CAUTOTWEETNG_VERSION);
     }
     return $result;
 }
开发者ID:johngrange,项目名称:wookeyholeweb,代码行数:16,代码来源:dispatcher.php


示例20: isEnabled

 /**
  * Is this feature enabled?
  *
  * @return bool
  */
 public function isEnabled()
 {
     if (!F0FPlatform::getInstance()->isFrontend()) {
         return false;
     }
     $domains = $this->cparams->getValue('blockedemaildomains', '');
     if (empty($domains)) {
         return false;
     }
     return true;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:16,代码来源:blockemaildomains.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP F0FTable类代码示例发布时间:2022-05-23
下一篇:
PHP F0FModel类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap