本文整理汇总了PHP中JURI::Base方法的典型用法代码示例。如果您正苦于以下问题:PHP JURI::Base方法的具体用法?PHP JURI::Base怎么用?PHP JURI::Base使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JURI
的用法示例。
在下文中一共展示了JURI::Base方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: inizialize
function inizialize($css_style, $offset, &$params)
{
$theme = $params->get('theme', 'blue');
JHtml::_('behavior.framework', true);
$doc = JFactory::getDocument();
$helper = new modRokajaxsearchHelper();
$css = $helper->getCSSPath('rokajaxsearch.css', 'mod_rokajaxsearch');
$iebrowser = $helper->getBrowser();
if ($css_style == 1 && $css != false) {
$doc->addStyleSheet($css);
$doc->addStyleSheet(JURI::root(true) . "/modules/mod_rokajaxsearch/themes/{$theme}/rokajaxsearch-theme.css");
if ($iebrowser) {
$style = JURI::root(true) . "/modules/mod_rokajaxsearch/themes/{$theme}/rokajaxsearch-theme-ie{$iebrowser}";
$check = dirname(__FILE__) . "/themes/{$theme}/rokajaxsearch-theme-ie{$iebrowser}";
if (file_exists($check . ".css")) {
$doc->addStyleSheet($style . ".css");
} elseif (file_exists($check . ".php")) {
$doc->addStyleSheet($style . ".php");
}
}
}
$doc->addScript(JURI::root(true) . "/modules/mod_rokajaxsearch/js/rokajaxsearch" . self::_getJSVersion() . ".js");
/* RokAjaxSearch Init */
$websearch = $params->get('websearch', 0) ? 1 : 0;
$blogsearch = $params->get('blogsearch', 0) ? 1 : 0;
$imagesearch = $params->get('imagesearch', 0) ? 1 : 0;
$videosearch = $params->get('videosearch', 0) ? 1 : 0;
$ras_init = "window.addEvent((window.webkit) ? 'load' : 'domready', function() {\n\t\t\t\twindow.rokajaxsearch = new RokAjaxSearch({\n\t\t\t\t\t'results': '" . JText::_('RESULTS') . "',\n\t\t\t\t\t'close': '',\n\t\t\t\t\t'websearch': " . $websearch . ",\n\t\t\t\t\t'blogsearch': " . $blogsearch . ",\n\t\t\t\t\t'imagesearch': " . $imagesearch . ",\n\t\t\t\t\t'videosearch': " . $videosearch . ",\n\t\t\t\t\t'imagesize': '" . $params->get('image_size', 'MEDIUM') . "',\n\t\t\t\t\t'safesearch': '" . $params->get('safesearch', 'MODERATE') . "',\n\t\t\t\t\t'search': '" . JText::_('SEARCH') . "',\n\t\t\t\t\t'readmore': '" . JText::_('READMORE') . "',\n\t\t\t\t\t'noresults': '" . JText::_('NORESULTS') . "',\n\t\t\t\t\t'advsearch': '" . JText::_('ADVSEARCH') . "',\n\t\t\t\t\t'page': '" . JText::_('PAGE') . "',\n\t\t\t\t\t'page_of': '" . JText::_('PAGE_OF') . "',\n\t\t\t\t\t'searchlink': '" . JRoute::_(JURI::Base() . htmlentities($params->get('search_page')), true) . "',\n\t\t\t\t\t'advsearchlink': '" . JRoute::_(JURI::Base() . htmlentities($params->get('adv_search_page')), true) . "',\n\t\t\t\t\t'uribase': '" . JRoute::_(JURI::Base(), true) . "',\n\t\t\t\t\t'limit': '" . $params->get('limit', '10') . "',\n\t\t\t\t\t'perpage': '" . $params->get('perpage', '3') . "',\n\t\t\t\t\t'ordering': '" . $params->get('ordering', 'newest') . "',\n\t\t\t\t\t'phrase': '" . $params->get('searchphrase', 'any') . "',\n\t\t\t\t\t'hidedivs': '" . $params->get('hide_divs', '') . "',\n\t\t\t\t\t'includelink': " . $params->get('include_link', 1) . ",\n\t\t\t\t\t'viewall': '" . JText::_('VIEWALL') . "',\n\t\t\t\t\t'estimated': '" . JText::_('ESTIMATED') . "',\n\t\t\t\t\t'showestimated': " . $params->get('show_estimated', 1) . ",\n\t\t\t\t\t'showpagination': " . $params->get('show_pagination', 1) . ",\n\t\t\t\t\t'showcategory': " . $params->get('include_category', 1) . ",\n\t\t\t\t\t'showreadmore': " . $params->get('show_readmore', 1) . ",\n\t\t\t\t\t'showdescription': " . $params->get('show_description', 1) . "\n\t\t\t\t});\n\t\t\t});";
$doc->addScriptDeclaration($ras_init);
/* Google API */
if ($params->get('websearch', 0) == 1 && $params->get('websearch_api') != '') {
$doc->addScript("http://www.google.com/jsapi?key=" . $params->get('websearch_api'));
$doc->addScriptDeclaration("google.load('search', '1.0', {nocss: true});");
}
}
示例2: __construct
/**
* Constructor
*
* @param object $params backend parameters
* @param int $module_id the id of the module
*/
public function __construct(&$params, $moduleid)
{
// Call the parent constructor
parent::__construct();
// Get the parameters
$this->_getParams($params);
// Include Javascripts if AJAX search activated
if ($this->getConfig('ajaxsearch') == 1) {
$searchurl = JURI::Base();
$doc = JFactory::getDocument();
// Include javascripts if not already done
JHtml::_('behavior.framework', true);
$doc->addScript(JURI::base() . 'media/mod_joomsearch/mod_joomsearch.js');
$jsstart = " window.addEvent('domready', function(){\n jsmod" . $moduleid . "=new JoomSearchModule({searchurl: '" . $searchurl . "', moduleid:" . $moduleid . ", noresultstxt:'" . JText::_('JSNORESULTS') . "', baseURL: '" . JURI::base() . "'});\n jsmod" . $moduleid . ".initoptions();\n });";
$doc->addScriptDeclaration($jsstart);
}
// Include common css
// TODO
// #js_searchform and #js_searchresults
// $doc->addStyleSheet(JURI::base().'modules/mod_joomsearch/assets/mod_joomsearch.css');
// Generate and include css
$this->_renderCSS($moduleid);
// Check cookie and fill the params for user panel
// first view = default backend parameters
// or existing cookie vars
$this->_checkCookie($moduleid);
}
示例3: loadAction
function loadAction($form, $actiondata)
{
$params = new JParameter($actiondata->params);
$output = '';
$mainframe =& JFactory::getApplication();
$document =& JFactory::getDocument();
JHTML::_('behavior.mootools');
$uri =& JFactory::getURI();
$CF_PATH = $mainframe->isSite() ? JURI::Base() : $uri->root();
$document->addScript($CF_PATH . 'administrator/components/com_chronoforms/form_actions/auto_javascript_validation/assets/auto_javascript_validation.js');
$rules = array('required', 'alpha', 'alphanum', 'digit', 'nodigit', 'number', 'email', 'phone', 'phone_inter', 'url', 'image');
ob_start();
?>
window.addEvent('domready', function() {
<?php
$object_list = array();
foreach ($rules as $rule) {
$fields_list = array();
if (trim($params->get($rule, ''))) {
$fields_list = explode(',', trim($params->get($rule, '')));
}
foreach ($fields_list as $k => $field) {
$fields_list[$k] = "'" . $field . "'";
}
$n_fields_list = implode(',', $fields_list);
$object_list[] = "'" . $rule . "': [" . $n_fields_list . "]";
}
?>
new AutoJavascriptValidation('<?php
echo $form->form_name;
?>
', <?php
echo "{" . implode(",", $object_list) . "}";
?>
);
});
<?php
$script = ob_get_clean();
if ((bool) $form->form_params->get('dynamic_files', 0) === false) {
$document->addScriptDeclaration("//<![CDATA[" . "\n" . $script . "\n" . "//]]>");
} else {
//load the action class
$form->loadActionHelper('load_js');
$CfactionLoadJsHelper = new CfactionLoadJsHelper();
$JSactiondata = new stdClass();
$JSactiondata->content1 = $script;
$JSParams = new JParameter('');
$JSParams->set('dynamic_file', $form->form_params->get('dynamic_files', 0));
$JSactiondata->params = $JSParams->toString();
$CfactionLoadJsHelper->load($form, $JSactiondata);
}
//load validation files
$form->loadActionHelper('show_html');
$CfactionShowHtmlHelper = new CfactionShowHtmlHelper();
$CfactionShowHtmlHelper->_loadValidationScripts($form);
}
示例4: getCSSPath
function getCSSPath($cssfile, $module)
{
global $mainframe;
$tPath = 'templates/' . $mainframe->getTemplate() . '/css/' . $cssfile . '-disabled';
$bPath = 'modules/' . $module . '/css/' . $cssfile;
// If the template is asking for it,
// don't include default rokajaxsearch css
if (!file_exists(JPATH_BASE . DS . $tPath)) {
return JURI::Base() . '/' . $bPath;
} else {
return false;
}
}
示例5: replaceImage
function replaceImage(&$row)
{
$regex = "/<img[^>]+src\\s*=\\s*[\"']\\/?([^\"']+)[\"'][^>]*\\>/";
$text = $row->introtext . $row->fulltext;
preg_match($regex, $text, $matches);
$images = count($matches) ? $matches : array();
if (count($images)) {
if (strpos($images[1], "http://") === false) {
$imgthr = JURI::Base();
} else {
$imgthr = '';
}
$image = $imgthr . $images[1] . $imgthr2;
}
return $image;
}
示例6: load
function load($form = null, $actiondata = null)
{
$params = new JParameter($actiondata->params);
$document =& JFactory::getDocument();
JHTML::_('behavior.mootools');
$mainframe =& JFactory::getApplication();
$uri =& JFactory::getURI();
$CF_PATH = $mainframe->isSite() ? JURI::Base() : $uri->root();
$document->addStyleSheet($CF_PATH . 'components/com_chronoforms/css/datepicker/datepicker_dashboard.css');
$document->addScript($CF_PATH . 'components/com_chronoforms/js/datepicker/datepicker.js');
$con_str = "'." . $params->get('field_class', 'cf_datetime_picker') . "', {pickerClass: '" . $params->get('pickerClass', 'datepicker_dashboard') . "', format: '" . $params->get('format', 'd-m-Y H:i:s') . "', inputOutputFormat: '" . $params->get('inputOutputFormat', 'Y-m-d H:i:s') . "', allowEmpty: " . $params->get('allowEmpty', 'true') . ", timePicker: " . $params->get('timePicker', 'true') . ", timePickerOnly: " . $params->get('timePickerOnly', 'false');
ob_start();
eval('?>' . $actiondata->content1);
$actiondata->content1 = ob_get_clean();
if (!empty($actiondata->content1)) {
$con_str .= ", " . $actiondata->content1;
$con_str .= "}";
} else {
$con_str .= "}";
}
ob_start();
?>
window.addEvent('load', function() {
new DatePicker(<?php
echo $con_str;
?>
);
});
<?php
$script = ob_get_clean();
if ((bool) $form->form_params->get('dynamic_files', 0) === false) {
$document->addScriptDeclaration("//<![CDATA[" . "\n" . $script . "\n" . "//]]>");
} else {
//load the action class
$form->loadActionHelper('load_js');
$CfactionLoadJsHelper = new CfactionLoadJsHelper();
$JSactiondata = new stdClass();
$JSactiondata->content1 = $script;
$JSParams = new JParameter('');
$JSParams->set('dynamic_file', $form->form_params->get('dynamic_files', 0));
$JSactiondata->params = $JSParams->toString();
$CfactionLoadJsHelper->load($form, $JSactiondata);
}
}
示例7: run
function run($form, $actiondata)
{
$mainframe =& JFactory::getApplication();
$uri =& JFactory::getURI();
$params = new JParameter($actiondata->params);
$CF_PATH = $mainframe->isSite() ? JURI::Base() : $uri->root();
$uri =& JFactory::getURI();
if ($uri->isSSL()) {
$CF_PATH = str_replace('http:', 'https:', $CF_PATH);
}
if ((bool) $params->get('encoded_image', 1) === false) {
$form->form_details->content = str_replace('{chronocaptcha_img}', ' <img src="' . $CF_PATH . 'components/com_chronoforms/chrono_verification.php?imtype=' . $params->get('fonts', 0) . '" alt="" />', $form->form_details->content);
} else {
ob_start();
$this->generate_encoded((int) $params->get('fonts', 0));
$imgbinary = ob_get_clean();
$form->form_details->content = str_replace('{chronocaptcha_img}', ' <img src="data:image/png;base64,' . base64_encode($imgbinary) . '" alt="" />', $form->form_details->content);
}
}
示例8: run
function run($form, $actiondata)
{
$mainframe =& JFactory::getApplication();
$uri =& JFactory::getURI();
$params = new JParameter($actiondata->params);
//save the data to db
$db_save_details = $actiondata;
$db_save_details->type = 'db_save';
$db_save_details->params = 'table_name=' . $params->get('table_name');
$form->data[trim($params->get('verify_field', 'verify'))] = md5(uniqid(rand(), true));
$form->data[trim($params->get('verification_status_field', 'verified'))] = 0;
if (trim($params->get('files_array_field', ''))) {
$form->data[trim($params->get('files_array_field'))] = var_export($form->files, true);
}
$form->runAction($db_save_details);
//add the verification link value to the data array
$CF_PATH = $mainframe->isSite() ? JURI::Base() : $uri->root();
$form->data['verification_link'] = $params->get('verification_link_path', $CF_PATH . 'index.php?option=com_chronoforms&chronoform=' . $form->form_name);
$form->data['verification_link'] .= '&action=verify&hash=' . $form->data[trim($params->get('verify_field', 'verify'))];
}
示例9: loadDynamic
function loadDynamic($form = null, $actiondata = null)
{
$document =& JFactory::getDocument();
$mainframe =& JFactory::getApplication();
$uri =& JFactory::getURI();
$CF_PATH = $mainframe->isSite() ? JURI::Base() : $uri->root();
//eval teh code
ob_start();
eval('?>' . $actiondata->content1);
$output = ob_get_clean();
//encode and send it
$code_encoded = $this->secure_serialize($output);
$get_string = 'code=' . $code_encoded;
$full_url = $CF_PATH . 'components/com_chronoforms/js/load_js.php?' . $get_string;
//check the url length, IE has a 2083 limit
if (strlen($full_url) < 2083) {
$document->addScript($CF_PATH . 'components/com_chronoforms/js/load_js.php?' . $get_string);
} else {
$this->loadScript($form, $actiondata);
}
}
示例10: attachments_attachmentButtonsHTML
function attachments_attachmentButtonsHTML($article_id, $Itemid, $from)
{
$document =& JFactory::getDocument();
$document->addScript(JURI::root(true) . '/media/system/js/modal.js');
JHTML::_('behavior.modal', 'a.modal-button');
// Generate the HTML for a button for the user to click to get to a form to add an attachment
$url = "index.php?option=com_attachments&task=upload&artid={$article_id}&tmpl=component";
if ($from) {
// Add a var to give a hint of where to return to
// $url .= "&from=$from";
$url .= "&from=closeme";
}
$url = JRoute::_($url);
$icon_url = JURI::Base() . 'components/com_attachments/media/add_attachment.gif';
$add_attachment_txt = JText::_('ADD ATTACHMENT');
$ahead = '<a class="modal-button" type="button" href="' . $url . '" ';
$ahead .= "rel=\"{handler: 'iframe', size: {x: 900, y: 550}}\">";
$links = "{$ahead}<img src=\"{$icon_url}\" alt=\"{$add_attachment_txt}\" /></a>";
$links .= $ahead . $add_attachment_txt . "</a>";
return "\n<div class=\"addattach\">{$links}</div>\n";
// The old way (save; may need for <noscript>)
// return "\n<div class=\"addattach\"><a href=\"$url\"><img src=\"$icon_url\" alt=\"\" /></a> <a href=\"$url\">" . JText::_('ADD ATTACHMENT') . "</a></div>\n";
}
示例11: onAfterRoute
function onAfterRoute()
{
global $mainframe;
if (defined('_JOOMLAFACEBOOK')) {
if (JRequest::getVar('auth_token') != null) {
if (JRequest::getVar('redirect') == 'admin') {
$mainframe->redirect(JURI::Base() . 'administrator/?auth_token=' . JRequest::getVar('auth_token'));
} else {
$credentials = array();
$credentials['username'] = 'FACEBOOK';
$credentials['password'] = JRequest::getVar('auth_token', '', 'get');
$mainframe->login($credentials);
$mainframe->redirect(JURI::Base());
}
}
if (JRequest::getVar('fb_sig_session_key', '', 'get') != null) {
$credentials = array();
$credentials['username'] = 'FACEBOOKSESSION';
$credentials['password'] = JRequest::getVar('fb_sig_session_key', '', 'get');
$mainframe->login($credentials);
}
}
return true;
}
示例12: defined
<?php
/*------------------WAMP Co., Ltd-----------------*/
/* Kien Thuc Kinh Te - kienthuckinhte.com */
/* MAIN CSS - WAMP Developed */
/* Email: minhnguyen@wampvn.com */
/*------------------------------------------------*/
// no direct access
defined('_JEXEC') or die('Restricted access');
function getParam($params, $param, $default = '')
{
return $params->get($param, $default);
}
$titlePage = trim(getParam($this->params, 'titlePage')) == '' ? JText::_('BV HOMECINEMA') : getParam($this->params, 'titlePage');
// define PATH to template
$site_path = JURI::Base();
$tmpl_sys_path = $site_path . 'templates/system/';
$app =& JFactory::getApplication();
$tmpl_path = JURI::base() . 'templates/' . $app->getTemplate() . '/';
define('WPPATH_TEMPL', $tmpl_path);
// Define Explore
// Opera - Safari - IE ... if(ereg("opera", $br)) {}
$br = strtolower($_SERVER['HTTP_USER_AGENT']);
示例13: defined
* @copyright Copyright (C) 2008 Bob Janes. All rights reserved.
* @license GNU/GPL, see LICENSE.php
*
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
// initialise plugin setup
$attribs = array();
$attribs['input'] = array('maxlength' => '150', 'size' => '80', 'class' => 'text_area');
$attribs['textarea'] = array('cols' => '50', 'rows' => '8');
$attribs['header'] = array('colspan' => '4', 'class' => 'cf_header');
$attribs['select'] = array('class' => 'cf_select');
$db =& JFactory::getDBO();
$doc =& JFactory::getDocument();
$script = $style = "";
$doc->addStyleSheet(JURI::Base() . 'components/com_chronocontact/css/plugin.css');
$messages = array();
// initialise extras
$extras = range(1, 10);
foreach ($extras as $k => $v) {
$extras[$k] = "extra{$v}";
}
foreach ($extras as $extra) {
${$extra} = new JParameter($row->{$extra});
}
jimport('joomla.html.pane');
$pane =& JPane::getInstance('tabs');
/**
* Content Component Query Helper
*
* @static
示例14: split
$document =& JFactory::getDocument();
$task = "show";
if (!empty($tagname)) {
$task = "tag";
// add tag name to page title
$document->setTitle($tagname);
// ... and to meta keywords
$keywords = split(',', $document->getMetaData('keywords'));
if (!in_array($tagname, $keywords)) {
$keywords[] = htmlspecialchars($tagname);
$document->setMetaData('keywords', implode(',', $keywords));
}
}
//TODO titolo della pagina quando si ricerca senza tag
if ($params->get('use_cp_css')) {
$document->addStyleSheet(JURI::Base() . '/components/com_customproperties/css/customproperties.css');
}
if ($params->get('show_page_title')) {
?>
<div class="componentheading<?php
echo $params->get('pageclass_sfx');
?>
">
<?php
echo $params->get('header');
?>
</div>
<?php
}
?>
示例15: display
/**
* Display the view
*/
function display($tpl = null, $error = false, $error_msg = false, $full_html = false)
{
$document =& JFactory::getDocument();
$document->addStyleSheet(JURI::base() . 'plugins/content/attachments.css', 'text/css', null, array());
$document->addStyleSheet(JURI::base() . 'plugins/content/attachments2.css', 'text/css', null, array());
$article_id = $this->article_id;
$save_url = JRoute::_($this->save_url);
$base_url = JURI::Base();
$params = $this->params;
// If this is a stand-alone page, generate the full html wrapper
if ($full_html) {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="<?php
echo $base_url;
?>
plugins/content/attachments.css"
rel="stylesheet" type="text/css" />
<link href="<?php
echo $base_url;
?>
plugins/content/attachments2.css"
rel="stylesheet" type="text/css" />
<link href="<?php
echo $base_url;
?>
templates/rhuk_milkyway/css/template.css"
rel="stylesheet" type="text/css" />
</head>
<body>
<?php
}
// Generate the list of existing attachments
echo AttachmentsHelper::attachmentsTableHTML($article_id, 'EXISTING ATTACHMENTS', false, false, $this->from);
// Prepare for error displays
$upload_id = 'upload';
$filename = $this->filename;
switch ($error) {
case 'no_file':
$upload_id = 'upload_warning';
$filename = '';
break;
case 'file_too_big':
$upload_id = 'upload_warning';
break;
case 'file_not_on_server':
$upload_id = 'upload_warning';
break;
}
// Display the form
?>
<form class="attachments" enctype="multipart/form-data" name="upload_form"
action="<?php
echo $save_url;
?>
" method="post">
<fieldset>
<legend><?php
echo JText::_('UPLOAD ATTACHMENT FILE');
?>
</legend>
<?php
if ($error_msg) {
?>
<div class="formWarning" id="formWarning"><?php
echo $error_msg;
?>
</div>
<?php
}
?>
<p><label for="<?php
echo $upload_id;
?>
"><b><?php
echo JText::_('ATTACH FILE COLON');
?>
</b></label>
<input type="file" name="upload" id="<?php
echo $upload_id;
?>
"
size="68" maxlength="512" /></p>
<p><label for="display_filename"
title="<?php
echo JText::_('DISPLAY FILENAME TOOLTIP');
?>
"
><b><?php
echo JText::_('DISPLAY FILENAME COLON');
?>
</b></label>
<input type="text" name="display_filename" id="display_filename" size="70" maxlength="80"
//.........这里部分代码省略.........