本文整理汇总了PHP中Juri类的典型用法代码示例。如果您正苦于以下问题:PHP Juri类的具体用法?PHP Juri怎么用?PHP Juri使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Juri类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getList
/**
* Function for getting the list of languages
*
* @return array Language list
*/
public static function getList()
{
$app = JFactory::getApplication();
$languages = JLanguageHelper::getLanguages();
$db = JFactory::getDbo();
$Itemid = $app->input->getInt('Itemid', 0);
$uri = new JURI(Juri::current());
$uri->delVar('lang');
$uri->delVar('Itemid');
$location = htmlspecialchars($uri->getQuery());
if (!empty($location)) {
$location .= '&';
}
if (!$Itemid) {
$active = $app->getMenu()->getActive();
if ($active) {
$Itemid = $active->id;
}
}
// For every language we load menu items language specific alias and params
foreach ($languages as $i => $language) {
$db->forceLanguageTranslation = $language->lang_code;
RMenu::resetJoomlaMenuItems();
$db->forceLanguageTranslation = false;
$languages[$i]->active = $language->lang_code == JFactory::getLanguage()->getTag();
$languages[$i]->link = RRoute::_('index.php?' . $location . 'lang=' . $language->sef . ($Itemid > 0 ? '&Itemid=' . $Itemid : ''));
}
// After we are done we reset it the way it was
RMenu::resetJoomlaMenuItems();
return $languages;
}
示例2: mark
function mark()
{
$markid = $this->input->getInt('markid');
$line = "option=com_jotcache&view=main";
$this->model->resetMark();
$uri = Juri::getInstance();
$domain = $uri->toString(array('host'));
$parts = explode('.', $domain);
$last = count($parts) - 1;
if ($last >= 1 && is_numeric($parts[$last]) === false) {
$domain = $parts[$last - 1] . '.' . $parts[$last];
}
switch ($markid) {
case 0:
setcookie('jotcachemark', '0', '0', '/', $domain);
$this->setRedirect('index.php?' . $line . "&filter_mark=", JText::_('JOTCACHE_RS_MSG_RESET'));
break;
case 1:
setcookie('jotcachemark', '1', '0', '/', $domain);
$this->setRedirect('index.php?' . $line, JText::_('JOTCACHE_RS_MSG_SET'));
break;
case 2:
setcookie('jotcachemark', '2', '0', '/', $domain);
$this->setRedirect('index.php?' . $line, JText::_('JOTCACHE_RS_MSG_RENEW'));
break;
default:
break;
}
}
示例3: getInput
/**
* Method to get the field input markup for a spacer.
* The spacer does not have accept input.
*
* @return string The field input markup.
*
* @since 11.1
*/
protected function getInput()
{
$apiHelper = new mauticApiHelper();
$settings = $apiHelper->getApiSettings();
$url = Juri::root() . 'administrator/?plugin=mautic';
$text = 'PLG_MAUTIC_AUTHORIZE_BTN';
if (!empty($settings['accessToken'])) {
$url .= '&reauthorize=true';
$text = 'PLG_MAUTIC_REAUTHORIZE_BTN';
} else {
$url .= '&authorize=true';
}
if (!empty($settings['clientKey']) && !empty($settings['clientSecret'])) {
// Note: style is added for Joomla 2.5
$btn = Jhtml::link($url, JText::_($text), array('class' => 'btn btn-small btn-success', 'style' => 'float: left;'));
if (!empty($settings['accessToken'])) {
$resetUrl = Juri::root() . 'administrator/?plugin=mautic&reset=true';
$btn .= ' <span style="float: left; padding: 0 4px;">|</span> ';
$btn .= Jhtml::link($resetUrl, JText::_('PLG_MAUTIC_RESET_BTN'), array('class' => 'btn btn-small btn-default pull-right', 'style' => 'float: left;'));
}
return $btn;
} else {
return JText::_('PLG_MAUTIC_SAVE_KEYS_FIRST');
}
}
示例4: display
public function display($tpl = null)
{
JHTML::stylesheet(Juri::base() . 'media/openhrm/assets/css/stylesheet.css');
JHTML::Script(Juri::base() . 'media/openhrm/assets/js/jwplayer/jwplayer.js');
$this->lesson = $this->get("Items");
$this->pagination = $this->get('Pagination');
// Display the view
parent::display($tpl);
}
示例5: getData
/**
* Get the necessary data for our stats report
*
* @return array
*/
public function getData()
{
$data = array();
$db = JFactory::getDbo();
$data['php'] = phpversion();
$data['mysql'] = $db->getVersion() . ' ' . $db->name;
$data['domain'] = Juri::root();
$data['joomla'] = JVERSION;
$data['os'] = php_uname();
$data['server'] = $_SERVER['SERVER_SOFTWARE'] . ' ' . (function_exists('php_sapi_name') ? php_sapi_name() : '');
$data['language'] = implode(',', array_keys(JLanguage::getKnownLanguages(JPATH_BASE)));
$data['timezone'] = JFactory::getConfig()->get('offset');
$data['extension'] = $this->extension;
$data['version'] = CompojoomComponentHelper::getManifest($this->extension)->get('version');
$data['config'] = $this->getConfig();
$customData = $this->getCustomExtensionData();
if ($customData) {
$data = array_merge($data, $customData);
}
return $data;
}
示例6: getFullUrl
public static function getFullUrl($file, $path)
{
$path = str_replace('administrator/', '', $path);
$url = Juri::base();
if (file_exists(JPATH_SITE . DS . $path . $file)) {
$url = str_replace('/administrator', '/', $url);
}
if (substr($url, -1) !== '/' && substr($path, 0, 1) !== '/') {
$url .= '/';
}
if (substr($path, -1) !== '/' && substr($file, 0, 1) !== '/') {
$path .= '/';
}
if (!defined('OPCVERSION')) {
include JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'config' . DS . 'version.php';
}
if (defined('OPCVERSION')) {
$v = str_replace('.', '_', OPCVERSION);
if (stripos($file, '?') === false) {
$file .= '?opcversion=' . $v;
}
}
return $url . $path . $file;
}
示例7: getInput
protected function getInput()
{
$template = basename(dirname(dirname(dirname(__FILE__))));
$directory = basename($this->element['directory']);
$viewonclick = "if (document.getElementById('" . $this->id . "').value) { SqueezeBox.open('" . Juri::root() . 'templates/' . $template . '/images/' . $directory . "/'+document.getElementById('" . $this->id . "').value); };";
$clearonclick = "document.getElementById('" . $this->id . "').value='';";
$html = '<div class="input-prepend input-append">
<a class="btn" title="View image" href="javascript:void(0);" onclick="' . $viewonclick . '" >
<i class="icon-eye"> </i>
</a>
<input type="text" class="input-small" name="' . $this->name . '" id="' . $this->id . '" value="' . $this->value . '" />
<a class="modal btn" title="Select an image"
href="index.php?option=com_jxtc&view=files&tmpl=component&fld=' . $this->id . '&id=' . JRequest::getInt('id') . '&f=' . $directory . '"
rel="{handler: \'iframe\', size: {x: 755, y: 495}}">' . JText::_('JSELECT') . '
</a>';
if (!$this->element['hide_none']) {
$html .= '<a class="btn btn-danger" title="' . JText::_('JLIB_FORM_BUTTON_CLEAR') . '" href="javascript:void(0);" onclick="' . $clearonclick . '">
<i class="icon-remove icon-white"></i>
</a>';
}
$html .= '</div>';
return $html;
}
示例8: foreach
<?php
foreach ($condominiums as $key => $condominium) {
$resourceName = "";
// BFCHelper::getLanguage($condominium->Name, $this->language);
//$route = JRoute::_('index.php?option=com_bookingforconnector&view=condominium&ResourceId=' . $condominium->CondominiumId . ':' . BFCHelper::getSlug($resourceName));
$currUri = $uri . '&resourceId=' . $condominium->CondominiumId . ':' . BFCHelper::getSlug($resourceName);
if ($itemId != 0) {
$currUri .= '&Itemid=' . $itemId;
}
$route = JRoute::_($currUri);
$merchantLat = $condominium->XGooglePos;
$merchantLon = $condominium->YGooglePos;
$showMerchantMap = $merchantLat != null && $merchantLon != null;
$merchantImageUrl = Juri::root() . "components/com_bookingforconnector/assets/images/defaults/default-s6.jpeg";
$routeInfoRequest = JRoute::_('index.php?option=com_bookingforconnector&view=merchantdetails&layout=contactspopup&tmpl=component&merchantId=' . $condominium->MerchantId . ':' . BFCHelper::getSlug($condominium->MerchantName));
$currUriMerchant = $uriMerchant . '&merchantId=' . $condominium->MerchantId . ':' . BFCHelper::getSlug($condominium->MerchantName);
if ($itemIdMerchant != 0) {
$currUriMerchant .= '&Itemid=' . $itemIdMerchant;
}
$routeMerchant = JRoute::_($currUriMerchant);
?>
<div class="<?php
echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_COL;
?>
12 com_bookingforconnector-item-col" >
<div class="com_bookingforconnector-search-merchant com_bookingforconnector-item <?php
echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_ROW;
?>
" >
示例9:
components/com_javoice/asset/images/rss.gif" alt="RSS help"/>
</a>
</div>
</div>
<?php
} else {
echo JText::_("PLEASE_CREATE_NEW_FORUM_AND_VOICE_TYPE");
}
?>
<!--< New Loading Image and Text >-->
<!-- Loading -->
<div id="loader">
<img src="<?php
echo Juri::root();
?>
components/com_javoice/asset/images/loading.gif" alt="<?php
echo JText::_("LOADER_TITLE");
?>
"/>
<?php
echo '<br>';
?>
<?php
echo JText::_('LOADING');
?>
</div>
<!--< End New Loading Image and Text >-->
<div id="jav-msg-loading" style="display:none"></div>
示例10: AND
$itemId = $itemIdMerchant;
}
$uriFav = 'index.php?option=com_bookingforconnector&view=resources&layout=favorites';
$db->setQuery('SELECT id FROM #__menu WHERE link LIKE ' . $db->Quote($uriFav) . ' AND (language=' . $db->Quote($language) . ' OR language=' . $db->Quote('*') . ') AND published = 1 LIMIT 1');
//$itemIdFav = ($db->getErrorNum())? 0 : intval($db->loadResult());
$itemIdFav = intval($db->loadResult());
//-------------------pagina per i l redirect di tutte le risorsein vendita
if ($itemIdFav != 0) {
$routeFav = JRoute::_($uriFav . '&Itemid=' . $itemIdFav);
} else {
$routeFav = JRoute::_($uriFav);
}
$img = JURI::root() . "/media/com_bookingfor/images/default.png";
$imgError = JURI::root() . "/media/com_bookingfor/images/default.png";
$merchantLogo = Juri::root() . "/media/com_bookingfor/images/default.png";
$offersDefault = Juri::root() . "/media/com_bookingfor/images/offertDefault.jpg";
$merchantLogoPath = BFCHelper::getImageUrlResized('merchant', "[img]", 'merchant_list_default');
$merchantLogoPathError = BFCHelper::getImageUrl('merchant', "[img]", 'merchant_list_default');
?>
<form action="<?php
echo htmlspecialchars(JFactory::getURI()->toString());
?>
" method="post" name="bookingforsearchForm" id="bookingforsearchForm">
<script type="text/javascript">
<!--
var urlCheck = "<?php
echo JRoute::_('index.php?option=com_bookingforconnector');
?>
";
var cultureCode = '<?php
echo $language;
示例11: clearHistoryUntil
/**
* Clear the history until the uri.
* Two uris are equal if their view and id vars are the same.
*
* @param mixed $uri The uri until
*
* @return void
*/
public function clearHistoryUntil($uri = null)
{
$history = $this->history->getQueue();
if (empty($history)) {
return;
}
if (null === $uri) {
$uri = str_replace(Juri::base(), '', Juri::getInstance()->toString());
}
$uri = new JURI($uri);
$view = $uri->getVar('view');
$id = $uri->getVar('id');
$newHistory = array();
foreach ($history as $oldLink) {
$oldUri = new Juri($oldLink);
$oldView = $oldUri->getVar('view');
$oldId = $oldUri->getVar('id');
if ($oldView === $view && $oldId === $id) {
break;
}
$newHistory[] = $oldLink;
}
$this->history->setQueue($newHistory);
}
示例12: natsort
<input class="radiobutton ckoption" type="radio" value="horizontal" id="orientationhorizontal" name="orientation" />
<label class="radiobutton first" for="orientationhorizontal" style="width:auto;" onclick="change_menu_orientation('horizontal')"><?php
echo JText::_('CK_HORIZONTAL');
?>
</label><input class="radiobutton ckoption" type="radio" value="vertical" id="orientationvertical" name="orientation" />
<label class="radiobutton" for="orientationvertical" style="width:auto;" onclick="change_menu_orientation('vertical')"><?php
echo JText::_('CK_VERTICAL');
?>
</label>
</div>
<hr />
<?php
$path = JPATH_ROOT . '/modules/mod_maximenuck/tmpl';
$files = JFolder::files($path, '.php');
natsort($files);
$i = 1;
echo '<div class="clearfix" style="min-height:35px;margin: 0 5px;">';
foreach ($files as $file) {
$thumb_title = '';
$file = JFile::stripExt($file);
if (file_exists($path . '/' . $file . '.png')) {
$thumb = Juri::root(true) . '/modules/mod_maximenuck/tmpl/' . $file . '.png';
} else {
$thumb = Juri::root(true) . '/administrator/components/com_maximenuck/images/what.png style="display:block;margin:0 auto;" width="90 height="90';
$thumb_title = JText::_('CK_LAYOUT_PREVIEW_NOT_FOUND');
}
$active = $layout == $file ? 'selected' : '';
echo '<div class="layoutthumb ' . $active . '" data-name="' . $file . '" onclick="change_layout(\'' . $file . '\')">' . '<img src="' . $thumb . '" style="margin:0;padding:0;" title="' . $thumb_title . '" class="hasTip" />' . '<div class="layoutname">' . $file . '</div>' . '</div>';
$i++;
}
echo '</div>';
示例13: getWebFilePath
/**
* Get the web path to a file
*
* @param string $file - the file name
* @param int $id - the id
* @param bool $isThumb - are we dealing with a thumb
*
* @return string
*/
public function getWebFilePath($file, $id, $isThumb = false)
{
$params = JComponentHelper::getParams($this->component);
$path = Juri::root() . $params->get('image_path', 'images') . '/' . $this->typeAlias . '/' . $id;
if ($isThumb) {
$path .= '/thumbs';
}
$path .= '/' . $file;
return $path;
}
示例14:
<?php
$document = JFactory::getDocument();
$document->addScript(Juri::base(true) . '/plugins/content/plg_clm_sbnrw_ext/modal.js');
$document->addStylesheet(Juri::base(true) . '/plugins/content/plg_clm_sbnrw_ext/modal.css');
示例15: defined
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$merchant = $this->item;
$sitename = $this->sitename;
$language = $this->language;
//$this->document->setTitle($this->item->Name);
//$this->document->setDescription( BFCHelper::getLanguage($this->item->Description, $this->language));
$this->document->setTitle(sprintf(JTEXT::_('COM_BOOKINGFORCONNECTOR_VIEW_MERCHANTDETAILS_RESOURCES_TITLE'), $merchant->Name, $sitename));
$db = JFactory::getDBO();
$uri = 'index.php?option=com_bookingforconnector&view=resource';
$db->setQuery('SELECT id FROM #__menu WHERE link LIKE ' . $db->Quote($uri) . ' AND (language=' . $db->Quote($language) . ' OR language=' . $db->Quote('*') . ') AND published = 1 LIMIT 1');
//$itemId = ($db->getErrorNum())? 0 : intval($db->loadResult());
$itemId = intval($db->loadResult());
$resourceImageUrl = Juri::root() . "media/com_bookingfor/images/default.png";
$merchantImageUrl = Juri::root() . "media/com_bookingfor/images/DefaultLogoList.jpg";
$resourceLogoPath = BFCHelper::getImageUrlResized('resources', "[img]", 'onsellunit_list_default');
$resourceLogoPathError = BFCHelper::getImageUrl('resources', "[img]", 'onsellunit_list_default');
$merchantLogoPath = BFCHelper::getImageUrlResized('merchant', "[img]", 'resource_list_merchant_logo');
$merchantLogoPathError = BFCHelper::getImageUrl('merchant', "[img]", 'resource_list_merchant_logo');
?>
<script type="text/javascript">
<!--
var cultureCode = '<?php
echo $language;
?>
';
//-->
</script>
<div class="com_bookingforconnector_merchantdetails com_bookingforconnector_merchantdetails-t<?php
echo BFCHelper::showMerchantRatingByCategoryId($merchant->MerchantTypeId);