本文整理汇总了PHP中Jaws_Utils::getBaseURL方法的典型用法代码示例。如果您正苦于以下问题:PHP Jaws_Utils::getBaseURL方法的具体用法?PHP Jaws_Utils::getBaseURL怎么用?PHP Jaws_Utils::getBaseURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jaws_Utils
的用法示例。
在下文中一共展示了Jaws_Utils::getBaseURL方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Display
/**
* Displays the emblems
*
* @access public
* @return string XHTML UI
*/
function Display()
{
$tpl = $this->gadget->template->load('Emblems.html');
$tpl->SetBlock('emblems');
$tpl->SetVariable('title', _t('EMBLEMS_ACTION_TITLE'));
$model = $this->gadget->model->load('Emblems');
$emblems = $model->GetEmblems(true);
if (!Jaws_Error::IsError($emblems)) {
$site = urlencode(Jaws_Utils::getBaseURL('/', false));
$page = urlencode(Jaws_Utils::getRequestURL(false));
$name = urlencode($this->gadget->registry->fetch('site_name', 'Settings'));
$slogan = urlencode($this->gadget->registry->fetch('site_slogan', 'Settings'));
$title = $GLOBALS['app']->Layout->GetTitle();
foreach ($emblems as $e) {
$e['url'] = str_replace(array('{url}', '{base_url}', '{requested_url}', '{site_name}', '{site_slogan}', '{title}'), array($page, $site, $page, $name, $slogan, $title), $e['url']);
$tpl->SetBlock('emblems/emblem');
$tpl->SetVariable('id', $e['id']);
$tpl->SetVariable('title', _t('EMBLEMS_TYPE_' . $e['type'], $e['title']));
$tpl->SetVariable('image', $GLOBALS['app']->getDataURL('emblems/' . $e['image']));
$tpl->SetVariable('url', $e['url']);
$tpl->ParseBlock('emblems/emblem');
}
}
$tpl->ParseBlock('emblems');
return $tpl->Get();
}
示例2: Jaws_Template
/**
* Class constructor
*
* @access public
* @param bool $loadFromTheme Try to load template from theme
* @param bool $loadGlobalVariables Fetch and set global variables
* @return void
*/
function Jaws_Template($loadFromTheme = false, $loadGlobalVariables = true)
{
$this->IdentifierRegExp = '[\\.[:digit:][:lower:]_-]+';
$this->BlockRegExp = '@<!--\\s+begin\\s+(' . $this->IdentifierRegExp . ')\\s+([^>]*)-->(.*)<!--\\s+end\\s+\\1\\s+-->@sim';
$this->VarsRegExp = '@{{\\s*(' . $this->IdentifierRegExp . ')\\s*}}@sim';
$this->IsBlockRegExp = '@##\\s*(' . $this->IdentifierRegExp . ')\\s*##@sim';
$namexp = '[[:digit:][:lower:]_]+';
$this->NewBlockRegExp = '@<!--\\s+begin\\s+(' . $namexp . ')\\s+' . '(?:if\\((!)?(' . $namexp . ')\\)\\s+|)' . '(?:loop\\((' . $namexp . ')\\)\\s+|)' . '-->(.*)<!--\\s+end\\s+\\1\\s+-->@sim';
$this->globalVariables['theme_url'] = '';
$this->globalVariables['.dir'] = _t('GLOBAL_LANG_DIRECTION') == 'rtl' ? '.rtl' : '';
$this->globalVariables['base_url'] = Jaws_Utils::getBaseURL('/');
$this->globalVariables['requested_url'] = Jaws_Utils::getRequestURL();
$this->globalVariables['base_script'] = BASE_SCRIPT;
if ($loadGlobalVariables) {
$this->loadFromTheme = $loadFromTheme;
$this->theme = $GLOBALS['app']->GetTheme();
$layout = $GLOBALS['app']->Layout->GetLayoutName() . '/';
$this->layout = @is_dir($this->theme['path'] . $layout) ? $layout : '';
$browser = $GLOBALS['app']->GetBrowserFlag();
$this->globalVariables['theme_url'] = $this->theme['url'];
$this->globalVariables['data_url'] = $GLOBALS['app']->getDataURL();
$this->globalVariables['.browser'] = empty($browser) ? '' : ".{$browser}";
$this->globalVariables['main_index'] = $GLOBALS['app']->mainIndex ? 'index' : '';
$this->globalVariables['main_gadget'] = strtolower($GLOBALS['app']->mainGadget);
$this->globalVariables['main_action'] = strtolower($GLOBALS['app']->mainAction);
} else {
$this->loadFromTheme = false;
}
}
示例3: Display
/**
* Builds the installer page.
*
* @access public
* @return string A block of valid XHTML to display an introduction and form.
*/
function Display()
{
$tpl = new Jaws_Template(false, false);
$tpl->Load('display.html', 'stages/Finished/templates');
$tpl->SetBlock('Finished');
$base_url = Jaws_Utils::getBaseURL('', true);
$tpl->setVariable('lbl_info', _t('INSTALL_FINISH_INFO'));
$tpl->setVariable('lbl_choices', _t('INSTALL_FINISH_CHOICES', "{$base_url}/", "{$base_url}/admin.php"));
$tpl->setVariable('lbl_thanks', _t('INSTALL_FINISH_THANKS'));
$tpl->SetVariable('move_log', _t('INSTALL_FINISH_MOVE_LOG'));
$tpl->ParseBlock('Finished');
// Kill the session
session_destroy();
return $tpl->Get();
}
示例4: define
* @category Application
* @package Core
* @author Jonathan Hernandez <ion@suavizado.com>
* @author Pablo Fischer <pablo@pablo.com.mx>
* @author Helgi Þormar <dufuz@php.net>
* @author Ali Fazelzadeh <afz@php.net>
* @copyright 2005-2015 Jaws Development Group
* @license http://www.gnu.org/copyleft/lesser.html
*/
define('JAWS_SCRIPT', 'index');
define('BASE_SCRIPT', basename(__FILE__));
// Redirect to the installer if JawsConfig can't be found.
$root = dirname(__FILE__);
if (!file_exists($root . '/config/JawsConfig.php')) {
require_once 'include/Jaws/Utils.php';
header('Location: ' . Jaws_Utils::getBaseURL('/') . 'install/index.php');
exit;
} else {
require $root . '/config/JawsConfig.php';
}
require_once JAWS_PATH . 'include/Jaws/InitApplication.php';
$IsIndex = false;
$objAction = null;
$IsReqActionStandAlone = false;
// Only registered user can access not global website
$AccessToWebsiteDenied = !$GLOBALS['app']->Session->Logged() && $GLOBALS['app']->Registry->fetch('global_website', 'Settings') == 'false';
// Get forwarded error from webserver
$ReqError = jaws()->request->fetch('http_error', 'get');
if (empty($ReqError) && $GLOBALS['app']->Map->Parse()) {
$ReqGadget = Jaws_Gadget::filter(jaws()->request->fetch('gadget'));
$ReqAction = Jaws_Gadget_Action::filter(jaws()->request->fetch('action'));
示例5: getRequestURL
/**
* Get request url
*
* @access public
* @param bool $rel_url relative or full URL
* @return string get url without base url
*/
static function getRequestURL($rel_url = true)
{
static $uri;
if (!isset($uri)) {
if (isset($_SERVER['REQUEST_URI']) && !empty($_SERVER['REQUEST_URI'])) {
$uri = $_SERVER['REQUEST_URI'];
} elseif (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
$uri = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
} else {
$uri = '';
}
$rel_base = Jaws_Utils::getBaseURL('', true);
$uri = substr($uri, strlen($rel_base));
}
return $rel_url ? ltrim($uri, '/') : Jaws_Utils::getBaseURL() . $uri;
}
示例6: buildXHTML
/**
* Build the XHTML
*
* @access public
* @return string XHTML content
*/
function buildXHTML()
{
$label = $this->_Label->GetValue();
if (!empty($label)) {
$this->_Container->PackStart($this->_Label);
}
$this->_Container->PackStart($this->TextArea);
$this->_Container->SetWidth($this->_Width);
$this->_XHTML .= $this->_Container->Get();
$extraPlugins = array();
$pluginDir = JAWS_PATH . 'libraries/ckeditor/plugins/';
if (is_dir($pluginDir)) {
$dirs = scandir($pluginDir);
foreach ($dirs as $dir) {
if ($dir[0] != '.' && is_dir($pluginDir . $dir)) {
if (!in_array($dir, $this->_DefaultPlugins)) {
$extraPlugins[] = $dir;
}
}
}
}
$tpl = new Jaws_Template();
$tpl->Load('CKEditor.html', 'include/Jaws/Resources');
$block = JAWS_SCRIPT == 'admin' ? 'ckeditor_backend' : 'ckeditor_frontend';
$tpl->SetBlock($block);
$tpl->SetVariable('name', $this->_Name);
$tpl->SetVariable('baseUrl', Jaws_Utils::getBaseURL('/', true));
$tpl->SetVariable('contentsLangDirection', $this->_Direction);
$tpl->SetVariable('language', $this->_Language);
$tpl->SetVariable('AutoDetectLanguage', 'false');
$tpl->SetVariable('autoParagraph', 'false');
$tpl->SetVariable('height', $this->_Height);
$tpl->SetVariable('skin', $this->_Skin);
$tpl->SetVariable('theme', $this->_Theme);
$tpl->SetVariable('readOnly', $this->_IsEnabled ? 'false' : 'true');
$tpl->SetVariable('resize_enabled', $this->_IsResizable ? 'true' : 'false');
$tpl->SetVariable('toolbar', json_encode($this->toolbars));
if (!empty($extraPlugins)) {
$tpl->SetBlock("{$block}/extra");
$tpl->SetVariable('extraPlugins', implode(',', $extraPlugins));
$tpl->ParseBlock("{$block}/extra");
}
// removed plugins
$tpl->SetVariable('removePlugins', $this->_RemovePlugins);
// direction
if ('rtl' == $this->_Direction) {
$tpl->SetVariable('contentsCss', 'gadgets/ControlPanel/Resources/ckeditor.rtl.css');
} else {
$tpl->SetVariable('contentsCss', 'gadgets/ControlPanel/Resources/ckeditor.css');
}
// FileBrowser
if (Jaws_Gadget::IsGadgetInstalled('FileBrowser')) {
$tpl->SetBlock("{$block}/filebrowser");
$tpl->SetVariable('filebrowserBrowseUrl', BASE_SCRIPT . '?gadget=FileBrowser&action=BrowseFile');
$tpl->SetVariable('filebrowserFlashBrowseUrl', BASE_SCRIPT . '?gadget=FileBrowser&action=BrowseFile');
$tpl->ParseBlock("{$block}/filebrowser");
}
// Phoo
if (Jaws_Gadget::IsGadgetInstalled('Phoo')) {
$tpl->SetBlock("{$block}/phoo");
$tpl->SetVariable('filebrowserImageBrowseUrl', BASE_SCRIPT . '?gadget=Phoo&action=BrowsePhoo');
$tpl->ParseBlock("{$block}/phoo");
}
// Directory
if (Jaws_Gadget::IsGadgetInstalled('Directory')) {
$tpl->SetBlock("{$block}/directory");
$tpl->SetVariable('filebrowserFlashBrowseUrl', BASE_SCRIPT . '?gadget=Directory&action=Browse');
$tpl->ParseBlock("{$block}/directory");
}
$tpl->ParseBlock($block);
$this->_XHTML .= $tpl->Get();
}
示例7: InstallSampleSite
/**
* Install some gadgets with default data
*
* @access public
* @return bool|Jaws_Error Either true on success, or a Jaws_Error
* containing the reason for failure.
*/
function InstallSampleSite()
{
$gadgets = array('Blog', 'Phoo', 'LinkDump', 'Contact', 'Menu', 'Emblems');
$variables = array();
$variables['Blog'] = array('timestamp' => Jaws_DB::getInstance()->date(), 'blog_content1_title' => _t('INSTALL_SAMPLE_BLOG_CONTENT1_TITLE'), 'blog_content1_summary' => _t('INSTALL_SAMPLE_BLOG_CONTENT1_SUMMARY'));
$variables['Phoo'] = array('timestamp' => Jaws_DB::getInstance()->date(), 'folder-path' => gmdate('Y_m_d'), 'siteurl' => Jaws_Utils::getBaseURL('/', false));
$variables['LinkDump'] = array('timestamp' => Jaws_DB::getInstance()->date(), 'linkdump_title1' => _t('INSTALL_SAMPLE_LINKDUMP_TITLE1'), 'linkdump_title2' => _t('INSTALL_SAMPLE_LINKDUMP_TITLE2'), 'linkdump_title3' => _t('INSTALL_SAMPLE_LINKDUMP_TITLE3'));
$variables['Contact'] = array();
$variables['Menu'] = array('timestamp' => Jaws_DB::getInstance()->date(), 'siteurl' => Jaws_Utils::getBaseURL('/', false), 'menu_title1' => _t('INSTALL_SAMPLE_MENU_TITLE1'), 'menu_title2' => _t('INSTALL_SAMPLE_MENU_TITLE2'), 'menu_title3' => _t('INSTALL_SAMPLE_MENU_TITLE3'), 'menu_title4' => _t('INSTALL_SAMPLE_MENU_TITLE4'));
$variables['Emblems'] = array();
// Install gadgets
foreach ($gadgets as $gadget) {
$objGadget = Jaws_Gadget::getInstance($gadget);
if (Jaws_Error::IsError($objGadget)) {
_log(JAWS_LOG_DEBUG, "There was a problem while loading sample gadget: {$gadget}");
_log(JAWS_LOG_DEBUG, $objGadget->getMessage());
} else {
$installer = $objGadget->installer->load();
$input_schema = JAWS_PATH . "install/stages/Settings/Sample/{$gadget}/insert.xml";
if (!file_exists($input_schema)) {
$input_schema = '';
}
$res = $installer->InstallGadget($input_schema, $variables[$gadget]);
if (Jaws_Error::IsError($res)) {
_log(JAWS_LOG_DEBUG, "There was a problem while installing sample gadget {$gadget}");
_log(JAWS_LOG_DEBUG, $res->getMessage());
} else {
_log(JAWS_LOG_DEBUG, "Sample gadget {$gadget} installed successfully.");
}
}
}
// Inserts layout sample itemes
$objGadget = Jaws_Gadget::getInstance('Layout');
if (Jaws_Error::IsError($objGadget)) {
_log(JAWS_LOG_DEBUG, "There was a problem while loading gadget: Layout");
_log(JAWS_LOG_DEBUG, $objGadget->getMessage());
} else {
$base_schema = JAWS_PATH . "gadgets/Layout/Resources/schema/schema.xml";
$input_schema = JAWS_PATH . "install/stages/Settings/Sample/Layout/insert.xml";
$installer = $objGadget->installer->load();
$res = $installer->installSchema($input_schema, '', $base_schema, true);
if (Jaws_Error::IsError($res)) {
_log(JAWS_LOG_DEBUG, "There was a problem while inserting sample itemes into gadget {$gadget}");
_log(JAWS_LOG_DEBUG, $res->getMessage());
} else {
_log(JAWS_LOG_DEBUG, "Sample itemes inserted into gadget {$gadget}.");
}
}
// set Blog as main gadget
$GLOBALS['app']->Registry->update('main_gadget', 'Blog', true, 'Settings');
// Copy Photo Organizer sample data
$source = JAWS_PATH . 'install/stages/Settings/Sample/Phoo/data/';
$destination = JAWS_DATA . 'phoo/' . $variables['Phoo']['folder-path'] . '/';
if (Jaws_Utils::copy($source, $destination)) {
_log(JAWS_LOG_DEBUG, "Sample data of gadget Phoo copied successfully.");
} else {
_log(JAWS_LOG_DEBUG, "There was a problem while copying sample data of gadget Phoo");
}
return true;
}
示例8: _t
}
$tpl->setBlock('page/message');
$tpl->setVariable('text', $GLOBALS['message']->getMessage());
$tpl->setVariable('type', $type);
$tpl->parseBlock('page/message');
}
$tpl->ParseBlock('page');
// Defines where the layout template should be loaded from.
$direction = _t('GLOBAL_LANG_DIRECTION');
$dir = $direction == 'rtl' ? '.' . $direction : '';
// Display the layout
$layout = new Jaws_Template(false, false);
$layout->Load('layout.html', 'templates');
$layout->SetBlock('layout');
// Basic setup
$layout->SetVariable('BASE_URL', Jaws_Utils::getBaseURL('/install/'));
$layout->SetVariable('.dir', $dir);
$layout->SetVariable('site-title', 'Jaws ' . JAWS_VERSION);
$layout->SetVariable('site-name', 'Jaws ' . JAWS_VERSION);
$layout->SetVariable('site-slogan', JAWS_VERSION_CODENAME);
// Load js files
$layout->SetBlock('layout/head');
$layout->SetVariable('ELEMENT', '<script type="text/javascript" src="../libraries/js/rsa.lib.js"></script>');
$layout->ParseBlock('layout/head');
// Display the stage
$layout->SetBlock('layout/main');
$layout->SetVariable('ELEMENT', $tpl->Get());
$layout->ParseBlock('layout/main');
$layout->ParseBlock('layout');
echo $layout->Get();
exit;