本文整理汇总了PHP中Factory::getApplication方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::getApplication方法的具体用法?PHP Factory::getApplication怎么用?PHP Factory::getApplication使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Factory
的用法示例。
在下文中一共展示了Factory::getApplication方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
Class constructor
@public
**/
function __construct($user_to_impersonate = null)
{
// get application instance
$this->__app =& Factory::getApplication();
$this->id = null;
$this->username = null;
$this->level = 'guest';
$this->parent = null;
$this->blocked = null;
$this->_loggedIn = false;
if (!is_null($user_to_impersonate)) {
return $this->_impersonate($user_to_impersonate);
}
if ($this->attemptSessionLogin()) {
return;
}
}
示例2: getCrumbs
/**
Get crumb tree
@public
**/
public static function getCrumbs()
{
$app =& Factory::getApplication();
$items = $app->get('crumbs');
$crumbs = array();
if ($items) {
foreach ($items as $item) {
if (is_array($item)) {
$html = "<a href=\"{link}\">{text}</a>\n";
if (isset($item['link'])) {
$html = str_replace('{link}', empty($item['link']) ? '#' : $item['link'], $html);
}
if (isset($item['text'])) {
$html = str_replace('{text}', empty($item['text']) ? '?' : $item['text'], $html);
}
} else {
$html = "<span>{$item}</span>\n";
}
$crumbs[] = $html;
}
}
return $crumbs;
}
示例3: define
<?php
define('DIR_BASE', '.');
define('DIR_LIB', DIR_BASE . '/lib');
define('DIR_TPL', DIR_BASE . '/tpl');
define('DIR_CONF', DIR_BASE . '/conf');
require_once DIR_LIB . '/factory.inc.php';
$app = Factory::getApplication();
$app->run();
Factory::releaseApplication($app);
示例4: tinymce
function tinymce($name, $value = '', $required = false, $rows = 10, $cols = 50, $params = null)
{
$app =& Factory::getApplication();
$config =& Factory::getConfig();
// set script source path
$baseURL = $config->baseURL;
$baseURL = str_replace(@$config->admin_path, '', $baseURL);
$app->set('js', $baseURL . 'assets/editors/tinymce/tiny_mce.js');
$show_format_1 = isset($params['buttons1_format']) && $params['buttons1_format'] ? true : false;
$show_buttons_2 = isset($params['buttons2']) && $params['buttons2'] ? true : false;
ob_start();
?>
<script>
tinyMCE.init({
// General options
mode : "exact",
elements : "<?php
echo $name;
?>
",
theme : "advanced",
skin : "o2k7",
skin_variant : "silver",
relative_urls : false,
remove_script_host : false,
invalid_elements: "script",
plugins : "safari,table,style,advimage,paste,advlink,inlinepopups,media,directionality",
// Theme options
content_css : "<?php
echo $baseURL;
?>
templates/<?php
echo $config->__raw->template;
?>
/assets/css/editor.css",
theme_advanced_buttons1 : "<?php
echo $show_format_1 ? 'formatselect,' : '';
?>
bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent,|undo,redo,|,pastetext,pasteword,|,link,unlink,image,|,code",
theme_advanced_buttons2 : "<?php
echo $show_buttons_2 ? 'tablecontrols,|,hr,removeformat' : '';
?>
",
theme_advanced_buttons3 : "<?php
echo $show_buttons_2 ? 'formatselect,fontselect,fontsizeselect' : '';
?>
",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "none"
<?php
if (isset($params['width'])) {
?>
,width: <?php
echo $params['width'];
?>
<?php
}
?>
<?php
if (isset($params['height'])) {
?>
,height: <?php
echo $params['height'];
?>
<?php
}
?>
// File manager (MFM)
,file_browser_callback : _loadMFM
});
function _loadMFM(field_name, url, type, win) {
tinyMCE.activeEditor.windowManager.open({
<?php
// build params for this plugin
$fm_params = array('base_path' => BASE_PATH, 'root_path' => $baseURL, 'editor_path' => $baseURL . 'assets/editors/tinymce', 'file_root' => 'uploads');
$fm_params = base64_encode(serialize($fm_params));
?>
file : "<?php
echo $baseURL;
?>
assets/editors/editor_plugins/mfm.php?field=" + field_name + "&url=" + url + "¶ms=<?php
echo $fm_params;
?>
",
title : 'File Manager',
width : 640,
height : 450,
resizable : "no",
inline : "yes",
close_previous : "no"
},
{
window : win,
input : field_name
});
return false;
//.........这里部分代码省略.........
示例5: _buildURIFromURL
/**
Create URI object from url
@param $url string
@private
**/
private static function _buildURIFromURL($url)
{
$__app =& Factory::getApplication();
$config = $__app->get('config');
$root_path = parse_url($config->baseURL);
$url_path = parse_url($url);
$uri = new stdclass();
$uri->_raw = $url;
$uri->_url = $url_path['path'];
if ($root_path['path'] == '/' && @$url[0] == '/') {
$uri->_url = substr($uri->_url, 1);
} else {
$uri->_url = str_replace($root_path['path'], '', $uri->_url);
}
return $uri;
}