当前位置: 首页>>代码示例>>PHP>>正文


PHP FOFModel::getAnInstance方法代码示例

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


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

示例1: ajax

 public function ajax()
 {
     $act = $this->input->get('act', '', 'cmd');
     $model = FOFModel::getAnInstance('Confwiz', 'AkeebaModel');
     $model->setState('act', $act);
     $ret = $model->runAjax();
     @ob_end_clean();
     echo '###' . json_encode($ret) . '###';
     flush();
     JFactory::getApplication()->close();
 }
开发者ID:alvarovladimir,项目名称:messermeister_ab_rackservers,代码行数:11,代码来源:confwiz.php

示例2: onDisplay

 public function onDisplay($tpl = null)
 {
     $model = $this->getModel();
     $task = $model->getState('task', 'components');
     // Add submenus (those nifty text links below the toolbar!)
     $toolbar = FOFToolbar::getAnInstance($this->input->get('option', 'com_foobar', 'cmd'), $this->config);
     $link = JURI::base() . '?option=com_akeeba&view=extfilter&task=components';
     $toolbar->appendLink(JText::_('EXTFILTER_COMPONENTS'), $link, $task == 'components');
     $link = JURI::base() . '?option=com_akeeba&view=extfilter&task=modules';
     $toolbar->appendLink(JText::_('EXTFILTER_MODULES'), $link, $task == 'modules');
     $link = JURI::base() . '?option=com_akeeba&view=extfilter&task=plugins';
     $toolbar->appendLink(JText::_('EXTFILTER_PLUGINS'), $link, $task == 'plugins');
     $link = JURI::base() . '?option=com_akeeba&view=extfilter&task=languages';
     $toolbar->appendLink(JText::_('EXTFILTER_LANGUAGES'), $link, $task == 'languages');
     $link = JURI::base() . '?option=com_akeeba&view=extfilter&task=templates';
     $toolbar->appendLink(JText::_('EXTFILTER_TEMPLATES'), $link, $task == 'templates');
     switch ($task) {
         case 'components':
             // Pass along the list of components
             $this->components = $model->getComponents();
             break;
         case 'modules':
             // Pass along the list of components
             $this->modules = $model->getModules();
             break;
         case 'plugins':
             // Pass along the list of components
             $this->plugins = $model->getPlugins();
             break;
         case 'templates':
             // Pass along the list of components
             $this->templates = $model->getTemplates();
             break;
         case 'languages':
             // Pass along the list of components
             $this->languages = $model->getLanguages();
             break;
     }
     $this->setLayout($task);
     // Add live help
     AkeebaHelperIncludes::addHelp('extfilter');
     // Get profile ID
     $profileid = AEPlatform::getInstance()->get_active_profile();
     $this->profileid = $profileid;
     // Get profile name
     $pmodel = FOFModel::getAnInstance('Profiles', 'AkeebaModel');
     $pmodel->setId($profileid);
     $profile_data = $pmodel->getItem();
     $this->profilename = $profile_data->description;
     return true;
 }
开发者ID:sillysachin,项目名称:teamtogether,代码行数:51,代码来源:view.html.php

示例3: onBeforeBrowse

 public function onBeforeBrowse()
 {
     $result = parent::onBeforeBrowse();
     if ($result) {
         $params = JComponentHelper::getParams('com_akeeba');
         $model = $this->getThisModel();
         $view = $this->getThisView();
         /** @var AkeebaModelCpanels $model */
         $view->setModel($model);
         $aeconfig = AEFactory::getConfiguration();
         // Invalidate stale backups
         AECoreKettenrad::reset(array('global' => true, 'log' => false, 'maxrun' => $params->get('failure_timeout', 180)));
         // Just in case the reset() loaded a stale configuration...
         AEPlatform::getInstance()->load_configuration();
         // Let's make sure the temporary and output directories are set correctly and writable...
         $wizmodel = FOFModel::getAnInstance('Confwiz', 'AkeebaModel');
         $wizmodel->autofixDirectories();
         // Check if we need to toggle the settings encryption feature
         $model->checkSettingsEncryption();
         // Update the magic component parameters
         $model->updateMagicParameters();
         // Run the automatic database check
         $model->checkAndFixDatabase();
         // Run the automatic update site refresh
         $model->refreshUpdateSite();
         // Check the last installed version
         $versionLast = null;
         if (file_exists(JPATH_COMPONENT_ADMINISTRATOR . '/akeeba.lastversion.php')) {
             include_once JPATH_COMPONENT_ADMINISTRATOR . '/akeeba.lastversion.php';
             if (defined('AKEEBA_LASTVERSIONCHECK')) {
                 $versionLast = AKEEBA_LASTVERSIONCHECK;
             }
         }
         if (is_null($versionLast)) {
             $component = JComponentHelper::getComponent('com_akeeba');
             if (is_object($component->params) && $component->params instanceof JRegistry) {
                 $params = $component->params;
             } else {
                 $params = new JParameter($component->params);
             }
             $versionLast = $params->get('lastversion', '');
         }
         if (version_compare(AKEEBA_VERSION, $versionLast, 'ne') || empty($versionLast)) {
             $this->setRedirect('index.php?option=com_akeeba&view=postsetup');
             return true;
         }
     }
     return $result;
 }
开发者ID:sankam-nikolya,项目名称:lptt,代码行数:49,代码来源:cpanel.php

示例4: getSTWProfileID

 /**
  * Returns the numeric ID of the Site Transfer Wizard profile, or 0 if there
  * is no STW profile created yet.
  * 
  * @staticvar int $id Cached ID
  * @return int The ID of the Site Transfer Wizard profile, or 0 if it doesn't exist
  */
 public function getSTWProfileID()
 {
     static $id = -1;
     if ($id < 0) {
         $m = FOFModel::getAnInstance('Profiles', 'AkeebaModel');
         $profiles = $m->getItemList(true);
         $id = 0;
         foreach ($profiles as $profile) {
             if ($profile->description == $this->stwProfileName) {
                 $id = $profile->id;
                 break;
             }
         }
     }
     return $id;
 }
开发者ID:sillysachin,项目名称:teamtogether,代码行数:23,代码来源:stws.php

示例5: onBrowse

 public function onBrowse($tpl = null)
 {
     $media_folder = JURI::base() . '../media/com_akeeba/';
     // Get the root URI for media files
     $this->assign('mediadir', AkeebaHelperEscape::escapeJS($media_folder . 'theme/'));
     // Get a JSON representation of the available roots
     $filters = AEFactory::getFilters();
     $root_info = $filters->getInclusions('dir');
     $roots = array();
     $options = array();
     if (!empty($root_info)) {
         // Loop all dir definitions
         foreach ($root_info as $dir_definition) {
             if (is_null($dir_definition[1])) {
                 // Site root definition has a null element 1. It is always pushed on top of the stack.
                 array_unshift($roots, $dir_definition[0]);
             } else {
                 $roots[] = $dir_definition[0];
             }
             $options[] = JHTML::_('select.option', $dir_definition[0], $dir_definition[0]);
         }
     }
     $site_root = $roots[0];
     $attribs = 'onchange="akeeba_active_root_changed();"';
     $this->assign('root_select', JHTML::_('select.genericlist', $options, 'root', $attribs, 'value', 'text', $site_root, 'active_root'));
     $this->assign('roots', $roots);
     $tpl = null;
     // Get a JSON representation of the directory data
     $model = $this->getModel();
     $json = json_encode($model->get_regex_filters($site_root));
     $this->assignRef('json', $json);
     // Add live help
     AkeebaHelperIncludes::addHelp('regexfsfilter');
     // Get profile ID
     $profileid = AEPlatform::getInstance()->get_active_profile();
     $this->assign('profileid', $profileid);
     // Get profile name
     $pmodel = FOFModel::getAnInstance('Profiles', 'AkeebaModel');
     $pmodel->setId($profileid);
     $profile_data = $pmodel->getItem();
     $this->assign('profilename', $profile_data->description);
     return true;
 }
开发者ID:alvarovladimir,项目名称:messermeister_ab_rackservers,代码行数:43,代码来源:view.html.php

示例6: onBrowse

 public function onBrowse($tpl = null)
 {
     // Add live help
     AkeebaHelperIncludes::addHelp('log');
     // Get a list of log names
     $model = $this->getModel();
     $this->logs = $model->getLogList();
     $tag = $model->getState('tag');
     if (empty($tag)) {
         $tag = null;
     }
     $this->tag = $tag;
     // Get profile ID
     $profileid = AEPlatform::getInstance()->get_active_profile();
     $this->profileid = $profileid;
     // Get profile name
     $pmodel = FOFModel::getAnInstance('Profiles', 'AkeebaModel');
     $pmodel->setId($profileid);
     $profile_data = $pmodel->getItem();
     $this->profilename = $profile_data->description;
     return true;
 }
开发者ID:sankam-nikolya,项目名称:lptt,代码行数:22,代码来源:view.html.php

示例7: add

 public function add()
 {
     $mainframe = JFactory::getApplication();
     $option = $this->input->getCmd('option', 'com_tracks');
     $db = JFactory::getDBO();
     $individualid = $this->input->getInt("individualid", 0);
     $name = $this->input->get("quickadd", '', 'request', 'string');
     $srid = $this->input->getInt("subround_id", 0);
     $projectid = $mainframe->getUserState($option . "project");
     // add the new individual as their name was sent through.
     if (!$individualid) {
         $model = FOFModel::getAnInstance('Individuals', 'TracksModel');
         $name = explode(" ", $name);
         $firstname = ucfirst(array_shift($name));
         $lastname = ucfirst(implode(" ", $name));
         $data = array("first_name" => $firstname, "last_name" => $lastname);
         $res = $model->save($data);
         if (!$res) {
             $msg = Jtext::_('COM_TRACKS_Error_adding_individual') . ': ' . $model->getError();
             $this->setRedirect("index.php?option=com_tracks&view=subroundresults&subround_id=" . $srid, $msg, 'error');
         }
         $individualid = $model->getId();
     }
     // check if indivual belongs to project
     $query = ' SELECT individual_id FROM #__tracks_projects_individuals ' . ' WHERE project_id = ' . $db->Quote($projectid) . '   AND individual_id = ' . $db->Quote($individualid);
     $db->setQuery($query);
     $res = $db->loadResult();
     if (!$res) {
         $db->setQuery("INSERT INTO #__tracks_projects_individuals (individual_id, project_id) VALUES (" . $individualid . ", " . $projectid . ")");
         $db->query();
     }
     // assign the individual to the subround.
     if ($individualid && $srid) {
         $db->setQuery("INSERT INTO #__tracks_rounds_results (individual_id, subround_id) VALUES (" . $individualid . ", " . $srid . ")");
         $db->query();
     }
     $this->setRedirect("index.php?option=com_tracks&view=subroundresults&subround_id=" . $srid);
 }
开发者ID:julienV,项目名称:Joomla-Tracks,代码行数:38,代码来源:quickadd.php

示例8: onBrowse

 public function onBrowse($tpl = null)
 {
     $media_folder = JURI::base() . '../media/com_akeeba/';
     // Get the root URI for media files
     $this->mediadir = AkeebaHelperEscape::escapeJS($media_folder . 'theme/');
     // Get a JSON representation of the available roots
     $model = $this->getModel();
     $root_info = $model->get_roots();
     $roots = array();
     if (!empty($root_info)) {
         // Loop all dir definitions
         foreach ($root_info as $def) {
             $roots[] = $def->value;
             $options[] = JHTML::_('select.option', $def->value, $def->text);
         }
     }
     $site_root = '[SITEDB]';
     $attribs = 'onchange="akeeba_active_root_changed();"';
     $this->root_select = JHTML::_('select.genericlist', $options, 'root', $attribs, 'value', 'text', $site_root, 'active_root');
     $this->roots = $roots;
     $tpl = null;
     // Get a JSON representation of the directory data
     $model = $this->getModel();
     $json = json_encode($model->get_regex_filters($site_root));
     $this->json = $json;
     // Add live help
     AkeebaHelperIncludes::addHelp('regexdbfilter');
     // Get profile ID
     $profileid = AEPlatform::getInstance()->get_active_profile();
     $this->profileid = $profileid;
     // Get profile name
     $pmodel = FOFModel::getAnInstance('Profiles', 'AkeebaModel');
     $pmodel->setId($profileid);
     $profile_data = $pmodel->getItem();
     $this->profilename = $profile_data->description;
     return true;
 }
开发者ID:sillysachin,项目名称:teamtogether,代码行数:37,代码来源:view.html.php

示例9: getOptions

 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  */
 protected function getOptions()
 {
     $options = array();
     $this->value = array();
     $value_field = $this->element['value_field'] ? (string) $this->element['value_field'] : 'title';
     $input = new FOFInput();
     $component = ucfirst(str_replace('com_', '', $input->getString('option')));
     $view = ucfirst($input->getString('view'));
     $relation = FOFInflector::pluralize((string) $this->element['name']);
     $model = FOFModel::getTmpInstance(ucfirst($relation), $component . 'Model');
     $table = $model->getTable();
     $key = $table->getKeyName();
     $value = $table->getColumnAlias($value_field);
     foreach ($model->getItemList(true) as $option) {
         $options[] = JHtml::_('select.option', $option->{$key}, $option->{$value});
     }
     if ($id = FOFModel::getAnInstance($view)->getId()) {
         $table = FOFTable::getInstance($view, $component . 'Table');
         $table->load($id);
         $relations = $table->getRelations()->getMultiple($relation);
         foreach ($relations as $item) {
             $this->value[] = $item->getId();
         }
     }
     return $options;
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:relation.php

示例10: onAdd

 /**
  * This mess of a code is probably not one of my highlights in my code
  * writing career. It's logically organized, badly architectured but I can
  * still maintain it - and it works!
  */
 public function onAdd($tpl = null)
 {
     $model = $this->getModel();
     // Load the Status Helper
     if (!class_exists('AkeebaHelperStatus')) {
         JLoader::import('helpers.status', JPATH_COMPONENT_ADMINISTRATOR);
     }
     $helper = AkeebaHelperStatus::getInstance();
     // Determine default description
     JLoader::import('joomla.utilities.date');
     $jregistry = JFactory::getConfig();
     if (version_compare(JVERSION, '3.0', 'ge')) {
         $tzDefault = $jregistry->get('offset');
     } else {
         $tzDefault = $jregistry->getValue('config.offset');
     }
     $user = JFactory::getUser();
     $tz = $user->getParam('timezone', $tzDefault);
     $dateNow = new JDate('now', $tz);
     $default_description = JText::_('BACKUP_DEFAULT_DESCRIPTION') . ' ' . $dateNow->format(JText::_('DATE_FORMAT_LC2'), true);
     $default_description = AkeebaHelperEscape::escapeJS($default_description, "'");
     $backup_description = $model->getState('description', $default_description);
     $comment = $model->getState('comment', '');
     // Get a potential return URL
     $returnurl = $model->getState('returnurl');
     if (empty($returnurl)) {
         $returnurl = '';
     }
     // If a return URL is set *and* the profile's name is "Site Transfer
     // Wizard", we are running the Site Transfer Wizard
     if (!class_exists('AkeebaModelProfiles')) {
         JLoader::import('models.profiles', JPATH_COMPONENT_ADMINISTRATOR);
     }
     $cpanelmodel = FOFModel::getAnInstance('Cpanels', 'AkeebaModel');
     $profilemodel = new AkeebaModelProfiles();
     $profilemodel->setId($cpanelmodel->getProfileID());
     $profile_data = $profilemodel->getProfile();
     $isSTW = $profile_data->description == 'Site Transfer Wizard (do not rename)' && !empty($returnurl);
     $this->assign('isSTW', $isSTW);
     // Get the domain details from scripting facility
     $aeconfig = AEFactory::getConfiguration();
     $script = $aeconfig->get('akeeba.basic.backup_type', 'full');
     $scripting = AEUtilScripting::loadScripting();
     $domains = array();
     if (!empty($scripting)) {
         foreach ($scripting['scripts'][$script]['chain'] as $domain) {
             $description = JText::_($scripting['domains'][$domain]['text']);
             $domain_key = $scripting['domains'][$domain]['domain'];
             if ($isSTW && $domain_key == 'Packing') {
                 $description = JText::_('BACKUP_LABEL_DOMAIN_PACKING_STW');
             }
             $domains[] = array($domain_key, $description);
         }
     }
     $json_domains = AkeebaHelperEscape::escapeJS(json_encode($domains), '"\\');
     // Get the maximum execution time and bias
     $maxexec = $aeconfig->get('akeeba.tuning.max_exec_time', 14) * 1000;
     $bias = $aeconfig->get('akeeba.tuning.run_time_bias', 75);
     // Check if the output directory is writable
     $quirks = AEUtilQuirks::get_quirks();
     $unwritableOutput = array_key_exists('001', $quirks);
     // Pass on data
     $this->assign('haserrors', !$helper->status);
     $this->assign('hasquirks', $helper->hasQuirks());
     $this->assign('quirks', $helper->getQuirksCell(!$helper->status));
     $this->assign('description', $backup_description);
     $this->assign('comment', $comment);
     $this->assign('domains', $json_domains);
     $this->assign('maxexec', $maxexec);
     $this->assign('bias', $bias);
     $this->assign('useiframe', $aeconfig->get('akeeba.basic.useiframe', 0) ? 'true' : 'false');
     $this->assign('returnurl', $returnurl);
     $this->assign('unwritableoutput', $unwritableOutput);
     if ($aeconfig->get('akeeba.advanced.archiver_engine', 'jpa') == 'jps') {
         $this->assign('showjpskey', 1);
         $this->assign('jpskey', $aeconfig->get('engine.archiver.jps.key', ''));
     } else {
         $this->assign('showjpskey', 0);
     }
     if (AKEEBA_PRO) {
         $this->assign('showangiekey', 1);
         $this->assign('angiekey', $aeconfig->get('engine.installer.angie.key', ''));
     }
     $this->assign('autostart', $model->getState('autostart'));
     // Pass on profile info
     $this->assign('profileid', $cpanelmodel->getProfileID());
     // Active profile ID
     $this->assign('profilelist', $cpanelmodel->getProfilesList());
     // List of available profiles
     // Pass on state information pertaining to SRP
     $this->assign('srpinfo', $model->getState('srpinfo'));
     // Add live help
     AkeebaHelperIncludes::addHelp('backup');
     // Set the toolbar title
     if ($this->srpinfo['tag'] == 'restorepoint') {
//.........这里部分代码省略.........
开发者ID:brojask,项目名称:colegio-abogados-joomla,代码行数:101,代码来源:view.html.php

示例11: createModel

 /**
  * Creates a new model object
  *
  * @param   string  $name    The name of the model class, e.g. Items
  * @param   string  $prefix  The prefix of the model class, e.g. FoobarModel
  * @param   array   $config  The configuration parameters for the model class
  *
  * @return  FOFModel  The model object
  */
 protected function createModel($name, $prefix = '', $config = array())
 {
     // Make sure $config is an array
     if (is_object($config)) {
         $config = (array) $config;
     } elseif (!is_array($config)) {
         $config = array();
     }
     $result = null;
     // Clean the model name
     $modelName = preg_replace('/[^A-Z0-9_]/i', '', $name);
     $classPrefix = preg_replace('/[^A-Z0-9_]/i', '', $prefix);
     $result = FOFModel::getAnInstance($modelName, $classPrefix, $config);
     return $result;
 }
开发者ID:alvarovladimir,项目名称:messermeister_ab_rackservers,代码行数:24,代码来源:controller.php


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