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


PHP jimport函数代码示例

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


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

示例1: getInput

 public function getInput()
 {
     jimport('joomla.filesystem.file');
     $mainframe = JFactory::getApplication();
     if (!JFile::exists(JPATH_ADMINISTRATOR . '/components/com_joomailermailchimpintegration/libraries/MCAPI.class.php')) {
         $mainframe->enqueueMessage(JText::_('JM_PLEASE_INSTALL_JOOMLAMAILER'), 'error');
         $mainframe->redirect('index.php');
     }
     $listId = $this->form->getValue('listid', 'params');
     require_once JPATH_ADMINISTRATOR . '/components/com_joomailermailchimpintegration/libraries/MCAPI.class.php';
     $params = JComponentHelper::getParams('com_joomailermailchimpintegration');
     $MCapi = $params->get('params.MCapi');
     $api = new joomlamailerMCAPI($MCapi);
     $interests = $api->listInterestGroupings($listId);
     $options = array();
     if ($interests) {
         foreach ($interests as $interest) {
             if ($interest['form_field'] != 'hidden') {
                 $groups = array();
                 foreach ($interest['groups'] as $ig) {
                     $groups[] = $ig['name'];
                 }
                 $groups = implode('####', $groups);
                 $options[] = array('id' => $interest['id'] . ';' . $interest['form_field'] . ';' . $interest['name'] . ';' . $groups, 'name' => $interest['name']);
             }
         }
     }
     if (count($options)) {
         return JHtml::_('select.genericlist', $options, 'jform[params][interests][]', 'multiple="multiple"', 'id', 'name', $this->value, $this->id);
     } else {
         return JText::_('JM_NO_INTEREST_GROUPS');
     }
 }
开发者ID:rodhoff,项目名称:MNW,代码行数:33,代码来源:interests.php

示例2: delete

 public function delete()
 {
     // Check for request forgeries
     JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
     // Get items to remove from the request.
     $cid = JFactory::getApplication()->input->get('cid', array(), 'array');
     if (!is_array($cid) || count($cid) < 1) {
         JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror');
     } else {
         // Get the model.
         $model = $this->getModel();
         // Make sure the item ids are integers
         jimport('joomla.utilities.arrayhelper');
         JArrayHelper::toInteger($cid);
         // Remove the items.
         if ($model->delete($cid)) {
             $this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
         } else {
             $this->setMessage($model->getError());
         }
     }
     $version = new JVersion();
     if ($version->isCompatible('3.0')) {
         // Invoke the postDelete method to allow for the child class to access the model.
         $this->postDeleteHook($model, $cid);
     }
     $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));
 }
开发者ID:AndreKoepke,项目名称:Einsatzkomponente,代码行数:28,代码来源:alarmierungsarten.php

示例3: testGetVarFromDataSet

 /**
  * @dataProvider getVarData
  * @covers JRequest::getVar
  * @covers JRequest::_cleanVar
  * @covers JRequest::_stripSlashesRecursive
  */
 public function testGetVarFromDataSet($name, $default, $hash, $type, $mask, $expect, $filterCalls)
 {
     jimport('joomla.environment.request');
     $filter = JFilterInput::getInstance();
     $filter->mockReset();
     if (count($filterCalls)) {
         foreach ($filterCalls as $info) {
             $filter->mockSetUp($info[0], $info[1], $info[2], $info[3]);
         }
     }
     /*
      * Get the variable and check the value.
      */
     $actual = JRequest::getVar($name, $default, $hash, $type, $mask);
     $this->assertEquals($expect, $actual, 'Non-cached getVar');
     /*
      * Repeat the process to check caching (the JFilterInput mock should not
      * get called unless the default is being used).
      */
     $actual = JRequest::getVar($name, $default, $hash, $type, $mask);
     $this->assertEquals($expect, $actual, 'Cached getVar');
     if (($filterOK = $filter->mockTearDown()) !== true) {
         $this->fail('JFilterInput not called as expected:' . print_r($filterOK, true));
     }
 }
开发者ID:rvsjoen,项目名称:joomla-platform,代码行数:31,代码来源:JRequestGetVarTest.php

示例4: setUp

 public function setUp()
 {
     //require_once dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))).'/bootstrap.php';
     jimport('joomla.cache.cache');
     require_once dirname(dirname(__FILE__)) . '/storage/JCacheStorageMock.php';
     require_once dirname(__FILE__) . '/JCacheControllerCallback.helper.php';
 }
开发者ID:Joomla-on-NoSQL,项目名称:LaMojo,代码行数:7,代码来源:JCacheControllerCallbackCallbackTest.php

示例5: display

 function display()
 {
     jimport('joomla.application.module.helper');
     $module =& JModuleHelper::getModule('mod_login');
     $module = JModuleHelper::renderModule($module, array('style' => 'rounded', 'id' => 'section-box'));
     echo $module;
 }
开发者ID:jicheng17,项目名称:comanova,代码行数:7,代码来源:admin.login.php

示例6: start

 function start($name, $options = array())
 {
     $ret = '';
     if ($this->mode == 'pane') {
         jimport('joomla.html.pane');
         if (!empty($this->options)) {
             $options = array_merge($options, $this->options);
         }
         $this->tabs = JPane::getInstance('tabs', $options);
         $ret .= $this->tabs->startPane($name);
     } elseif ($this->mode == 'tabs') {
         if (!empty($this->options)) {
             $options = array_merge($options, $this->options);
         }
         $ret .= JHtml::_('tabs.start', $name, $options);
     } else {
         $this->name = $name;
         if ($this->options == null) {
             $this->options = $options;
         } else {
             $this->options = array_merge($this->options, $options);
         }
     }
     return $ret;
 }
开发者ID:utopszkij,项目名称:lmp,代码行数:25,代码来源:acytabs.php

示例7: displayItems

 function displayItems()
 {
     $model = $this->getModel('logs');
     $lists = $model->getvar();
     $filter_order = $lists['filter_order'];
     $filter_order_Dir = $lists['filter_order_Dir'];
     $limit = $lists['limit'];
     $limitstart = $lists['limitstart'];
     $search = $lists['search'];
     $search = JString::strtolower($search);
     $where = $model->getWhereClause($lists);
     //echo $where;
     //order by
     $orderby = '  ORDER BY ' . $filter_order . ' ' . $filter_order_Dir;
     $total = $model->getItems($where, 1);
     //limit
     if ($limit > $total) {
         $limitstart = 0;
     }
     if ($limit == 0) {
         $limit = $total;
     }
     $limited = "  LIMIT " . $limitstart . ',' . $limit;
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $lists['limitstart'], $lists['limit']);
     $items = $model->getItems($where, 0, $orderby, $limited);
     $this->assign('items', $items);
     $this->assign('lists', $lists);
     $this->assign('pageNav', $pageNav);
 }
开发者ID:jomsocial,项目名称:JSVoice,代码行数:30,代码来源:view.html.php

示例8: detectIntegration

	static public function detectIntegration($name, $best = false) {
		jimport ( 'joomla.filesystem.folder' );
		$dir = dirname ( __FILE__ );
		$folders = JFolder::folders ( $dir );
		$list = array ();
		require_once "$dir/$name.php";
		foreach ( $folders as $integration ) {
			$file = "$dir/$integration/$name.php";
			if (is_file ( $file )) {
				require_once $file;
				$obj = self::_initialize ( $name, $integration );
				$priority = 0;
				if ($obj)
					$priority = $obj->priority;
				if ($obj !== false) $list [$integration] = $priority;
				unset ( $obj );
			}
		}
		if ($best) {
			// Return best choice
			arsort ( $list );
			reset ( $list );
			return key ( $list );
		}
		// Return associative list of all options
		return $list;
	}
开发者ID:GoremanX,项目名称:Kunena-2.0,代码行数:27,代码来源:integration.php

示例9: display

 /**
  * Return JSON encoded data for Statistic page
  */
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $params = $app->getParams();
     jimport('joomla.environment.request');
     /* validating request */
     $guild_id = $params->get('guild_id', '0');
     $groups = $params->get('allowed_groups');
     $by_chars = $params->get('stats_by_chars', 0);
     $show_rating = $params->get('show_rating', 0);
     if ($guild_id != 0) {
         JRequest::setVar('guild_id', $guild_id, 'get', true);
     }
     if ($by_chars == 0) {
         JRequest::setVar('character_id', 0, 'get', true);
     }
     if ($show_rating != 0) {
         JRequest::setVar('show_rating', 1, 'get', true);
     }
     if (JRequest::getVar('group_id', '', 'get', 'int') != '') {
         if (!in_array(JRequest::getVar('group_id', '', 'get', 'int'), $groups)) {
             JRequest::setVar('group_id', '', 'get', true);
         }
     }
     /* load backend controller */
     JLoader::register('RaidPlannerControllerStats', JPATH_ADMINISTRATOR . '/components/com_raidplanner/controllers/stats.php');
     $tmp = new RaidPlannerControllerStats();
     $tmp->display();
 }
开发者ID:dnaoverride,项目名称:RaidPlanner,代码行数:32,代码来源:view.json.php

示例10: display

 function display($tpl = null)
 {
     //Load pane behavior
     jimport('joomla.html.pane');
     //initialise variables
     $document =& JFactory::getDocument();
     $pane =& JPane::getInstance('sliders');
     $user =& JFactory::getUser();
     //build toolbar
     JToolBarHelper::title(JText::_('IMPORT'), 'home');
     JToolBarHelper::help('el.import', true);
     // Get data from the model
     $eventfields =& $this->get('EventFields');
     $catfields =& $this->get('CategoryFields');
     //add css and submenu to document
     $document->addStyleSheet('components/com_eventlist/assets/css/eventlistbackend.css');
     //Create Submenu
     JSubMenuHelper::addEntry(JText::_('EVENTLIST'), 'index.php?option=com_eventlist', true);
     JSubMenuHelper::addEntry(JText::_('EVENTS'), 'index.php?option=com_eventlist&view=events');
     JSubMenuHelper::addEntry(JText::_('VENUES'), 'index.php?option=com_eventlist&view=venues');
     JSubMenuHelper::addEntry(JText::_('CATEGORIES'), 'index.php?option=com_eventlist&view=categories');
     JSubMenuHelper::addEntry(JText::_('ARCHIVESCREEN'), 'index.php?option=com_eventlist&view=archive');
     JSubMenuHelper::addEntry(JText::_('GROUPS'), 'index.php?option=com_eventlist&view=groups');
     JSubMenuHelper::addEntry(JText::_('HELP'), 'index.php?option=com_eventlist&view=help');
     if ($user->get('gid') > 24) {
         JSubMenuHelper::addEntry(JText::_('SETTINGS'), 'index.php?option=com_eventlist&controller=settings&task=edit');
     }
     //assign vars to the template
     $this->assignRef('eventfields', $eventfields);
     $this->assignRef('catfields', $catfields);
     parent::display($tpl);
 }
开发者ID:julienV,项目名称:testrepo,代码行数:32,代码来源:view.html.php

示例11: display

 function display()
 {
     global $mainframe;
     $db =& JFactory::getDBO();
     $user =& JFactory::getUser();
     $context = 'com_banners.bannerclient.list.';
     $filter_order = $mainframe->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'a.name', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $mainframe->getUserStateFromRequest($context . 'search', 'search', '', 'string');
     $search = JString::strtolower($search);
     $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
     $limitstart = $mainframe->getUserStateFromRequest($context . 'limitstart', 'limitstart', 0, 'int');
     $where = array();
     if ($search) {
         $where[] = 'LOWER(a.name) LIKE ' . $db->Quote('%' . $db->getEscaped($search, true) . '%', false);
     }
     $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
     $orderby = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir . ', a.cid';
     // get the total number of records
     $query = 'SELECT a.*, count(b.bid) AS nbanners, u.name AS editor' . ' FROM #__bannerclient AS a' . ' LEFT JOIN #__banner AS b ON a.cid = b.cid' . ' LEFT JOIN #__users AS u ON u.id = a.checked_out' . $where . ' GROUP BY a.cid' . $orderby;
     $db->setQuery($query);
     $db->query();
     $total = $db->getNumRows();
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     $db->setQuery($query, $pageNav->limitstart, $pageNav->limit);
     $rows = $db->loadObjectList();
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     // search filter
     $lists['search'] = $search;
     require_once JPATH_COMPONENT . DS . 'views' . DS . 'client.php';
     BannersViewClients::clients($rows, $pageNav, $lists);
 }
开发者ID:RangerWalt,项目名称:ecci,代码行数:35,代码来源:client.php

示例12: __construct

 function __construct($name = null, $extensions = false)
 {
     jimport('legacy.component.helper');
     JLoader::import('helpers.jupgradepro', JPATH_COMPONENT_ADMINISTRATOR);
     // Creating dabatase instance for this installation
     $this->_db = JFactory::getDBO();
     // Set step table
     if ($extensions == false) {
         $this->_table = '#__jupgradepro_steps';
     } else {
         if ($extensions === 'tables') {
             $this->_table = '#__jupgradepro_extensions_tables';
         } else {
             if ($extensions == true) {
                 $this->_table = '#__jupgradepro_extensions';
             }
         }
     }
     // Get the old version
     $this->old_ver = JUpgradeproHelper::getVersion('old');
     // Load the last step from database
     if ($name !== false) {
         $this->_load($name);
     }
 }
开发者ID:klas,项目名称:matware-libraries,代码行数:25,代码来源:step.php

示例13: display

	function display ($tpl = null) {

		// Load the helper(s)


		jimport('joomla.filesystem.file');
		$config = JFactory::getConfig();
		$log_path = $config->get('log_path', VMPATH_ROOT . "/log");
		$layoutName = vRequest::getCmd('layout', 'default');
		VmConfig::loadJLang('com_virtuemart_log');

		if ($layoutName == 'edit') {
			$logFile = vRequest::getString('logfile', '');
			$this->SetViewTitle('LOG', $logFile);
			$fileContent = file_get_contents($log_path . DS . $logFile);
			$fileContentByLine = explode("\n", $fileContent);

			$this->assignRef('fileContentByLine', $fileContentByLine);
			JToolBarHelper::cancel();

		} else {
			if(!class_exists('JFolder')) require(VMPATH_LIBS.DS.'joomla'.DS.'filesystem'.DS.'folder.php');

			$logFiles = JFolder::files($log_path, $filter = '.', true, false, array('index.html'));

			$this->SetViewTitle('LOG');
			$this->assignRef('logFiles', $logFiles);
			$this->assignRef('path', $log_path);
		}

		parent::display($tpl);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:32,代码来源:view.html.php

示例14: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     jimport('joomla.filesystem.folder');
     jimport('joomla.filesystem.file');
     $language = JFactory::getLanguage();
     // create a unique id
     $id = preg_replace('#([^a-z0-9_-]+)#i', '', $control_name . 'filesystem' . $name);
     // add javascript if element has parameters
     if ($node->attributes('parameters')) {
         $document = JFactory::getDocument();
         $document->addScriptDeclaration('$jce.Parameter.add("#' . $id . '", "filesystem");');
     }
     // path to directory
     $path = WF_EDITOR_EXTENSIONS . DS . 'filesystem';
     $filter = '\\.xml$';
     $files = JFolder::files($path, $filter, false, true);
     $options = array();
     if (!$node->attributes('exclude_default')) {
         $options[] = JHTML::_('select.option', '', WFText::_('WF_OPTION_NOT_SET'));
     }
     if (is_array($files)) {
         foreach ($files as $file) {
             // load language file
             $language->load('com_jce_filesystem_' . basename($file, '.xml'), JPATH_SITE);
             $xml = JApplicationHelper::parseXMLInstallFile($file);
             $options[] = JHTML::_('select.option', basename($file, '.xml'), WFText::_($xml['name']));
         }
     }
     return JHTML::_('select.genericlist', $options, '' . $control_name . '[filesystem][' . $name . ']', 'class="inputbox"', 'value', 'text', $value, $id);
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:30,代码来源:filesystem.php

示例15: isAdmin

 /**
  * Checks if the current user, or userID passed to function is an administrator
  *
  * @param INT
  */
 public static function isAdmin($userid = NULL, $admin_groups = array("7", "8"), $group_ids_passed = true)
 {
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         // Joomla! 1.6+ code here
         jimport('joomla.user.helper');
         $user = JFactory::getUser($userid);
         $groups = JUserHelper::getUserGroups($user->id);
         //var_dump($admin_groups);
         if ($group_ids_passed) {
             foreach ($groups as $temp) {
                 if (in_array($temp, $admin_groups)) {
                     return true;
                 }
             }
         } else {
             foreach ($admin_groups as $temp) {
                 if (!empty($groups[$temp])) {
                     return true;
                 }
             }
         }
         return false;
     } else {
         // Joomla! 1.5 code here
         jimport('joomla.user.helper');
         $user = JFactory::getUser($userid);
         // Note: in practice I'd use $user->gid here
         if (in_array($user->usertype, array("Super Administrator", "Administrator"))) {
             return true;
         } else {
             return false;
         }
     }
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:39,代码来源:acl.php


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