本文整理汇总了PHP中JFactory::getURI方法的典型用法代码示例。如果您正苦于以下问题:PHP JFactory::getURI方法的具体用法?PHP JFactory::getURI怎么用?PHP JFactory::getURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JFactory
的用法示例。
在下文中一共展示了JFactory::getURI方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
$option = JRequest::getCmd('option');
$mainframe = JFactory::getApplication();
$project_id = $mainframe->getUserState($option . 'project');
$uri = JFactory::getURI()->toString();
$user = JFactory::getUser();
// Get data from the model
$items = $this->get('Data');
$total = $this->get('Total');
$pagination = $this->get('Pagination');
$model = $this->getModel();
$projectws = $this->get('Data', 'project');
$division = $mainframe->getUserStateFromRequest($option . 'tt_division', 'division', '', 'string');
//build the html options for divisions
$divisions[] = JHtmlSelect::option('0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_DIVISION'));
$mdlDivisions = JModelLegacy::getInstance("divisions", "JoomLeagueModel");
if ($res = $mdlDivisions->getDivisions($project_id)) {
$divisions = array_merge($divisions, $res);
}
$lists['divisions'] = $divisions;
unset($divisions);
$this->user = $user;
$this->lists = $lists;
$this->items = $items;
$this->projectws = $projectws;
$this->division = $division;
$this->total = $total;
$this->pagination = $pagination;
$this->request_url = $uri;
$this->addToolbar();
parent::display($tpl);
}
示例2: edit
/**
* Display an edit icon for the article.
*
* This icon will not display in a popup window, nor if the article is trashed.
* Edit access checks must be performed in the calling code.
*
* @param object $article The article in question.
* @param object $params The article parameters
* @param array $attribs Not used??
*
* @return string The HTML for the article edit icon.
* @since 1.6
*/
static function edit($article, $params, $attribs = array())
{
// Initialise variables.
$user = JFactory::getUser();
$userId = $user->get('id');
$uri = JFactory::getURI();
// Ignore if in a popup window.
if ($params && $params->get('popup')) {
return;
}
// Ignore if the state is negative (trashed).
if ($article->state < 0) {
return;
}
JHtml::_('behavior.tooltip');
$url = 'index.php?task=article.edit&a_id=' . $article->id . '&return=' . base64_encode($uri);
$icon = $article->state ? 'edit.png' : 'edit_unpublished.png';
$text = JHTML::_('image', 'system/' . $icon, JText::_('JGLOBAL_EDIT'), NULL, true);
if ($article->state == 0) {
$overlib = JText::_('JUNPUBLISHED');
} else {
$overlib = JText::_('JPUBLISHED');
}
$date = JHTML::_('date', $article->created);
$author = $article->created_by_alias ? $article->created_by_alias : $article->author;
$overlib .= '<br />';
$overlib .= $date;
$overlib .= '<br />';
$overlib .= JText::sprintf('COM_CONTENT_WRITTEN_BY', htmlspecialchars($author, ENT_COMPAT, 'UTF-8'));
$button = JHTML::_('link', JRoute::_($url), $text);
$output = '<span class="hasTip" title="' . JText::_('COM_CONTENT_EDIT_ITEM') . ' :: ' . $overlib . '">' . $button . '</span>';
return $output;
}
示例3: edit
static function edit($weblink, $params, $attribs = array())
{
$user = JFactory::getUser();
$uri = JFactory::getURI();
if ($params && $params->get('popup')) {
return;
}
if ($weblink->state < 0) {
return;
}
JHtml::_('behavior.tooltip');
$url = WeblinksHelperRoute::getFormRoute($weblink->id, base64_encode($uri));
$icon = $weblink->state ? 'edit.png' : 'edit_unpublished.png';
$text = JHtml::_('image', 'system/' . $icon, JText::_('JGLOBAL_EDIT'), NULL, true);
if ($weblink->state == 0) {
$overlib = JText::_('JUNPUBLISHED');
} else {
$overlib = JText::_('JPUBLISHED');
}
$date = JHtml::_('date', $weblink->created);
$author = $weblink->created_by_alias ? $weblink->created_by_alias : $weblink->author;
$overlib .= '<br />';
$overlib .= $date;
$overlib .= '<br />';
$overlib .= htmlspecialchars($author, ENT_COMPAT, 'UTF-8');
$button = JHtml::_('link', JRoute::_($url), $text);
$output = '<span class="hasTip" title="' . JText::_('COM_WEBLINKS_EDIT') . ' :: ' . $overlib . '">' . $button . '</span>';
return $output;
}
示例4: render
/**
* Render the feed
*
* @access public
* @return string
*/
function render()
{
$now =& JFactory::getDate();
$data =& $this->_doc;
$uri =& JFactory::getURI();
$url = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
$syndicationURL =& JRoute::_('&format=feed&type=atom');
$feed = "<feed xmlns=\"http://www.w3.org/2005/Atom\" ";
if ($data->language != "") {
$feed .= " xml:lang=\"" . $data->language . "\"";
}
$feed .= ">\n";
$feed .= "\t<title type=\"text\">" . htmlspecialchars($data->title, ENT_COMPAT, 'UTF-8') . "</title>\n";
$feed .= "\t<subtitle type=\"text\">" . htmlspecialchars($data->description, ENT_COMPAT, 'UTF-8') . "</subtitle>\n";
$feed .= "\t<link rel=\"alternate\" type=\"text/html\" href=\"" . $url . "\"/>\n";
$feed .= "\t<id>" . str_replace(' ', '%20', $data->getBase()) . "</id>\n";
$feed .= "\t<updated>" . htmlspecialchars($now->toISO8601(), ENT_COMPAT, 'UTF-8') . "</updated>\n";
if ($data->editor != "") {
$feed .= "\t<author>\n";
$feed .= "\t\t<name>" . $data->editor . "</name>\n";
if ($data->editorEmail != "") {
$feed .= "\t\t<email>" . htmlspecialchars($data->editorEmail, ENT_COMPAT, 'UTF-8') . "</email>\n";
}
$feed .= "\t</author>\n";
}
$feed .= "\t<generator uri=\"http://joomla.org\" version=\"1.5\">" . $data->getGenerator() . "</generator>\n";
$feed .= '<link rel="self" type="application/atom+xml" href="' . str_replace(' ', '%20', $url . $syndicationURL) . "\" />\n";
for ($i = 0; $i < count($data->items); $i++) {
$feed .= "\t<entry>\n";
$feed .= "\t\t<title>" . htmlspecialchars(strip_tags($data->items[$i]->title), ENT_COMPAT, 'UTF-8') . "</title>\n";
$feed .= ' <link rel="alternate" type="text/html" href="' . $url . $data->items[$i]->link . "\"/>\n";
if ($data->items[$i]->date == "") {
$data->items[$i]->date = $now->toUnix();
}
$itemDate =& JFactory::getDate($data->items[$i]->date);
$feed .= "\t\t<published>" . htmlspecialchars($itemDate->toISO8601(), ENT_COMPAT, 'UTF-8') . "</published>\n";
$feed .= "\t\t<updated>" . htmlspecialchars($itemDate->toISO8601(), ENT_COMPAT, 'UTF-8') . "</updated>\n";
$feed .= "\t\t<id>" . str_replace(' ', '%20', $url . $data->items[$i]->link) . "</id>\n";
if ($data->items[$i]->author != "") {
$feed .= "\t\t<author>\n";
$feed .= "\t\t\t<name>" . htmlspecialchars($data->items[$i]->author, ENT_COMPAT, 'UTF-8') . "</name>\n";
if ($data->items[$i]->authorEmail != "") {
$feed .= "\t\t<email>" . htmlspecialchars($data->items[$i]->authorEmail, ENT_COMPAT, 'UTF-8') . "</email>\n";
}
$feed .= "\t\t</author>\n";
}
if ($data->items[$i]->description != "") {
//$feed.= " <summary type=\"html\">".htmlspecialchars($data->items[$i]->description, ENT_COMPAT, 'UTF-8')."</summary>\n";
//$feed.= " <content type=\"html\">".htmlspecialchars($data->items[$i]->description, ENT_COMPAT, 'UTF-8')."</content>\n";
$feed .= "\t\t<summary type=\"html\">" . htmlspecialchars($this->_relToAbs($data->items[$i]->description)) . "</summary>\n";
$feed .= "\t\t<content type=\"html\">" . htmlspecialchars($this->_relToAbs($data->items[$i]->description)) . "</content>\n";
}
if ($data->items[$i]->enclosure != NULL) {
$feed .= "\t\t<link rel=\"enclosure\" href=\"" . $data->items[$i]->enclosure->url . "\" type=\"" . $data->items[$i]->enclosure->type . "\" length=\"" . $data->items[$i]->enclosure->length . "\" />\n";
}
$feed .= "\t</entry>\n";
}
$feed .= "</feed>\n";
return $feed;
}
示例5: _displayForm
function _displayForm($tpl)
{
$option = JRequest::getCmd('option');
$mainframe = JFactory::getApplication();
$uri = JFactory::getURI();
$user = JFactory::getUser();
$model = $this->getModel();
//get the project
$object =& $this->get('data');
$isNew = $object->id < 1;
// fail if checked out not by 'me'
if ($model->isCheckedOut($user->get('id'))) {
$msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_JOOMLEAGUE_ADMIN_LEAGUE'), $object->name);
$mainframe->redirect('index.php?option=' . $option, $msg);
}
// Edit or Create?
if (!$isNew) {
$model->checkout($user->get('id'));
} else {
// initialise new record
$object->order = 0;
}
$extended = $this->getExtended($object->extended, 'league');
$this->assignRef('extended', $extended);
$this->assignRef('object', $object);
$this->assignRef('form', $this->get('form'));
$this->assign('cfg_which_media_tool', JComponentHelper::getParams($option)->get('cfg_which_media_tool', 0));
$this->addToolbar();
parent::display($tpl);
}
示例6: display
function display($tpl = null)
{
$option = JRequest::getCmd('option');
// Get a reference of the page instance in joomla
$document = JFactory::getDocument();
$uri = JFactory::getURI();
$js = $this->baseurl . '/components/' . $option . '/assets/js/json2.js';
$document->addScript($js);
$js = $this->baseurl . '/components/' . $option . '/assets/js/swfobject.js';
$document->addScript($js);
$division = JRequest::getInt('division', 0);
$model = $this->getModel();
$rankingconfig = $model->getTemplateConfig("ranking");
$flashconfig = $model->getTemplateConfig("flash");
$config = $model->getTemplateConfig($this->getName());
$this->project = $model->getProject();
if (isset($this->project)) {
$this->overallconfig = $model->getOverallConfig();
if (!isset($this->overallconfig['seperator'])) {
$this->overallconfig['seperator'] = ":";
}
$this->config = $config;
$this->model = $model;
$this->colors = $model->getColors($rankingconfig['colors']);
$this->division = $model->getDivision($division);
$this->team1 = $model->getTeam1($division);
$this->team2 = $model->getTeam2($division);
$this->_setChartdata(array_merge($flashconfig, $rankingconfig));
}
//parent::display( $tpl );
}
示例7: loadAsset
/**
* Check and load assets file if needed
*/
function loadAsset()
{
if (!defined('_T3_DEPEND_ASSET_')) {
define('_T3_DEPEND_ASSET_', 1);
$jdoc = JFactory::getDocument();
if (!defined('T3_TEMPLATE')) {
JFactory::getLanguage()->load(T3_PLUGIN, JPATH_ADMINISTRATOR);
if (version_compare(JVERSION, '3.0', 'ge')) {
JHtml::_('jquery.framework');
} else {
$jdoc->addScript(T3_ADMIN_URL . '/admin/js/jquery-1.8.3.min.js');
$jdoc->addScript(T3_ADMIN_URL . '/admin/js/jquery.noconflict.js');
}
}
if (JFactory::getApplication()->isSite() || !defined('T3_TEMPLATE')) {
$jdoc->addStyleSheet(T3_ADMIN_URL . '/includes/depend/css/depend.css');
$jdoc->addScript(T3_ADMIN_URL . '/includes/depend/js/depend.js');
}
JFactory::getDocument()->addScriptDeclaration('
jQuery.extend(T3Depend, {
adminurl: \'' . JFactory::getURI()->toString() . '\',
rooturl: \'' . JURI::root() . '\'
});
');
}
}
示例8: display
function display($tpl = null)
{
global $mainframe, $option;
if ($this->getLayout() == 'form') {
$this->_displayForm($tpl);
return;
}
//JToolBarHelper::title( JText::_( 'Restoration' ), 'generic.png' );
$html = "<div class=\"header icon-48-generic.png\" style='background-image:url(components/com_jdefender/images/dbrestore.png)'>\n";
$html .= JText::_('Restoration');
$html .= "\n</div>\n";
$mainframe->set('JComponentTitle', $html);
JToolBarHelper::deleteList();
JToolBarHelper::addNewX();
$html = "<a href=\"javascript:void(0);\" onclick=\"javascript:" . "document.adminForm; submitbutton('restore');\" class=\"toolbar\">";
$html .= "<span style='background-image:url(components/com_jdefender/images/dbrestore32.gif);' type=\"Standard\">";
$html .= "</span>";
$html .= JText::_('Restore');
$html .= "</a>";
$bar =& JToolBar::getInstance();
$bar->appendButton('Custom', $html, 'close');
$db =& JFactory::getDBO();
$uri =& JFactory::getURI();
$items =& $this->get('Data');
$pagination =& $this->get('Pagination');
$this->assignRef('pagination', $pagination);
$this->assignRef('restorations', $items);
parent::display($tpl);
}
示例9: __construct
/**
* Class constructor
*
* @param array $options Associative array of options
*
* @since 11.1
*/
public function __construct($options = array())
{
parent::__construct($options);
// Set document type
$this->_type = 'opensearch';
// Set mime type
$this->_mime = 'application/opensearchdescription+xml';
// Add the URL for self updating
$update = new JOpenSearchUrl();
$update->type = 'application/opensearchdescription+xml';
$update->rel = 'self';
$update->template = JRoute::_(JFactory::getURI());
$this->addUrl($update);
// Add the favicon as the default image
// Try to find a favicon by checking the template and root folder
$app = JFactory::getApplication();
$dirs = array(JPATH_THEMES . '/' . $app->getTemplate(), JPATH_BASE);
foreach ($dirs as $dir) {
if (file_exists($dir . '/favicon.ico')) {
$path = str_replace(JPATH_BASE . '/', '', $dir);
$path = str_replace('\\', '/', $path);
$favicon = new JOpenSearchImage();
$favicon->data = JURI::base() . $path . '/favicon.ico';
$favicon->height = '16';
$favicon->width = '16';
$favicon->type = 'image/vnd.microsoft.icon';
$this->addImage($favicon);
break;
}
}
}
示例10: display
function display($tpl = null)
{
$mainframe = JFactory::getApplication();
$option = 'com_k2store';
$ns = 'com_k2store.fields';
$db = JFactory::getDBO();
$uri = JFactory::getURI();
$params = JComponentHelper::getParams('com_k2store');
$filter_order = $mainframe->getUserStateFromRequest($ns . 'filter_order', 'filter_order', 'a.field_id', 'cmd');
$filter_order_Dir = $mainframe->getUserStateFromRequest($ns . 'filter_order_Dir', 'filter_order_Dir', 'ASC', 'word');
$filter_orderstate = $mainframe->getUserStateFromRequest($ns . 'filter_orderstate', 'filter_orderstate', '', 'string');
$search = $mainframe->getUserStateFromRequest($ns . 'search', 'search', '', 'string');
if (strpos($search, '"') !== false) {
$search = str_replace(array('=', '<'), '', $search);
}
$search = JString::strtolower($search);
// Get data from the model
$items = $this->get('Data');
$total = $this->get('Total');
$pagination = $this->get('Pagination');
// table ordering
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
// search filter
$lists['search'] = $search;
$this->assignRef('lists', $lists);
$this->assignRef('items', $items);
$this->assignRef('pagination', $pagination);
$this->params = $params;
$model = $this->getModel();
$this->addToolBar();
$toolbar = new K2StoreToolBar();
$toolbar->renderLinkbar();
parent::display($tpl);
}
示例11: display
function display($tpl = null)
{
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$uri = JFactory::getURI();
JHTML::stylesheet('media/com_phocagallery/css/administrator/phocagallery.css');
$this->field = JRequest::getVar('field');
$this->fce = 'phocaSelectFbAlbum_' . $this->field;
//$eName = JRequest::getVar('e_name');
//$eName = preg_replace( '#[^A-Z0-9\-\_\[\]]#i', '', $eName );
$uid = JRequest::getVar('uid', 0, '', 'int');
$db = JFactory::getDBO();
$query = 'SELECT a.*' . ' FROM #__phocagallery_fb_users AS a' . ' WHERE a.published = 1' . ' AND a.id = ' . (int) $uid . ' ORDER BY a.ordering';
$db->setQuery($query);
$user = $db->loadObject();
if (!isset($user->uid)) {
$this->userInfo = 0;
} else {
$session = PhocaGalleryFbSystem::setSessionData($user);
$this->albums = PhocaGalleryFb::getFbAlbums($user->appid, $user->fanpageid, $user->appsid, $session);
$this->userInfo = 1;
}
//$this->assignRef('tmpl', $tmpl);
parent::display($tpl);
}
示例12: edit
function edit($article, $params, $access, $attribs = array())
{
$user =& JFactory::getUser();
$uri =& JFactory::getURI();
$ret = $uri->toString();
if ($params->get('popup')) {
return;
}
if ($article->state < 0) {
return;
}
if (!$access->canEdit && !($access->canEditOwn && $article->created_by == $user->get('id'))) {
return;
}
JHTML::_('behavior.tooltip');
$url = 'index.php?view=article&id=' . $article->slug . '&task=edit&ret=' . base64_encode($ret);
$icon = $article->state ? 'edit.png' : 'edit_unpublished.png';
$text = JHTML::_('image.site', $icon, '/images/M_images/', NULL, NULL, JText::_('Edit'));
if ($article->state == 0) {
$overlib = JText::_('Unpublished');
} else {
$overlib = JText::_('Published');
}
$date = JHTML::_('date', $article->created);
$author = $article->created_by_alias ? $article->created_by_alias : $article->author;
$overlib .= '<br />';
$overlib .= JText::_($article->groups);
$overlib .= '<br />';
$overlib .= $date;
$overlib .= '<br />';
$overlib .= htmlspecialchars($author, ENT_COMPAT, 'UTF-8');
$button = JHTML::_('link', JRoute::_($url), $text);
$output = '<span class="hasTip" title="' . JText::_('Edit Item') . ' :: ' . $overlib . '">' . $button . '</span>';
return $output;
}
示例13: _displayDefault
function _displayDefault($tpl)
{
$option = JRequest::getCmd('option');
$mainframe =& JFactory::getApplication();
$uri =& JFactory::getURI();
$cid = JRequest::getCmd('cid');
$match_id = $cid[0];
$model =& $this->getModel();
/*
$filter_state = $mainframe->getUserStateFromRequest($option.'mc_filter_state', 'filter_state', '', 'word');
$filter_order = $mainframe->getUserStateFromRequest($option.'mc_filter_order', 'filter_order', 'mc.match_number', 'cmd');
$filter_order_Dir = $mainframe->getUserStateFromRequest($option.'mc_filter_order_Dir','filter_order_Dir', '', 'word');
$search = $mainframe->getUserStateFromRequest($option.'mc_search', 'search', '', 'string');
$search_mode = $mainframe->getUserStateFromRequest($option.'mc_search_mode', 'search_mode', '', 'string');
$division = $mainframe->getUserStateFromRequest($option.'mc_division', 'division', '', 'string');
$project_id = $mainframe->getUserState( $option . 'project' );
$search = JString::strtolower($search);
*/
$matches =& $this->get('Data');
$total =& $this->get('Total');
$pagination =& $this->get('Pagination');
$match = $model->getMatchData($match_id);
echo 'getModel<pre>' . print_r($model, true) . '</pre><br>';
$this->assignRef('homeplayer', $model->HomeTeamPlayer());
$this->assignRef('awayplayer', $model->AwayTeamPlayer());
$this->assignRef('matches', $matches);
$this->assignRef('match', $match);
$this->assignRef('pagination', $pagination);
$this->assignRef('lists', $lists);
$this->assignRef('request_url', $uri->toString());
parent::display($tpl);
}
示例14: getCategory
function getCategory($id)
{
$app = JFactory::getApplication();
if ($id > 0) {
$query = 'SELECT c.*,' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as slug ' . ' FROM #__phocagallery_categories AS c' . ' WHERE c.id = ' . (int) $id;
$this->_db->setQuery($query, 0, 1);
$category = $this->_db->loadObject();
$user = JFactory::getUser();
// USER RIGHT - ACCESS - - - - - -
$rightDisplay = 1;
//default is set to 1 (all users can see the category)
if (!empty($category)) {
$rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $category->accessuserid, $category->access, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0);
}
if ($rightDisplay == 0) {
$uri = JFactory::getURI();
$tmpl['pl'] = 'index.php?option=com_users&view=login&return=' . base64_encode($uri->toString());
$app->redirect(JRoute::_($tmpl['pl'], false), JText::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION'));
exit;
}
// - - - - - - - - - - - - - - - -
return $category;
}
return false;
}
示例15: getHTML
public static function getHTML($url, $sortItems = array(), $defaultSort = '', $filterItems = array(), $defaultFilter = '')
{
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
$cleanURL = $url;
$uri = JFactory::getURI();
$queries = $_REQUEST;
$allow = array('option', 'view', 'browse', 'task');
foreach ($queries as $key => $value) {
if (!in_array($key, $allow)) {
unset($queries[$key]);
}
}
$selectedSort = $jinput->get->get('sort', $defaultSort, 'STRING');
$selectedFilter = $jinput->get->get('filter', $defaultFilter, 'STRING');
$tmpl = new CTemplate();
$tmpl->set('queries', $queries);
$tmpl->set('selectedSort', $selectedSort);
$tmpl->set('selectedFilter', $selectedFilter);
$tmpl->set('sortItems', $sortItems);
$tmpl->set('uri', $uri);
$tmpl->set('filterItems', $filterItems);
$tmpl->set('jinput', $jinput);
return $tmpl->fetch('filterbar.html');
}