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

PHP F0FInflector类代码示例

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

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



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

示例1: __construct

 /**
  * Public constructor. Instantiates a F0FViewCsv object.
  *
  * @param   array  $config  The configuration data array
  */
 public function __construct($config = array())
 {
     // Make sure $config is an array
     if (is_object($config)) {
         $config = (array) $config;
     } elseif (!is_array($config)) {
         $config = array();
     }
     parent::__construct($config);
     if (array_key_exists('csv_header', $config)) {
         $this->csvHeader = $config['csv_header'];
     } else {
         $this->csvHeader = $this->input->getBool('csv_header', true);
     }
     if (array_key_exists('csv_filename', $config)) {
         $this->csvFilename = $config['csv_filename'];
     } else {
         $this->csvFilename = $this->input->getString('csv_filename', '');
     }
     if (empty($this->csvFilename)) {
         $view = $this->input->getCmd('view', 'cpanel');
         $view = F0FInflector::pluralize($view);
         $this->csvFilename = strtolower($view);
     }
     if (array_key_exists('csv_fields', $config)) {
         $this->csvFields = $config['csv_fields'];
     }
 }
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:33,代码来源:csv.php


示例2: getRepeatable

 public function getRepeatable()
 {
     $html = '';
     // Find which is the relation to use
     if ($this->item instanceof F0FTable) {
         // Pluralize the name to match that of the relation
         $relation_name = F0FInflector::pluralize($this->name);
         // Get the relation
         $iterator = $this->item->getRelations()->getMultiple($relation_name);
         $results = array();
         // Decide which class name use in tag markup
         $class = !empty($this->element['class']) ? $this->element['class'] : F0FInflector::singularize($this->name);
         foreach ($iterator as $item) {
             $markup = '<span class="%s">%s</span>';
             // Add link if show_link parameter is set
             if (!empty($this->element['url']) && !empty($this->element['show_link']) && $this->element['show_link']) {
                 // Parse URL
                 $url = $this->getReplacedPlaceholders($this->element['url'], $item);
                 // Set new link markup
                 $markup = '<a class="%s" href="' . JRoute::_($url) . '">%s</a>';
             }
             array_push($results, sprintf($markup, $class, $item->get($item->getColumnAlias('title'))));
         }
         // Join all html segments
         $html .= implode(', ', $results);
     }
     // Parse field parameters
     if (empty($html) && !empty($this->element['empty_replacement'])) {
         $html = JText::_($this->element['empty_replacement']);
     }
     return $html;
 }
开发者ID:fede91it,项目名称:fof-nnrelation,代码行数:32,代码来源:nnrelation.php


示例3: addSubmenuLink

 private function addSubmenuLink($view, $parent = null)
 {
     static $activeView = null;
     if (empty($activeView)) {
         $activeView = $this->input->getCmd('view', 'cpanel');
     }
     if ($activeView == 'cpanels') {
         $activeView = 'cpanel';
     }
     $key = strtoupper($this->component) . '_TITLE_' . strtoupper($view);
     if (strtoupper(JText::_($key)) == $key) {
         $altview = F0FInflector::isPlural($view) ? F0FInflector::singularize($view) : F0FInflector::pluralize($view);
         $key2 = strtoupper($this->component) . '_TITLE_' . strtoupper($altview);
         if (strtoupper(JText::_($key2)) == $key2) {
             $name = ucfirst($view);
         } else {
             $name = JText::_($key2);
         }
     } else {
         $name = JText::_($key);
     }
     $link = 'index.php?option=' . $this->component . '&view=' . $view;
     $active = $view == $activeView;
     $this->appendLink($name, $link, $active, null, $parent);
 }
开发者ID:jonatasmm,项目名称:akeebasubs,代码行数:25,代码来源:toolbar.php


示例4: accessAllowed

 /**
  * Checks if the user should be granted access to the current view,
  * based on his Master Password setting.
  *
  * @param string view Optional. The string to check. Leave null to use the current view.
  *
  * @return bool
  */
 public function accessAllowed($view = null)
 {
     if (interface_exists('JModel')) {
         $params = JModelLegacy::getInstance('Storage', 'AdmintoolsModel');
     } else {
         $params = JModel::getInstance('Storage', 'AdmintoolsModel');
     }
     if (empty($view)) {
         $view = $this->input->get('view', 'cpanel');
     }
     $altView = F0FInflector::isPlural($view) ? F0FInflector::singularize($view) : F0FInflector::pluralize($view);
     if (!in_array($view, $this->views) && !in_array($altView, $this->views)) {
         return true;
     }
     $masterHash = $params->getValue('masterpassword', '');
     if (!empty($masterHash)) {
         $masterHash = md5($masterHash);
         // Compare the master pw with the one the user entered
         $session = JFactory::getSession();
         $userHash = $session->get('userpwhash', '', 'admintools');
         if ($userHash != $masterHash) {
             // The login is invalid. If the view is locked I'll have to kick the user out.
             $lockedviews_raw = $params->getValue('lockedviews', '');
             if (!empty($lockedviews_raw)) {
                 $lockedViews = explode(",", $lockedviews_raw);
                 if (in_array($view, $lockedViews) || in_array($altView, $lockedViews)) {
                     return false;
                 }
             }
         }
     }
     return true;
 }
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:41,代码来源:masterpw.php


示例5: noop

 public function noop()
 {
     if ($customURL = $this->input->getString('returnurl', '')) {
         $customURL = base64_decode($customURL);
     }
     $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . F0FInflector::pluralize($this->view);
     $this->setRedirect($url);
 }
开发者ID:ZoiaoDePeixe,项目名称:akeebasubs,代码行数:8,代码来源:subscriptions.php


示例6: onBeforeDispatch

 public function onBeforeDispatch()
 {
     $result = parent::onBeforeDispatch();
     if ($result) {
         // Clear com_modules and com_plugins cache (needed when we alter module/plugin state)
         $core_components = array('com_modules', 'com_plugins');
         foreach ($core_components as $component) {
             try {
                 $cache = JFactory::getCache($component);
                 $cache->clean();
             } catch (Exception $e) {
                 // suck it up
             }
         }
         // Merge the language overrides
         $paths = array(JPATH_ROOT, JPATH_ADMINISTRATOR);
         $jlang = JFactory::getLanguage();
         $jlang->load($this->component, $paths[0], 'en-GB', true);
         $jlang->load($this->component, $paths[0], null, true);
         $jlang->load($this->component, $paths[1], 'en-GB', true);
         $jlang->load($this->component, $paths[1], null, true);
         $jlang->load($this->component . '.override', $paths[0], 'en-GB', true);
         $jlang->load($this->component . '.override', $paths[0], null, true);
         $jlang->load($this->component . '.override', $paths[1], 'en-GB', true);
         $jlang->load($this->component . '.override', $paths[1], null, true);
         // Load Akeeba Strapper
         if (!defined('ADMINTOOLSMEDIATAG')) {
             $staticFilesVersioningTag = md5(ADMINTOOLS_VERSION . ADMINTOOLS_DATE);
             define('ADMINTOOLSMEDIATAG', $staticFilesVersioningTag);
         }
         include_once JPATH_ROOT . '/media/akeeba_strapper/strapper.php';
         AkeebaStrapper::$tag = ADMINTOOLSMEDIATAG;
         AkeebaStrapper::bootstrap();
         AkeebaStrapper::jQueryUI();
         AkeebaStrapper::addCSSfile('admin://components/com_admintools/media/css/backend.css');
         // Work around non-transparent proxy and reverse proxy IP issues
         if (class_exists('F0FUtilsIp', true)) {
             F0FUtilsIp::workaroundIPIssues();
         }
         // Control Check
         $view = F0FInflector::singularize($this->input->getCmd('view', $this->defaultView));
         if ($view == 'liveupdate') {
             $url = JUri::base() . 'index.php?option=com_admintools';
             JFactory::getApplication()->redirect($url);
             return;
         }
         // ========== Master PW check ==========
         /** @var AdmintoolsModelMasterpw $model */
         $model = F0FModel::getAnInstance('Masterpw', 'AdmintoolsModel');
         if (!$model->accessAllowed($view)) {
             $url = $view == 'cpanel' ? 'index.php' : 'index.php?option=com_admintools&view=cpanel';
             JFactory::getApplication()->redirect($url, JText::_('ATOOLS_ERR_NOTAUTHORIZED'), 'error');
             return;
         }
     }
     return $result;
 }
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:57,代码来源:dispatcher.php


示例7: onBeforeUnpublish

 public function onBeforeUnpublish()
 {
     $customURL = $this->input->getString('returnurl', '');
     if (!$customURL) {
         $scan_id = $this->input->getCmd('scan_id', 0);
         $url = 'index.php?option=' . $this->component . '&view=' . F0FInflector::pluralize($this->view) . '&scan_id=' . $scan_id;
         $this->input->set('returnurl', base64_encode($url));
     }
     return $this->checkACL('admintools.security');
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:10,代码来源:scanalert.php


示例8: getOptions

 /**
  * Method to get the field options.
  *
  * @return  array  The field 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'];
     $applyAccess = $this->element['apply_access'] ? (string) $this->element['apply_access'] : 'false';
     $modelName = (string) $this->element['model'];
     $nonePlaceholder = (string) $this->element['none'];
     $translate = empty($this->element['translate']) ? 'true' : (string) $this->element['translate'];
     $translate = in_array(strtolower($translate), array('true', 'yes', '1', 'on')) ? true : false;
     if (!empty($nonePlaceholder)) {
         $options[] = JHtml::_('select.option', null, JText::_($nonePlaceholder));
     }
     // Process field atrtibutes
     $applyAccess = strtolower($applyAccess);
     $applyAccess = in_array($applyAccess, array('yes', 'on', 'true', '1'));
     // Explode model name into model name and prefix
     $parts = F0FInflector::explode($modelName);
     $mName = ucfirst(array_pop($parts));
     $mPrefix = F0FInflector::implode($parts);
     // Get the model object
     $config = array('savestate' => 0);
     $model = F0FModel::getTmpInstance($mName, $mPrefix, $config);
     if ($applyAccess) {
         $model->applyAccessFiltering();
     }
     // Process state variables
     foreach ($this->element->children() as $stateoption) {
         // Only add <option /> elements.
         if ($stateoption->getName() != 'state') {
             continue;
         }
         $stateKey = (string) $stateoption['key'];
         $stateValue = (string) $stateoption;
         $model->setState($stateKey, $stateValue);
     }
     // Set the query and get the result list.
     $items = $model->getItemList(true);
     // 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:lyrasoft,项目名称:lyrasoft.github.io,代码行数:58,代码来源:model.php


示例9: onAfterStore

 /**
  * Save fields for many-to-many relations in their pivot tables.
  *
  * @param F0FTable $table Current item table.
  *
  * @return bool True if the object can be saved successfully, false elsewhere.
  * @throws Exception The error message get trying to save fields into the pivot tables.
  */
 public function onAfterStore(&$table)
 {
     // Retrieve the relations configured for this table
     $input = new F0FInput();
     $key = $table->getConfigProviderKey() . '.relations';
     $relations = $table->getConfigProvider()->get($key, array());
     // Abandon the process if not a save task
     if (!in_array($input->getWord('task'), array('apply', 'save', 'savenew'))) {
         return true;
     }
     // For each relation check relative field
     foreach ($relations as $relation) {
         // Only if it is a multiple relation, sure!
         if ($relation['type'] == 'multiple') {
             // Retrive the fully qualified relation data from F0FTableRelations object
             $relation = array_merge(array('itemName' => $relation['itemName']), $table->getRelations()->getRelation($relation['itemName'], $relation['type']));
             // Deduce the name of the field used in the form
             $field_name = F0FInflector::pluralize($relation['itemName']);
             // If field exists we catch its values!
             $field_values = $input->get($field_name, array(), 'array');
             // If the field exists, build the correct pivot couple objects
             $new_couples = array();
             foreach ($field_values as $value) {
                 $new_couples[] = array($relation['ourPivotKey'] => $table->getId(), $relation['theirPivotKey'] => $value);
             }
             // Find existent relations in the pivot table
             $query = $table->getDbo()->getQuery(true)->select($relation['ourPivotKey'] . ', ' . $relation['theirPivotKey'])->from($relation['pivotTable'])->where($relation['ourPivotKey'] . ' = ' . $table->getId());
             $existent_couples = $table->getDbo()->setQuery($query)->loadAssocList();
             // Find new couples and create its
             foreach ($new_couples as $couple) {
                 if (!in_array($couple, $existent_couples)) {
                     $query = $table->getDbo()->getQuery(true)->insert($relation['pivotTable'])->columns($relation['ourPivotKey'] . ', ' . $relation['theirPivotKey'])->values($couple[$relation['ourPivotKey']] . ', ' . $couple[$relation['theirPivotKey']]);
                     // Use database to create the new record
                     if (!$table->getDbo()->setQuery($query)->execute()) {
                         throw new Exception('Can\'t create the relation for the ' . $relation['pivotTable'] . ' table');
                     }
                 }
             }
             // Now find the couples no more present, that will be deleted
             foreach ($existent_couples as $couple) {
                 if (!in_array($couple, $new_couples)) {
                     $query = $table->getDbo()->getQuery(true)->delete($relation['pivotTable'])->where($relation['ourPivotKey'] . ' = ' . $couple[$relation['ourPivotKey']])->where($relation['theirPivotKey'] . ' = ' . $couple[$relation['theirPivotKey']]);
                     // Use database to create the new record
                     if (!$table->getDbo()->setQuery($query)->execute()) {
                         throw new Exception('Can\'t delete the relation for the ' . $relation['pivotTable'] . ' table');
                     }
                 }
             }
         }
     }
     return true;
 }
开发者ID:fede91it,项目名称:fof-nnrelation,代码行数:60,代码来源:nnrelation.php


示例10: __construct

 /**
  * Create a custom field object instance
  *
  * @param   array                       $config  Custom configuration parameters
  */
 public function __construct(array $config = array())
 {
     // Set up the field type
     if (!isset($config['field_type'])) {
         if (empty($this->fieldType)) {
             $parts = F0FInflector::explode(get_called_class());
             $type = strtolower(array_pop($parts));
             $config['field_type'] = $type;
         } else {
             $config['field_type'] = $this->fieldType;
         }
     }
     $this->fieldType = $config['field_type'];
 }
开发者ID:ZoiaoDePeixe,项目名称:akeebasubs,代码行数:19,代码来源:abstract.php


示例11: onBeforeDispatch

 public function onBeforeDispatch()
 {
     // You can't fix stupid… but you can try working around it
     if (!function_exists('json_encode') || !function_exists('json_decode')) {
         require_once JPATH_ADMINISTRATOR . '/components/' . $this->component . '/helpers/jsonlib.php';
     }
     $result = parent::onBeforeDispatch();
     if ($result) {
         // Merge the language overrides
         $paths = array(JPATH_ADMINISTRATOR, JPATH_ROOT);
         $jlang = JFactory::getLanguage();
         $jlang->load($this->component, $paths[0], 'en-GB', true);
         $jlang->load($this->component, $paths[0], null, true);
         $jlang->load($this->component, $paths[1], 'en-GB', true);
         $jlang->load($this->component, $paths[1], null, true);
         $jlang->load($this->component . '.override', $paths[0], 'en-GB', true);
         $jlang->load($this->component . '.override', $paths[0], null, true);
         $jlang->load($this->component . '.override', $paths[1], 'en-GB', true);
         $jlang->load($this->component . '.override', $paths[1], null, true);
         // Load Akeeba Strapper
         if (!defined('AKEEBASUBSMEDIATAG')) {
             $staticFilesVersioningTag = md5(AKEEBASUBS_VERSION . AKEEBASUBS_DATE);
             define('AKEEBASUBSMEDIATAG', $staticFilesVersioningTag);
         }
         include_once JPATH_ROOT . '/media/akeeba_strapper/strapper.php';
         AkeebaStrapper::$tag = AKEEBASUBSMEDIATAG;
         AkeebaStrapper::bootstrap();
         AkeebaStrapper::jQueryUI();
         AkeebaStrapper::addCSSfile('media://com_akeebasubs/css/frontend.css', AKEEBASUBS_VERSIONHASH);
         // Load helpers
         require_once JPATH_ADMINISTRATOR . '/components/com_akeebasubs/helpers/cparams.php';
         // Default to the "levels" view
         $view = $this->input->getCmd('view', $this->defaultView);
         if (empty($view) || $view == 'cpanel') {
             $view = 'levels';
         }
         // Set the view, if it's allowed
         $this->input->set('view', $view);
         if (!in_array(F0FInflector::pluralize($view), $this->allowedViews)) {
             $result = false;
         }
         // Handle the submitted form from the tax country module
         $taxCountry = JFactory::getApplication()->input->getCmd('mod_aktaxcountry_country', null);
         if (!is_null($taxCountry)) {
             JFactory::getSession()->set('country', $taxCountry, 'mod_aktaxcountry');
         }
     }
     return $result;
 }
开发者ID:ZoiaoDePeixe,项目名称:akeebasubs,代码行数:49,代码来源:dispatcher.php


示例12: dispatch

 public function dispatch()
 {
     // Look for controllers in the plugins folder
     $option = $this->input->get('option', 'com_foobar', 'cmd');
     $view = $this->input->get('view', $this->defaultView, 'cmd');
     $c = F0FInflector::singularize($view);
     $alt_path = JPATH_SITE . '/components/' . $option . '/plugins/controllers/' . $c . '.php';
     JLoader::import('joomla.filesystem.file');
     if (JFile::exists($alt_path)) {
         // The requested controller exists and there you load it...
         require_once $alt_path;
     }
     $this->input->set('view', $this->view);
     parent::dispatch();
 }
开发者ID:esorone,项目名称:efcpw,代码行数:15,代码来源:dispatcher.php


示例13: setpublic

 /**
  * Sets the visibility status of a customfields
  *
  * @param int $state 0 = not require, 1 = require
  */
 protected final function setpublic($state = 0)
 {
     $model = $this->getThisModel();
     if (!$model->getId()) {
         $model->setIDsFromRequest();
     }
     $status = $model->visible($state);
     // redirect
     if ($customURL = $this->input->getString('returnurl', '')) {
         $customURL = base64_decode($customURL);
     }
     $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . F0FInflector::pluralize($this->view);
     if (!$status) {
         $this->setRedirect($url, $model->getError(), 'error');
     } else {
         $this->setRedirect($url);
     }
     $this->redirect();
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:24,代码来源:customfields.php


示例14: import

 /**
  * import.
  *
  * @return	void
  */
 public function import()
 {
     // CSRF prevention
     if ($this->csrfProtection) {
         $this->_csrfProtection();
     }
     $cid = $this->input->get('cid', array(), 'ARRAY');
     if (empty($cid)) {
         $id = $this->input->getInt('id', 0);
         if ($id) {
             $cid = array($id);
         }
     }
     $helper = FeedLoaderHelper::getInstance();
     $helper->importFeeds($cid);
     // Redirect
     if ($customURL = $this->input->get('returnurl', '', 'string')) {
         $customURL = base64_decode($customURL);
     }
     $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . F0FInflector::pluralize($this->view);
     $this->setRedirect($url);
     ELog::showMessage('COM_AUTOTWEET_VIEW_FEEDS_IMPORT_SUCCESS', JLog::INFO);
 }
开发者ID:johngrange,项目名称:wookeyholeweb,代码行数:28,代码来源:feeds.php


示例15: dispatch

 public function dispatch()
 {
     if (!class_exists('AkeebaControllerDefault')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_akeeba/controllers/default.php';
     }
     // Merge the language overrides
     $paths = array(JPATH_ROOT, JPATH_ADMINISTRATOR);
     $jlang = JFactory::getLanguage();
     $jlang->load($this->component, $paths[0], 'en-GB', true);
     $jlang->load($this->component, $paths[0], null, true);
     $jlang->load($this->component, $paths[1], 'en-GB', true);
     $jlang->load($this->component, $paths[1], null, true);
     $jlang->load($this->component . '.override', $paths[0], 'en-GB', true);
     $jlang->load($this->component . '.override', $paths[0], null, true);
     $jlang->load($this->component . '.override', $paths[1], 'en-GB', true);
     $jlang->load($this->component . '.override', $paths[1], null, true);
     F0FInflector::addWord('alice', 'alices');
     // Timezone fix; avoids errors printed out by PHP 5.3.3+ (thanks Yannick!)
     if (function_exists('date_default_timezone_get') && function_exists('date_default_timezone_set')) {
         if (function_exists('error_reporting')) {
             $oldLevel = error_reporting(0);
         }
         $serverTimezone = @date_default_timezone_get();
         if (empty($serverTimezone) || !is_string($serverTimezone)) {
             $serverTimezone = 'UTC';
         }
         if (function_exists('error_reporting')) {
             error_reporting($oldLevel);
         }
         @date_default_timezone_set($serverTimezone);
     }
     // Necessary defines for Akeeba Engine
     if (!defined('AKEEBAENGINE')) {
         define('AKEEBAENGINE', 1);
         // Required for accessing Akeeba Engine's factory class
         define('AKEEBAROOT', dirname(__FILE__) . '/akeeba');
         define('ALICEROOT', dirname(__FILE__) . '/alice');
     }
     // Setup Akeeba's ACLs, honoring laxed permissions in component's parameters, if set
     // Access check, Joomla! 1.6 style.
     $user = JFactory::getUser();
     if (!$user->authorise('core.manage', 'com_akeeba')) {
         return JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
     }
     // Make sure we have a profile set throughout the component's lifetime
     $session = JFactory::getSession();
     $profile_id = $session->get('profile', null, 'akeeba');
     if (is_null($profile_id)) {
         // No profile is set in the session; use default profile
         $session->set('profile', 1, 'akeeba');
     }
     // Load the factory
     require_once JPATH_COMPONENT_ADMINISTRATOR . '/akeeba/factory.php';
     @(include_once JPATH_COMPONENT_ADMINISTRATOR . '/alice/factory.php');
     // Load the Akeeba Backup configuration and check user access permission
     $aeconfig = AEFactory::getConfiguration();
     AEPlatform::getInstance()->load_configuration();
     $jDbo = JFactory::getDbo();
     if ($jDbo->name == 'pdomysql') {
         // Prevents the "SQLSTATE[HY000]: General error: 2014" due to resource sharing with Akeeba Engine
         @JFactory::getDbo()->disconnect();
     }
     unset($aeconfig);
     // Preload helpers
     require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/includes.php';
     require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/escape.php';
     // Load the utils helper library
     AEPlatform::getInstance()->load_version_defines();
     // Create a versioning tag for our static files
     $staticFilesVersioningTag = md5(AKEEBA_VERSION . AKEEBA_DATE);
     define('AKEEBAMEDIATAG', $staticFilesVersioningTag);
     // If JSON functions don't exist, load our compatibility layer
     if (!function_exists('json_encode') || !function_exists('json_decode')) {
         require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/jsonlib.php';
     }
     // Look for controllers in the plugins folder
     $option = $this->input->get('option', 'com_foobar', 'cmd');
     $view = $this->input->get('view', $this->defaultView, 'cmd');
     $c = F0FInflector::singularize($view);
     $alt_path = JPATH_ADMINISTRATOR . '/components/' . $option . '/plugins/controllers/' . $c . '.php';
     JLoader::import('joomla.filesystem.file');
     if (JFile::exists($alt_path)) {
         // The requested controller exists and there you load it...
         require_once $alt_path;
     }
     $this->input->set('view', $this->view);
     parent::dispatch();
 }
开发者ID:WineWorld,项目名称:joomlatrialcmbg,代码行数:88,代码来源:dispatcher.php


示例16: dispatch

 public function dispatch()
 {
     if (!class_exists('AkeebaControllerDefault')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_akeeba/controllers/default.php';
     }
     // Merge the language overrides
     $paths = array(JPATH_ROOT, JPATH_ADMINISTRATOR);
     $jlang = JFactory::getLanguage();
     $jlang->load($this->component, $paths[0], 'en-GB', true);
     $jlang->load($this->component, $paths[0], null, true);
     $jlang->load($this->component, $paths[1], 'en-GB', true);
     $jlang->load($this->component, $paths[1], null, true);
     $jlang->load($this->component . '.override', $paths[0], 'en-GB', true);
     $jlang->load($this->component . '.override', $paths[0], null, true);
     $jlang->load($this->component . '.override', $paths[1], 'en-GB', true);
     $jlang->load($this->component . '.override', $paths[1], null, true);
     F0FInflector::addWord('alice', 'alices');
     // Timezone fix; avoids errors printed out by PHP 5.3.3+ (thanks Yannick!)
     if (function_exists('date_default_timezone_get') && function_exists('date_default_timezone_set')) {
         if (function_exists('error_reporting')) {
             $oldLevel = error_reporting(0);
         }
         $serverTimezone = @date_default_timezone_get();
         if (empty($serverTimezone) || !is_string($serverTimezone)) {
             $serverTimezone = 'UTC';
         }
         if (function_exists('error_reporting')) {
             error_reporting($oldLevel);
         }
         @date_default_timezone_set($serverTimezone);
     }
     // Necessary defines for Akeeba Engine
     if (!defined('AKEEBAENGINE')) {
         define('AKEEBAENGINE', 1);
         // Required for accessing Akeeba Engine's factory class
         define('AKEEBAROOT', dirname(__FILE__) . '/akeeba');
         define('ALICEROOT', dirname(__FILE__) . '/alice');
     }
     // Setup Akeeba's ACLs, honoring laxed permissions in component's parameters, if set
     // Access check, Joomla! 1.6 style.
     $user = JFactory::getUser();
     if (!$user->authorise('core.manage', 'com_akeeba')) {
         return JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
     }
     // Make sure we have a profile set throughout the component's lifetime
     $session = JFactory::getSession();
     $profile_id = $session->get('profile', null, 'akeeba');
     if (is_null($profile_id)) {
         // No profile is set in the session; use default profile
         $session->set('profile', 1, 'akeeba');
     }
     // Load Akeeba Engine and ALICE
     require_once JPATH_COMPONENT_ADMINISTRATOR . '/engine/Factory.php';
     if (@file_exists(JPATH_COMPONENT_ADMINISTRATOR . '/alice/factory.php')) {
         require_once JPATH_COMPONENT_ADMINISTRATOR . '/alice/factory.php';
     }
     // Load the Akeeba Engine configuration
     Platform::addPlatform('joomla25', JPATH_COMPONENT_ADMINISTRATOR . '/platform/joomla25');
     $akeebaEngineConfig = Factory::getConfiguration();
     Platform::getInstance()->load_configuration();
     $jDbo = JFactory::getDbo();
     if ($jDbo->name == 'pdomysql') {
         // Prevents the "SQLSTATE[HY000]: General error: 2014" due to resource sharing with Akeeba Engine
         @JFactory::getDbo()->disconnect();
     }
     unset($akeebaEngineConfig);
     // Preload helpers
     require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/escape.php';
     // Load the utils helper library
     Platform::getInstance()->load_version_defines();
     // Create a versioning tag for our static files
     $staticFilesVersioningTag = md5(AKEEBA_VERSION . AKEEBA_DATE);
     define('AKEEBAMEDIATAG', $staticFilesVersioningTag);
     $this->input->set('view', $this->view);
     // Load JHtml behaviours as needed
     $this->loadJHtmlBehaviors();
     parent::dispatch();
 }
开发者ID:esorone,项目名称:efcpw,代码行数:78,代码来源:dispatcher.php


示例17:

		if(size > 0){
			console.log(size);
			jQuery('#product-filter-group-clear-<?php 
        echo F0FInflector::underscore($filtergroup['group_name']);
        ?>
').show();
			jQuery('#j2store-pf-filter-<?php 
        echo F0FInflector::underscore($filtergroup['group_name']);
        ?>
').show();
			jQuery('#pf-filter-icon-plus-<?php 
        echo F0FInflector::underscore($filtergroup['group_name']);
        ?>
').hide();
			jQuery('#pf-filter-icon-minus-<?php 
        echo F0FInflector::underscore($filtergroup['group_name']);
        ?>
').show();
		}
	<?php 
    }
    ?>
	<?php 
}
?>
});
</script>
<?php 
if ($this->params->get('list_show_filter_price', 0) && isset($this->filters['pricefilters']) && count($this->filters['pricefilters'])) {
    ?>
<script type="text/javascript">
开发者ID:afend,项目名称:RULug,代码行数:31,代码来源:default_filters.php


示例18: renderFormBrowse

    /**
     * Renders a F0FForm for a Browse view and returns the corresponding HTML
     *
     * @param   F0FForm   &$form  The form to render
     * @param   F0FModel  $model  The model providing our data
     * @param   F0FInput  $input  The input object
     *
     * @return  string    The HTML rendering of the form
     */
    protected function renderFormBrowse(F0FForm &$form, F0FModel $model, F0FInput $input)
    {
        $html = '';
        JHtml::_('behavior.multiselect');
        // Joomla! 3.0+ support
        if (version_compare(JVERSION, '3.0', 'ge')) {
            JHtml::_('bootstrap.tooltip');
            JHtml::_('dropdown.init');
            JHtml::_('formbehavior.chosen', 'select');
            $view = $form->getView();
            $order = $view->escape($view->getLists()->order);
            $html .= <<<HTML
<script type="text/javascript">
\tJoomla.orderTable = function() {
\t\ttable = document.getElementById("sortTable");
\t\tdirection = document.getElementById("directionTable");
\t\torder = table.options[table.selectedIndex].value;
\t\tif (order != '{$order}')
\t\t{
\t\t\tdirn = 'asc';
\t\t}
\t\telse {
\t\t\tdirn = direction.options[direction.selectedIndex].value;
\t\t}
\t\tJoomla.tableOrdering(order, dirn);
\t};
</script>

HTML;
        } else {
            JHtml::_('behavior.tooltip');
        }
        // Getting all header row elements
        $headerFields = $form->getHeaderset();
        // Get form parameters
        $show_header = $form->getAttribute('show_header', 1);
        $show_filters = $form->getAttribute('show_filters', 1);
        $show_pagination = $form->getAttribute('show_pagination', 1);
        $norows_placeholder = $form->getAttribute('norows_placeholder', '');
        // Joomla! 3.0 sidebar support
        if (version_compare(JVERSION, '3.0', 'gt')) {
            $form_class = '';
            if ($show_filters) {
                JHtmlSidebar::setAction("index.php?option=" . $input->getCmd('option') . "&view=" . F0FInflector::pluralize($input->getCmd('view')));
            }
            // Reorder the fields with ordering first
            $tmpFields = array();
            $i = 1;
            foreach ($headerFields as $tmpField) {
                if ($tmpField instanceof F0FFormHeaderOrdering) {
                    $tmpFields[0] = $tmpField;
                } else {
                    $tmpFields[$i] = $tmpField;
                }
                $i++;
            }
            $headerFields = $tmpFields;
            ksort($headerFields, SORT_NUMERIC);
        } else {
            $form_class = 'class="form-horizontal"';
        }
        // Pre-render the header and filter rows
        $header_html = '';
        $filter_html = '';
        $sortFields = array();
        if ($show_header || $show_filters) {
            foreach ($headerFields as $headerField) {
                $header = $headerField->header;
                $filter = $headerField->filter;
                $buttons = $headerField->buttons;
                $options = $headerField->options;
                $sortable = $headerField->sortable;
                $tdwidth = $headerField->tdwidth;
                // Under Joomla! < 3.0 we can't have filter-only fields
                if (version_compare(JVERSION, '3.0', 'lt') && empty($header)) {
                    continue;
                }
                // If it's a sortable field, add to the list of sortable fields
                if ($sortable) {
                    $sortFields[$headerField->name] = JText::_($headerField->label);
                }
                // Get the table data width, if set
                if (!empty($tdwidth)) {
                    $tdwidth = 'width="' . $tdwidth . '"';
                } else {
                    $tdwidth = '';
                }
                if (!empty($header)) {
                    $header_html .= "\t\t\t\t\t<th {$tdwidth}>" . PHP_EOL;
                    $header_html .= "\t\t\t\t\t\t" . $header;
                    $header_html .= "\t\t\t\t\t</th>" . PHP_EOL;
//.........这里部分代码省略.........
开发者ID:chaudhary4k4,项目名称:modernstore,代码行数:101,代码来源:strapper.php


示例19: findFormFilename

 /**
  * Guesses the best candidate for the path to use for a particular form.
  *
  * @param   string  $source  The name of the form file to load, without the .xml extension.
  * @param   array   $paths   The paths to look into. You can declare this to override the default F0F paths.
  *
  * @return  mixed  A string if the path and filename of the form to load is found, false otherwise.
  *
  * @since   2.0
  */
 public function findFormFilename($source, $paths = array())
 {
     // TODO Should we read from internal variables instead of the input? With a temp instance we have no input
     $option = $this->input->getCmd('option', 'com_foobar');
     $view = $this->name;
     $componentPaths = F0FPlatform::getInstance()->getComponentBaseDirs($option);
     $file_root = $componentPaths['main'];
     $alt_file_root = $componentPaths['alt'];
     $template_root = F0FPlatform::getInstance()->getTemplateOverridePath($option);
     if (empty($paths)) {
         // Set up the paths to look into
         // PLEASE NOTE: If you ever change this, please update Model Unit tests, too, since we have to
         // copy these default folders (we have to add the protocol for the virtual filesystem)
         $paths = array($template_root . '/' . $view, $template_root . '/' . F0FInflector::singularize($view), $template_root . '/' . F0FInflector::pluralize($view), $file_root . '/views/' . $view . '/tmpl', $file_root . '/views/' . F0FInflector::singularize($view) . '/tmpl', $file_root . '/views/' . F0FInflector::pluralize($view) . '/tmpl', $alt_file_root . '/views/' . $view . '/tmpl', $alt_file_root . '/views/' . F0FInflector::singularize($view) . '/tmpl', $alt_file_root . '/views/' . F0FInflector::pluralize($view) . '/tmpl', $file_root . '/models/forms', $alt_file_root . '/models/forms');
     }
     $paths = array_unique($paths);
     // Set up the suffixes to look into
     $suffixes = array();
     $temp_suffixes = F0FPlatform::getInstance()->getTemplateSuffixes();
     if (!empty($temp_suffixes)) {
         foreach ($temp_suffixes as $suffix) {
             $suffixes[] = $suffix . '.xml';
         }
     }
     $suffixes[] = '.xml';
     // Look for all suffixes in all paths
     $result = false;
     $filesystem = F0FPlatform::getInstance()->getIntegrationObject('filesystem');
     foreach ($paths as $path) {
         foreach ($suffixes as $suffix) {
             $filename = $path . '/' . $source . $suffix;
             if ($filesystem->fileExists($filename)) {
                 $result = $filename;
                 break;
             }
         }
         if ($result) {
             break;
         }
     }
     return $result;
 }
开发者ID:01J,项目名称:topm,代码行数:52,代码来源:model.php


示例20: getOptions

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP F0FModel类代码示例发布时间:2022-05-23
下一篇:
PHP F0FController类代码示例发布时间: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