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

PHP Jfactory类代码示例

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

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



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


示例16: populateState

 /**
  */
 protected function populateState($ordering = null, $direction = null)
 {
     // Initiilise variables
     $app = Jfactory::getApplication('administrator');
     //load the filter state
     $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
     $this->setstate('filter.search', $search);
     $accessId = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', null, 'int');
     $this->setstate('filter.access', $accessId);
     $published = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_published', '', 'string');
     $this->setstate('filter.state', $published);
     $categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', '');
     $this->setstate('filter.category_id', $categoryId);
     //Load the parameters
     $params = JComponentHelper::getParams('com_battle');
     $this->setState('params', $params);
     //List state information
     //	parent::populateState ('a.name','asc');
 }
开发者ID:yatan,项目名称:JiGS-PHP-RPG-engine,代码行数:21,代码来源:terminals.php


示例17: createClone

 /**
  * Clone a product
  *
  * @author RolandD, Max Milbers
  */
 public function createClone()
 {
     $mainframe = Jfactory::getApplication();
     /* Load the view object */
     $view = $this->getView('custom', 'html');
     $model = VmModel::getModel('custom');
     $msgtype = '';
     $cids = JRequest::getVar($this->_cidName, JRequest::getVar('virtuemart_custom_id', array(), '', 'ARRAY'), '', 'ARRAY');
     jimport('joomla.utilities.arrayhelper');
     JArrayHelper::toInteger($cids);
     foreach ($cids as $custom_id) {
         if ($model->createClone($custom_id)) {
             $msg = JText::_('COM_VIRTUEMART_CUSTOM_CLONED_SUCCESSFULLY');
         } else {
             $msg = JText::_('COM_VIRTUEMART_CUSTOM_NOT_CLONED_SUCCESSFULLY') . ' : ' . $custom_id;
             $msgtype = 'error';
         }
     }
     $mainframe->redirect('index.php?option=com_virtuemart&view=custom', $msg, $msgtype);
 }
开发者ID:Gskflute,项目名称:joomla25,代码行数:25,代码来源:custom.php


示例18: postflight

 /**
  * Post-flight extension installer method.
  *
  * This method runs after all other installation code.
  *
  * @param	$type
  * @param	$parent
  *
  * @return	void
  * @since	1.0.3
  */
 function postflight($type, $parent)
 {
     // Display a move files and folders to parent.
     jimport('joomla.filesystem.folder');
     $srcBase = JPATH_PLUGINS . '/editors/arkeditor/layouts/joomla/';
     $dstBase = JPATH_SITE . '/layouts/joomla/';
     $folders = JFolder::folders($srcBase);
     $manifest = $parent->getParent()->getManifest();
     $attributes = $manifest->attributes();
     $method = $attributes->method ? (string) $attributes->method : false;
     foreach ($folders as $folder) {
         if ($method != 'upgrade') {
             if (JFolder::exists($dstBase . $folder)) {
                 JFolder::delete($dstBase . $folder);
             }
         }
         JFolder::copy($srcBase . $folder, $dstBase . $folder, null, true);
     }
     if ($type == 'install') {
         //update $db
         $db = Jfactory::getDBO();
         $toolbars = base64_encode('{"back":[[ "Templates" ],[ "Cut","Copy","Paste","PasteText","PasteFromWord" ] ,["SelectAll","SpellChecker", "Scayt" ] ,["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat" ] ,[ "NumberedList","BulletedList","Outdent","Indent","-","Blockquote","CreateDiv","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock","BidiLtr","BidiRtl" ],[ "Link","Document","Unlink","Anchor" ],	[ "Image","Flash","Table","Smiley","SpecialChar","PageBreak","Iframe" ],[ "Styles","Format","Font","FontSize" ],[ "TextColor","BGColor" ],[ "Maximize", "ShowBlocks","-","About" ]],"front":[[ "Templates" ],[ "Cut","Copy","Paste","PasteText","PasteFromWord"] ,["Bold","Italic","Underline","Strike","RemoveFormat" ],  [ "NumberedList","BulletedList","Outdent","Indent","Blockquote"],[ "Link","Document","Unlink","Anchor" ],[ "Image","Table","SpecialChar","PageBreak","Iframe"],["Styles","Format" ],[ "Maximize", "ShowBlocks","About" ]],"inline" :[["Sourcedialog","Bold","NumberedList","BulletedList"],["PasteText","Image","Link","Document"],["Format"],["Readmore"],["Save"],["Versions"],["Close"] ],"title":[["Save"],["Cut","Copy","PasteText"],["Undo"],["Close"]],"image":[["Save"],["Image"],["Link","Document"],["Close"]],"mobile":[["Bold"],["Link"],["Image"],["Save"],["Versions"],["Close"]]}');
         $query = $db->getQuery(true);
         $query->select('params')->from('#__extensions')->where('folder = ' . $db->quote('editors'))->where('element = ' . $db->quote('arkeditor'));
         $db->setQuery($query);
         $params = $db->loadResult();
         if ($params === false) {
             throw new Exception('Failed to retrieve parameters from Editor');
         }
         if (!$params) {
             $params = '{}';
         }
         $params = new JRegistry($params);
         $params->set('toolbars', $toolbars);
         $query->clear()->update('#__extensions')->set('params= ' . $db->quote($params->toString()))->where('folder = ' . $db->quote('editors'))->where('element = ' . $db->quote('arkeditor'));
         $db->setQuery($query);
         if (!$db->query()) {
             throw new Exception('Failed to update parameters for Editor');
         }
     }
 }
开发者ID:johngrange,项目名称:wookeyholeweb,代码行数:52,代码来源:install.php


示例19: ClonePayment

 /**
  * Clone a payment
  *
  * @author Valérie Isaksen
  */
 public function ClonePayment()
 {
     $mainframe = Jfactory::getApplication();
     /* Load the view object */
     $view = $this->getView('paymentmethod', 'html');
     $model = VmModel::getModel('paymentmethod');
     $msgtype = '';
     //$cids = vRequest::getInt('virtuemart_product_id',0);
     $cids = vRequest::getVar($this->_cidName, vRequest::getVar('virtuemart_payment_id'));
     //jimport( 'joomla.utilities.arrayhelper' );
     JArrayHelper::toInteger($cids);
     foreach ($cids as $cid) {
         if ($model->createClone($cid)) {
             $msg = vmText::_('COM_VIRTUEMART_PAYMENT_CLONED_SUCCESSFULLY');
         } else {
             $msg = vmText::_('COM_VIRTUEMART_PAYMENT_NOT_CLONED_SUCCESSFULLY');
             $msgtype = 'error';
         }
     }
     $mainframe->redirect('index.php?option=com_virtuemart&view=paymentmethod', $msg, $msgtype);
 }
开发者ID:naka211,项目名称:studiekorrektur,代码行数:26,代码来源:paymentmethod.php


示例20: ClonePayment

 /**
  * Clone a payment
  *
  * @author Valérie Isaksen
  */
 public function ClonePayment()
 {
     $mainframe = Jfactory::getApplication();
     /* Load the view object */
     $view = $this->getView('paymentmethod', 'html');
     $model = tmsModel::getModel('paymentmethod');
     $msgtype = '';
     $cids = vRequest::getInt($this->_cidName, vRequest::getInt('tsmart_payment_id'));
     if (!is_array($cids)) {
         $cids = array($cids);
     }
     foreach ($cids as $cid) {
         if ($model->createClone($cid)) {
             $msg = tsmText::_('com_tsmart_PAYMENT_CLONED_SUCCESSFULLY');
         } else {
             $msg = tsmText::_('com_tsmart_PAYMENT_NOT_CLONED_SUCCESSFULLY');
             $msgtype = 'error';
         }
     }
     $mainframe->redirect('index.php?option=com_tsmart&view=paymentmethod', $msg, $msgtype);
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:26,代码来源:paymentmethod.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

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