示例#1
0
文件: route.php 项目: A-Bush/pprod
 /**
  * Clean the cache.
  * It also cleans the simplecustomrouter plugin cache, as the routes
  * configured by this component are used by that plugin.
  * 
  * This method is called when needed from parent models.
  * 
  * @param string $group The cache group
  * @param string $client_id The ID of the client
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     $conf = JFactory::getConfig();
     $options = array('defaultgroup' => 'simplecustomrouter', 'cachebase' => $conf->get('cache_path', JPATH_SITE . '/cache'));
     $cache = JCache::getInstance('', $options)->clean();
     parent::cleanCache($group, $client_id);
 }
示例#2
0
 /**
  * Custom clean the cache of com_knvbapi and knvbapi modules
  *
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     parent::cleanCache('com_knvbapi');
     parent::cleanCache('mod_knvbapi');
     parent::cleanCache('mod_knvbapi_competities');
 }
示例#3
0
 /**
  * Custom clean cache method for different clients
  *
  * @param   string   $group      The name of the plugin group to import (defaults to null).
  * @param   integer  $client_id  The client ID. [optional]
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     parent::cleanCache('com_modules', $this->getClient());
 }
示例#4
0
 /**
  * Custom clean cache method
  *
  * @since	1.6
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     parent::cleanCache('_system');
     parent::cleanCache('com_languages');
 }
示例#5
0
文件: item.php 项目: akksi/jcg
 /**
  * Custom clean cache method
  *
  * @since	1.6
  */
 function cleanCache()
 {
     parent::cleanCache('com_modules');
     parent::cleanCache('mod_menu');
 }
示例#6
0
 /**
  * Custom clean the cache of com_content and content modules
  *
  * @param   string   $group      The cache group
  * @param   integer  $client_id  The ID of the client
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     parent::cleanCache('com_content');
     parent::cleanCache('mod_articles_archive');
     parent::cleanCache('mod_articles_categories');
     parent::cleanCache('mod_articles_category');
     parent::cleanCache('mod_articles_latest');
     parent::cleanCache('mod_articles_news');
     parent::cleanCache('mod_articles_popular');
 }
示例#7
0
 /**
  * Custom clean cache method
  *
  * @since	1.6
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     parent::cleanCache('com_modules');
     parent::cleanCache('mod_menu');
 }
示例#8
0
 /**
  * Custom clean cache method
  *
  * @since	1.6
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     parent::cleanCache('com_templates');
     parent::cleanCache('_system');
     Event::trigger('system.onCleanCache', array($group, $client_id));
 }
示例#9
0
 /**
  * Custom clean the cache of com_content and content modules
  *
  * @since	1.6
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     $extension = JFactory::getApplication()->input->getCmd('extension');
     switch ($extension) {
         case 'com_tz_portfolio_plus':
             parent::cleanCache('com_tz_portfolio_plus');
             parent::cleanCache('mod_tz_portfolio_plus_articles');
             parent::cleanCache('mod_tz_portfolio_plus_articles_archive');
             parent::cleanCache('mod_tz_portfolio_plus_categories');
             parent::cleanCache('mod_tz_portfolio_plus_tags');
             break;
         default:
             parent::cleanCache($extension);
             break;
     }
 }
示例#10
0
文件: style.php 项目: akksi/jcg
 /**
  * Custom clean cache method
  *
  * @since	1.6
  */
 function cleanCache()
 {
     parent::cleanCache('com_templates');
     parent::cleanCache('_system');
 }
示例#11
0
 /**
  * Method to save the form data.
  *
  * @param   array  $data  The form data.
  *
  * @return  boolean  True on success, False on error.
  */
 public function save($data)
 {
     parent::cleanCache('com_fabrik');
     return parent::save($data);
 }
示例#12
0
 /**
  * Custom clean the cache of com_componentarchitect and componentarchitect modules
  *
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     parent::cleanCache('com_componentarchitect');
 }
示例#13
0
 /**
  * Custom clean the cache of com_places and places modules
  *
  * @param   string   $group      The cache group
  * @param   integer  $client_id  The ID of the client
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     parent::cleanCache('com_places');
     parent::cleanCache('mod_towns_archive');
 }
示例#14
0
 /**
  * Custom clean the cache of com_projectfork and projectfork modules
  *
  */
 protected function cleanCache($group = 'com_pfrepo', $client_id = 0)
 {
     parent::cleanCache($group);
 }
示例#15
0
 protected function cleanCache($group = null, $client_id = 0)
 {
     parent::cleanCache('com_tz_portfolio_plus', 0);
     parent::cleanCache('com_tz_portfolio_plus', 1);
 }
示例#16
0
 /**
  * Custom clean cache method.
  *
  * @param   string   $group      The component name. [optional]
  * @param   integer  $client_id  The client ID. [optional]
  *
  * @return  void
  *
  * @since   2.5
  */
 protected function cleanCache($group = 'com_finder', $client_id = 1)
 {
     parent::cleanCache($group, $client_id);
 }
示例#17
0
 /**
  * Custom clean cache method, plugins are cached in 2 places for different clients
  *
  * @since	1.6
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     parent::cleanCache('com_plugins', 0);
     parent::cleanCache('com_plugins', 1);
 }
示例#18
0
 /**
  * Clean the cache
  *
  * @access	protected
  * @param	string	$group	The cache group.
  * @param	integer	$client_id	The ID of the client.
  * @return	void
  *
  * @since	12.2
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     parent::cleanCache($group, $client_id);
     $pk = $this->getState($this->getName() . '.id');
     //Clean current item cache (Called when save succeed)
     $this->_item[$pk] = null;
 }
示例#19
0
 /**
  * Custom clean the cache of com_projectfork and projectfork modules
  *
  */
 protected function cleanCache($group = 'com_pfforum', $client = 0)
 {
     parent::cleanCache($group);
 }
示例#20
0
 /**
  * Custom clean the cache of com_projectfork and projectfork modules
  *
  */
 protected function cleanCache($group = 'com_projectfork', $client = 0)
 {
     parent::cleanCache($group);
 }
示例#21
0
 /**
  * Custom clean the cache of com_content and content modules
  *
  * @since	1.6
  */
 protected function cleanCache()
 {
     $extension = JRequest::getCmd('extension');
     switch ($extension) {
         case 'com_content':
             parent::cleanCache('com_content');
             parent::cleanCache('mod_articles_archive');
             parent::cleanCache('mod_articles_categories');
             parent::cleanCache('mod_articles_category');
             parent::cleanCache('mod_articles_latest');
             parent::cleanCache('mod_articles_news');
             parent::cleanCache('mod_articles_popular');
             break;
         default:
             parent::cleanCache($extension);
             break;
     }
 }
示例#22
0
文件: plugin.php 项目: akksi/jcg
 /**
  * Custom clean cache method, plugins are cached in 2 places for different clients
  *
  * @since	1.6
  */
 function cleanCache()
 {
     parent::cleanCache('com_plugins', 0);
     parent::cleanCache('com_plugins', 1);
 }
示例#23
0
 /**
  * Custom clean the cache of com_projectfork and projectfork modules
  *
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     parent::cleanCache('com_pftasks');
 }
示例#24
0
 /**
  * Custom clean cache method for different clients
  *
  * @since	1.6
  */
 function cleanCache()
 {
     parent::cleanCache('com_modules', $this->getClient());
 }
示例#25
0
 /**
  * Custom clean cache method
  *
  * @since	1.6
  */
 function cleanCache()
 {
     parent::cleanCache('_system', 0);
     parent::cleanCache('_system', 1);
     parent::cleanCache('com_languages', 0);
     parent::cleanCache('com_languages', 1);
 }
示例#26
0
 /**
  * Custom clean the cache of com_content and content modules
  *
  * @since	1.6
  */
 protected function cleanCache($group = NULL, $client_id = -1)
 {
     if ($client_id == -1) {
         // -1 means both
         parent::cleanCache($group = 'com_flexicontent', 0);
         parent::cleanCache($group = 'com_flexicontent_cats', 0);
         parent::cleanCache($group = 'com_flexicontent', 1);
         parent::cleanCache($group = 'com_flexicontent_cats', 1);
     } else {
         parent::cleanCache($group = 'com_flexicontent', $client_id);
         parent::cleanCache($group = 'com_flexicontent_cats', $client_id);
     }
 }
示例#27
0
 /**
  * Custom clean the cache of com_content and content modules
  *
  * @param   string   $group      Cache group name.
  * @param   integer  $client_id  Application client id.
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     $extension = JFactory::getApplication()->input->get('extension');
     switch ($extension) {
         case 'com_content':
             parent::cleanCache('com_content');
             parent::cleanCache('mod_articles_archive');
             parent::cleanCache('mod_articles_categories');
             parent::cleanCache('mod_articles_category');
             parent::cleanCache('mod_articles_latest');
             parent::cleanCache('mod_articles_news');
             parent::cleanCache('mod_articles_popular');
             break;
         default:
             parent::cleanCache($extension);
             break;
     }
 }
示例#28
0
 /**
  * Method to save the form data.
  *
  * @param   array  $data  The form data.
  *
  * @return  boolean  True on success, False on error.
  */
 public function save($data)
 {
     jimport('joomla.utilities.date');
     $user = JFactory::getUser();
     $app = JFactory::getApplication();
     $new = $data['id'] == 0 ? true : false;
     $params = $data['params'];
     $data['name'] = FabrikString::iclean($data['name']);
     $name = $data['name'];
     $params['validations'] = JArrayHelper::getValue($data, 'validationrule', array());
     $elementModel = $this->getElementPluginModel($data);
     $elementModel->getElement()->bind($data);
     $row = $elementModel->getElement();
     if ($new) {
         // Have to forcefully set group id otherwise listmodel id is blank
         $elementModel->getElement()->group_id = $data['group_id'];
     }
     $listModel = $elementModel->getListModel();
     $item = $listModel->getTable();
     // Are we updating the name of the primary key element?
     if ($row->name === FabrikString::shortColName($item->db_primary_key)) {
         if ($name !== $row->name) {
             // Yes we are so update the table
             $item->db_primary_key = str_replace($row->name, $name, $item->db_primary_key);
             $item->store();
         }
     }
     $jsons = array('sub_values', 'sub_labels', 'sub_initial_selection');
     foreach ($jsons as $json) {
         if (array_key_exists($json, $data)) {
             $data[$json] = json_encode($data[$json]);
         }
     }
     // Only update the element name if we can alter existing columns, otherwise the name and field name become out of sync
     $data['name'] = $listModel->canAlterFields() || $new || $listModel->noTable() ? $name : JRequest::getVar('name_orig', '', 'post', 'cmd');
     $ar = array('published', 'use_in_page_title', 'show_in_list_summary', 'link_to_detail', 'can_order', 'filter_exact_match');
     foreach ($ar as $a) {
         if (!array_key_exists($a, $data)) {
             $data[$a] = 0;
         }
     }
     /**
      * $$$ rob - test for change in element type
      * (eg if changing from db join to field we need to remove the join
      * entry from the #__{package}_joins table
      */
     $elementModel->beforeSave($row);
     // Unlink linked elements
     if (JRequest::getVar('unlink') == 'on') {
         $data['parent_id'] = 0;
     }
     $datenow = new JDate();
     if ($row->id != 0) {
         $data['modified'] = $datenow->toSql();
         $data['modified_by'] = $user->get('id');
     } else {
         $data['created'] = $datenow->toSql();
         $data['created_by'] = $user->get('id');
         $data['created_by_alias'] = $user->get('username');
     }
     /**
      * $$$ hugh
      * This insane chunk of code is needed because the validation rule params are not in sequential,
      * completely indexed arrays.  What we have is single item arrays, with specific numeric
      * keys, like foo-something[0], bar-otherthing[2], etc.  And if you json_encode an array with incomplete
      * or out of sequence numeric indexes, it encodes it as an object instead of an array.  Which means the first
      * validation plugin will encode as an array, as it's params are single [0] index, and the rest as objects.
      * This foobars things, as we then don't know if validation params are arrays or objects!
      *
      * One option would be to modify every validation, and test every param we use, and if necessary convert it,
      * but that would be a major pain in the ass.
      *
      * So ... we need to fill in the blanks in the arrays, and ksort them.  But, we need to know the param names
      * for each validation.  But as they are just stuck in with the rest of the element params, there is no easy
      * way of knowing which are validation params and which are element params.
      *
      * So ... we need to load the validation objects, then load the XML file for each one, and iterate through
      * the fieldsets!  Well, that's the only way I could come up with doing it.  Hopefully Rob can come up with
      * a quicker and simpler way of doing this!
      */
     $num_validations = count($params['validations']['plugin']);
     $validation_plugins = $this->getValidations($elementModel, $params['validations']['plugin']);
     foreach ($validation_plugins as $plugin) {
         $plugin_form = $plugin->getJForm();
         JForm::addFormPath(JPATH_SITE . '/plugins/fabrik_validationrule/' . $plugin->_pluginName);
         $xmlFile = JPATH_SITE . '/plugins/fabrik_validationrule/' . $plugin->_pluginName . '/forms/fields.xml';
         $xml = $plugin->jform->loadFile($xmlFile, false);
         foreach ($plugin_form->getFieldsets() as $fieldset) {
             foreach ($plugin_form->getFieldset($fieldset->name) as $field) {
                 if (isset($params[$field->fieldname])) {
                     if (is_array($params[$field->fieldname])) {
                         for ($x = 0; $x < $num_validations; $x++) {
                             if (!array_key_exists($x, $params[$field->fieldname])) {
                                 $params[$field->fieldname][$x] = '';
                             }
                         }
                         ksort($params[$field->fieldname]);
                     }
                 }
             }
         }
     }
     $data['params'] = json_encode($params);
     $row->params = $data['params'];
     $cond = 'group_id = ' . (int) $row->group_id;
     if ($new) {
         $data['ordering'] = $row->getNextOrder($cond);
     }
     $row->reorder($cond);
     /**
      * $$$ hugh - shouldn't updateChildIds() happen AFTER we save the main row?
      * Same place we do updateJavascript()?
      */
     $this->updateChildIds($row);
     $elementModel->getElement()->bind($data);
     $origName = JRequest::getVar('name_orig', '', 'post', 'cmd');
     list($update, $q, $oldName, $newdesc, $origDesc) = $listModel->shouldUpdateElement($elementModel, $origName);
     if ($update) {
         $origplugin = JRequest::getVar('plugin_orig');
         $config = JFactory::getConfig();
         $prefix = $config->get('dbprefix');
         $tablename = $listModel->getTable()->db_table_name;
         $hasprefix = strstr($tablename, $prefix) === false ? false : true;
         $tablename = str_replace($prefix, '#__', $tablename);
         if (in_array($tablename, $this->core)) {
             $app->enqueueMessage(JText::_('COM_FABRIK_WARNING_UPDATE_CORE_TABLE'), 'notice');
         } else {
             if ($hasprefix) {
                 $app->enqueueMessage(JText::_('COM_FABRIK_WARNING_UPDATE_TABLE_WITH_PREFIX'), 'notice');
             }
         }
         $app->setUserState('com_fabrik.confirmUpdate', 1);
         $app->setUserState('com_fabrik.plugin_orig', $origplugin);
         $app->setUserState('com_fabrik.q', $q);
         $app->setUserState('com_fabrik.newdesc', $newdesc);
         $app->setUserState('com_fabrik.origDesc', $origDesc);
         $app->setUserState('com_fabrik.origplugin', $origplugin);
         $app->setUserState('com_fabrik.oldname', $oldName);
         $app->setUserState('com_fabrik.newname', $data['name']);
         $app->setUserState('com_fabrik.origtask', JRequest::getCmd('task'));
         $app->setUserState('com_fabrik.plugin', $data['plugin']);
         $task = JRequest::getCmd('task');
         $url = 'index.php?option=com_fabrik&view=element&layout=confirmupdate&id=' . (int) $row->id . '&origplugin=' . $origplugin . '&origtask=' . $task . '&plugin=' . $row->plugin;
         $app->setUserState('com_fabrik.redirect', $url);
     } else {
         $app->setUserState('com_fabrik.confirmUpdate', 0);
     }
     if ((int) $listModel->getTable()->id !== 0) {
         $this->updateIndexes($elementModel, $listModel, $row);
         $listModel->updateFromElement($elementModel);
     }
     $return = parent::save($data);
     if ($return) {
         $this->updateJavascript($data);
         $elementModel->setId($this->getState($this->getName() . '.id'));
         $row->id = $elementModel->getId();
         $data->id = $row->id;
         $this->createRepeatElement($elementModel, $row);
         // If new, check if the element's db table is used by other tables and if so add the element  to each of those tables' groups
         if ($new) {
             $this->addElementToOtherDbTables($elementModel, $row);
         }
         if (!$elementModel->onSave($data)) {
             $this->setError(JText::_('COM_FABRIK_ERROR_SAVING_ELEMENT_PLUGIN_OPTIONS'));
             return false;
         }
     }
     parent::cleanCache('com_fabrik');
     return $return;
     /**
      * used for prefab
      * return $elementModel;
      */
 }
示例#29
0
 /**
  * Custom clean the cache of com_knvbapi2 and knvbapi2 modules
  *
  */
 protected function cleanCache($group = null, $client_id = 0)
 {
     parent::cleanCache('com_knvbapi2');
     parent::cleanCache('mod_knvbapi2');
     parent::cleanCache('mod_knvbapi2_teamnaams');
 }
示例#30
0
文件: album.php 项目: MrJookie/pm
 /**
  * Custom clean the cache
  *
  */
 protected function cleanCache($group = 'com_pfdesigns', $client_id = 0)
 {
     parent::cleanCache($group, $client_id);
 }