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


PHP Jfactory类代码示例

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


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

示例1: display

    function display($tpl = null)
    {
        // Assign data to the view
        $this->events = $this->get('Events');
        $this->protocolReminders = $this->get('ProtocolReminders');
        // Check for errors.
        if (count($errors = $this->get('Errors'))) {
            JError::raiseError(500, implode('<br />', $errors));
            return false;
        }
        $document = JFactory::getDocument();
        $this->mapJS($document);
        $totalEvents = $this->get('NumEvents');
        $apiParams = json_encode($this->get('ApiParams'));
        $userID = Jfactory::getUser()->id;
        $canRecordAttendance = SWG_EventsController::canRecordAttendance() ? 'true' : 'false';
        $document->addScript('/components/com_swg_events/views/eventlisting/script/eventlisting.js');
        $document->addScriptDeclaration(<<<MAP
window.addEvent('domready', function()
{
\tregisterMapLinks();
\tdocument.addEvent("scroll",scrolled);
\ttotalEvents = {$totalEvents};
\tapiParams = {$apiParams};
\tcanRecordAttendance = {$canRecordAttendance};
\tuserID = {$userID};
});
MAP
);
        // Display the view
        parent::display($tpl);
    }
开发者ID:SheffieldWalkingGroup,项目名称:swgwebsite,代码行数:32,代码来源:view.html.php

示例2: save

 /**
  * save the posted form data.
  *
  */
 function save()
 {
     $mainframe = Jfactory::getApplication();
     $model = $this->getModel('redform');
     $result = $model->apisaveform();
     $referer = JRequest::getVar('referer');
     if (!$result) {
         if (!JRequest::getBool('ALREADY_ENTERED')) {
             $msg = JText::_('COM_REDFORM_Sorry_there_was_a_problem_with_your_submission') . ': ' . $model->getError();
         }
         $this->setRedirect($referer, $msg, 'error');
         $this->redirect();
     }
     if ($url = $model->hasActivePayment($result->submit_key)) {
         $url = 'index.php?option=com_redform&controller=payment&task=select&key=' . $result->submit_key;
         $this->setRedirect($url);
         $this->redirect();
     }
     if ($url = $model->getRedirect()) {
         $this->setRedirect($url);
         $this->redirect();
     } else {
         echo $model->getNotificationText();
     }
 }
开发者ID:,项目名称:,代码行数:29,代码来源:

示例3: __construct

 public function __construct($id = null)
 {
     if ($id) {
         $this->setId($id);
     }
     $this->_db = Jfactory::getDbo();
 }
开发者ID:,项目名称:,代码行数:7,代码来源:

示例4: save

 function save(&$element, $forceBackend = false)
 {
     $app = Jfactory::getApplication();
     if ($app->isAdmin() || $forceBackend) {
         return $this->saveBackend($element);
     }
     return $this->saveFrontend($element);
 }
开发者ID:q0821,项目名称:esportshop,代码行数:8,代码来源:vote.php

示例5: onContentSearch

 /**
 * Example Search method
 *
 * The sql must return the following fields that are used in a common display
 * routine:
 - title;
 - href:            link associated with the title;
 - browsernav    if 1, link opens in a new window, otherwise in the same window;
 - section        in parenthesis below the title;
 - text;
 - created;
 
 * @param string Target search string
 * @param string matching option, exact|any|all
 * @param string ordering option, newest|oldest|popular|alpha|category
 * @param mixed An array if the search it to be restricted to areas, null if search all
 *
 * @return array Search results
 */
 public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null)
 {
     $result = array();
     // jelenleg semmilyen paramétert nem veszek figyelembe és hozzáférés ellenörzés sincs.
     $db = Jfactory::getDBO();
     // témakorok
     $db->setQuery('select t.megnevezes as title,
       t.id,
       "2" as browsernav,
       "' . JText::_('TEMAKOROK') . '" as section,
       "" as `text`,
       t.letrehozva as created
       from #__temakorok t
       where t.megnevezes like "%' . $text . '%"
       order by t.id DESC');
     $res = $db->loadObjectList();
     foreach ($res as $res1) {
         $res1->href = 'index.php?option=com_szavazasok&view=szavazasoklist&temakor=' . $res1->id;
         $result[] = $res1;
     }
     // szavazások
     $db->setQuery('select sz.megnevezes as title,
       sz.id,
       "2" as browsernav,
       "' . JText::_('SZAVAZASOK') . '" as section,
       "" as `text`,
       sz.letrehozva as created
       from #__szavazasok sz
       where  sz.megnevezes like "%' . $text . '%"
       order by sz.id DESC');
     $res = $db->loadObjectList();
     foreach ($res as $res1) {
         $res1->href = 'index.php?option=com_alternativak&view=alternativaklist&szavazas=' . $res1->id;
         $result[] = $res1;
     }
     // alternativák
     $db->setQuery('select sz.megnevezes as title,
       sz.id,
       "2" as browsernav,
       "' . JText::_('ALTERNATIVAK') . '" as section,
       "" as `text`,
       sz.letrehozva as created
       from #__szavazasok sz, #__alternativak a
       where  a.szavazas_id = sz.id and a.megnevezes like "%' . $text . '%"
       order by sz.id DESC');
     $res = $db->loadObjectList();
     foreach ($res as $res1) {
         $res1->href = 'index.php?option=com_alternativak&view=alternativaklist&szavazas=' . $res1->id;
         $result[] = $res1;
     }
     return $result;
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:71,代码来源:li_de.php

示例6: __construct

 public function __construct($params)
 {
     $this->_params = $params;
     $this->_db = Jfactory::getDBO();
     if (JRequest::getCmd('option') == 'com_joomleague') {
         $p = JRequest::getInt('p', $params->get('default_project_id'));
     } else {
         $p = $params->get('default_project_id');
     }
     $this->_project_id = intval($p);
     $this->_project = $this->getProject();
     $this->_round_id = JRequest::getInt('r');
     $this->_division_id = JRequest::getInt('division', 0);
     $this->_team_id = JRequest::getInt('tid', 0);
 }
开发者ID:santas156,项目名称:joomleague-2-komplettpaket,代码行数:15,代码来源:helper.php

示例7: eventAccess

 /**
  * Function to return event access (access levels, approval and event access status)
  *
  * @access	public static
  * @param	$id - id of the event
  * @return	list array of access levels, approval and event access status
  *
  * @since	3.4.0
  */
 public static function eventAccess($id = null)
 {
     // Preparing connection to db
     $db = Jfactory::getDbo();
     // Preparing the query
     $query = $db->getQuery(true);
     $query->select('e.state AS evtState, e.approval AS evtApproval, e.access AS evtAccess')->from($db->qn('#__icagenda_events') . ' AS e')->where($db->qn('e.id') . ' = ' . $db->q($id));
     $query->select('v.title AS accessName')->join('LEFT', $db->quoteName('#__viewlevels') . ' AS v ON v.id = e.access');
     $db->setQuery($query);
     $eventAccess = $db->loadObject();
     if ($eventAccess) {
         return $eventAccess;
     } else {
         return false;
     }
 }
开发者ID:esorone,项目名称:efcpw,代码行数:25,代码来源:events.php

示例8: _lookupUserLogin

 /**
  * Retrieve the Twitter connection details for the current user
  * @return array
  */
 function _lookupUserLogin()
 {
     global $mainframe;
     $user =& Jfactory::getUser();
     if ($user->id) {
         // make sure there is a logged in user
         $btuser =& JTable::getInstance('btuser');
         $data = $this->getUser($user->id);
         $key = str_rot13(strrev($user->username));
         $crypt = new JSimpleCrypt($key);
         $password = $crypt->decrypt($data->password);
         return array('username' => $data->username, 'password' => $password);
     } else {
         return array('username' => '', 'password' => '');
     }
 }
开发者ID:joomux,项目名称:BizTweet,代码行数:20,代码来源:twitter.php

示例9: array

 /**
  * Returns a reference to the global User object, only creating it if it
  * doesn't already exist.
  *
  * This method must be invoked as:
  * 		<pre>  $user =& JUser::getInstance($id);</pre>
  *
  * @access 	public
  * @param 	int 	$id 	The user to load - Can be an integer or string - If string, it is converted to ID automatically.
  * @return 	JUser  			The User object.
  * @since 	1.5
  */
 function &getInstance($id = 0)
 {
     static $instances;
     if (!isset($instances)) {
         $instances = array();
     }
     // Find the user id
     if (!$id) {
         $user =& Jfactory::getUser();
         $id = $user->get('id');
     }
     if (empty($instances[$id])) {
         $inst = new UserAcl($id);
         $instances[$id] = $inst;
     }
     return $instances[$id];
 }
开发者ID:,项目名称:,代码行数:29,代码来源:

示例10: makeDefault

 function makeDefault()
 {
     $mainframe = Jfactory::getApplication();
     /* Load the view object */
     $view = $this->getView('shoppergroup', 'html');
     $model = VmModel::getModel('shoppergroup');
     $msgtype = '';
     $cids = JRequest::getVar('virtuemart_shoppergroup_id', array());
     if ($model->makeDefault((int) $cids[0])) {
         $msg = JText::_('COM_VIRTUEMART_SET_TO_DEFAULT_SUCCESSFULLY');
     } else {
         $msg = '';
         // 			$msg = JText::_('COM_VIRTUEMART_SET_TO_DEFAULT_ERROR');
         $msgtype = 'error';
     }
     $mainframe->redirect('index.php?option=com_virtuemart&view=shoppergroup', $msg, $msgtype);
 }
开发者ID:Arturogcalleja,项目名称:herbolario,代码行数:17,代码来源:shoppergroup.php

示例11: getItems

 /**
  * rekord sorozat beolvasása az adatbázisból
  * @JRequest filter, order, limit, limitstart
  * @return array of records
  */
 public function getItems($state)
 {
     $db = Jfactory::getDBO();
     $query = $this->getListQuery($state);
     $limit = 100000;
     $limitstart = $state->limitstart;
     if ($limit == '') {
         $limit = 20;
     }
     if ($limit == 0) {
         $limit = 20;
     }
     if ($limitstart == '') {
         $limitstart = 0;
     }
     $db->setQuery($query, $limitstart, $limit);
     return $db->loadObjectList();
 }
开发者ID:utopszkij,项目名称:keszlet,代码行数:23,代码来源:termekek.php

示例12: createClone

 /**
  * Clone a product
  *
  * @author Max Milbers
  */
 public function createClone()
 {
     $mainframe = Jfactory::getApplication();
     /* Load the view object */
     $view = $this->getView('custom', 'html');
     $model = tmsModel::getModel('custom');
     $msgtype = '';
     $cids = vRequest::getInt($this->_cidName, vRequest::getInt('tsmart_custom_id'));
     foreach ($cids as $custom_id) {
         if ($model->createClone($custom_id)) {
             $msg = tsmText::_('com_tsmart_CUSTOM_CLONED_SUCCESSFULLY');
         } else {
             $msg = tsmText::_('com_tsmart_CUSTOM_NOT_CLONED_SUCCESSFULLY') . ' : ' . $custom_id;
             $msgtype = 'error';
         }
     }
     $mainframe->redirect('index.php?option=com_tsmart&view=custom', $msg, $msgtype);
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:23,代码来源:custom.php

示例13: _checkVersionTable

/**
 * make sure the version table has the proper structure (1.0 import !)
 * if not, update it
 */
function _checkVersionTable()
{
    $db = Jfactory::getDBO();
    $res = $db->getTableFields('#__joomleague_version');
    $cols = array_keys(reset($res));
    if (!in_array('major', $cols)) {
        $query = ' ALTER TABLE #__joomleague_version ADD `major` INT NOT NULL ,
				ADD `minor` INT NOT NULL ,
				ADD `build` INT NOT NULL ,
				ADD `count` INT NOT NULL ,
				ADD `revision` VARCHAR(128) NOT NULL ,
				ADD `file` VARCHAR(255) NOT NULL';
        $db->setQuery($query);
        if (!$db->query()) {
            echo JText::_('Failed updating version table');
        }
    }
}
开发者ID:santas156,项目名称:joomleague-2-komplettpaket,代码行数:22,代码来源:jl_install.php

示例14: getItems

 /**
  * rekord sorozat beolvasása az adatbázisból
  * @JRequest filter, order, limit, limitstart
  * @return array of records
  */
 public function getItems($state)
 {
     $db = Jfactory::getDBO();
     $query = $this->getListQuery($state);
     $limit = JRequest::getvar('limit', 20);
     $limitstart = JRequest::getvar('limitstart', 0);
     if ($limit == '') {
         $limit = 20;
     }
     if ($limit == 0) {
         $limit = 20;
     }
     if ($limitstart == '') {
         $limitstart = 0;
     }
     $db->setQuery($query, $limitstart, $limit);
     return $db->loadObjectList();
 }
开发者ID:utopszkij,项目名称:keszlet,代码行数:23,代码来源:fogyasok.php

示例15: CloneShipment

 /**
  * Clone a shipment
  *
  * @author Valérie Isaksen
  */
 public function CloneShipment()
 {
     $mainframe = Jfactory::getApplication();
     /* Load the view object */
     $view = $this->getView('shipmentmethod', 'html');
     $model = VmModel::getModel('shipmentmethod');
     $msgtype = '';
     $cids = vRequest::getVar($this->_cidName, vRequest::getInt('virtuemart_shipment_id'));
     foreach ($cids as $cid) {
         if ($model->createClone($cid)) {
             $msg = vmText::_('COM_VIRTUEMART_SHIPMENT_CLONED_SUCCESSFULLY');
         } else {
             $msg = vmText::_('COM_VIRTUEMART_SHIPMENT_NOT_CLONED_SUCCESSFULLY');
             $msgtype = 'error';
         }
     }
     $mainframe->redirect('index.php?option=com_virtuemart&view=shipmentmethod', $msg, $msgtype);
 }
开发者ID:lenard112,项目名称:cms,代码行数:23,代码来源:shipmentmethod.php


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