本文整理汇总了PHP中ApplicationController::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP ApplicationController::getInstance方法的具体用法?PHP ApplicationController::getInstance怎么用?PHP ApplicationController::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApplicationController
的用法示例。
在下文中一共展示了ApplicationController::getInstance方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showAll
function showAll()
{
if (!$this->isCached()) {
$ctrl =& ApplicationController::getInstance();
$o_lang = $ctrl->getLang();
$this->tpl->assign("link_forums", HREF_FORUMS);
$this->tpl->assign("translators_array", $o_lang->getArrayTranslators());
}
$this->display();
}
示例2: showAll
function showAll()
{
if (!$this->isCached()) {
$ctrl =& ApplicationController::getInstance();
$o_lang = $ctrl->getLang();
$this->tpl->assign("link_doc", array(HREF_DOC_OPEN, HREF_DOC_CLOSE));
$this->tpl->assign("translators_array", $o_lang->getArrayTranslators());
}
$this->display();
}
示例3: process
function process()
{
$o_mod = new ViewDataArray(null);
$o_mod->init($this->request);
//, $this->tpl);
$a_dataToLoad = array('config' => 'settingsconfig', 'os' => 'settingsos', 'osinterest' => 'settingsosinterest', 'browserstype' => 'settingsbrowserstype', 'browsers' => 'settingsbrowsers', 'browsersinterest' => 'settingsbrowsersinterest', 'plugins' => 'settingsplugins', 'resolutions' => 'settingsresolutions', 'resolutionsinterest' => 'settingsresolutionsinterest', 'normalwidescreen' => 'settingsnormalwidescreen');
foreach ($a_dataToLoad as $key => $value) {
$this->tpl->assign($key, $o_mod->showAll($value, true, true));
}
$ctrl =& ApplicationController::getInstance();
$o_request =& $ctrl->getRequest();
$o_request->setModuleName('view_settings');
}
示例4: __construct
function __construct( $pageName ) {
$this->application = ApplicationController::getInstance();
if(isset($_REQUEST["scaffolding"]) && "true" == $_REQUEST["scaffolding"]){
add_required_class( 'Scaffold.Controller.php', SCAFFOLD );
$this->application->loadScaffoldingSettings("");
$settings = $this->application->getSettings();
$actions = array(ACTION_LIST,ACTION_DELETE,ACTION_UPDATE,ACTION_FIND,ACTION_ADD);
$action = "";
/***
* we are going to change page=AddUsersPage to
* action = add
* table = Users
* page = DefaultScaffoldingPage
*
* this is because we want to pull out the information from the query string to make it simple, give it a dynamic url
* and we are only using one scaffolding page in ApplicationSettings->global->scaffolding->default_page, to skin the page
*/
foreach($actions as $actionType){
$ucActionType = ucfirst($actionType);
$regexAction = "/^{$ucActionType}/";
if(1 == preg_match($regexAction, $pageName)){
$action = $actionType;
break;
}
}
$table = preg_replace($regexAction, "", $pageName);
$table = preg_replace("/Page$/", "", $table);
$_REQUEST["action"] = $action;
$_REQUEST["table"] = $table;
$pageName = $settings["global"]["scaffolding"]["default_page"];
$_REQUEST["page"] = $pageName;
$this->scaffolding = ScaffoldController::getInstance($this->application);
}
if( $pageName ) {
$this->pageName = $pageName;
$this->url = PAGE_PATH . $this->pageName . PAGE_EXTENSION;
if( $this->urlExists( $this->url ) ) {
$this->log( "<!-- loading page $this->url -->" );
$this->isLoaded = $this->load( $this->url );
$this->tags = array( TEMPLATE_TAG, MODULES_TAG, DEPENDENCY_TAG, TITLE_TAG, MESSAGING_TAG );
$this->moduleList = array();
} else {
$this->log( "url not found: $this->url." );
}
}
}
示例5: init
/**
* Point d'entr�e de l'application
*
*/
function init()
{
$c =& PmvConfig::getInstance();
$Lang =& Lang::getInstance();
// id used for caching
define('SMARTY_CACHE_ID', md5(@$_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . serialize($_GET) . serialize($_POST) . (isset($_COOKIE[COOKIE_NAME_SESSION]) ? serialize($_COOKIE[COOKIE_NAME_SESSION]) : '') . $Lang->getFileName() . date("Y-m-d") . TIME_BEFORE_NEW_DAY_ARCHIVE . PHPMV_VERSION . INTERNAL_STATS));
setIncludePath();
$db =& Db::getInstance();
if (defined('DB_HOST')) {
$db->connect();
}
// try to set memory limit to MEMORY_LIMIT
setMemoryLimit();
$controller =& ApplicationController::getInstance();
$controller->loadLang();
$controller->parseRequest();
$controller->loadModule();
$controller->executeAction();
}
示例6: add_required_class
<?php
add_required_class('Application.Controller.php', CONTROLLER);
$application = ApplicationController::getInstance();
if (!$application->session->isSessionAuthenticated()) {
?>
<a href="login.php" target="login_module" class="trigger">Login</a>
<div class="lightbox" id="login_module">
<form action="<?php
echo CONTROLLER_PATH;
?>
User.Controller.php" method="GET" class="form">
<h3>Login</h3>
<p>
<input type="hidden" name="redirect" value="IndexPage" />
<input type="hidden" name="message" value="login" />
<label for="username_login">Username:</label><input type="text" name="username_login" id="username_login" value="username" validate="username"/>
</p>
<p>
<label for="password_login">Password:</label><input type="password" name="password_login" id="password_login" value="password" validate="password"/>
</p>
<p>
<input type="submit" name="submit" id="submit_login" value="Login >>" />
</p>
</form>
<h3>Dont't have an account?</h3>
<p>
<a href="login.php?action=register">Register</a> for an account with Techweaver Contractor Services now!
</p>
示例7: processDatas
/**
* Big job, assign all vars...
* Too much vars, those tasks should be splitted into more atomic methods
*
* @param object o_site
* @param object o_data
* @param object request
*
* @return void
*/
function processDatas(&$o_site, &$o_data, $request = null)
{
$ctrl =& ApplicationController::getInstance();
if (is_null($request)) {
$o_request =& $ctrl->getRequest();
} else {
$o_request =& $request;
}
$o_lang =& $ctrl->getLang();
if (!is_a($o_data, "DataModel")) {
//trigger_error("\$o_data is not an object DataModel! Maybe its because this is not a
//ViewModule and so you don't really need DataModel, you have to do without it...");
}
printTime('Begin Smarty display');
/*
* @todo , extact this from method!!
*/
$ajax_views = array("common/data_array_details.tpl", "common/data_array_interest.tpl", "common/data_array.tpl");
// Add path to theme
$this->assign("PMV_THEME", $this->template_dir[0]);
$this->assign("PMV_THEME_DEFAULT", $this->template_dir[1]);
$this->assign("PMV_STAT_ID_SITE", PMV_STAT_ID_SITE);
$this->assign("PMV_STAT_SAVE_USER", PMV_STAT_SAVE_USER);
// case we load a subtemplate with AJAX
if (in_array($this->template, $ajax_views)) {
$this->mainTemplate = $this->template;
} elseif ($o_request->isCategoryZoom()) {
$this->mainTemplate = "common/viewpages_details.tpl";
// printDebug($this->get_template_vars( "zoom"));
$t = $this->get_template_vars("zoomsorted");
//printDebug($t);
$this->assign("zoom", $t);
} else {
// case there are no visit for this period
if (is_a($o_data, "DataModel") && $o_request->getModuleName() !== 'view_sites_summary' && $o_data->getContent('nb_vis') == 0) {
$this->setTemplate("common/error.tpl");
if ($o_request->getModuleName() !== 'view_visits_rss') {
$this->assign("error_message_bis", sprintf($GLOBALS['lang']['generique_help_novisits'], "<a href='index.php?mod=admin_site_javascript_code'>", "</a>"));
}
}
// assign period, used in pages table to print the period text
$this->assign("period", $o_request->getPeriod());
if (is_a($o_site, 'Site')) {
// compute and assign calendar
$o_dasked = new Date($o_request->getDate());
$o_minDay = $o_site->getMinDay();
if ($o_dasked->getTimestamp() < $o_minDay->getTimestamp()) {
$s_dateAsked = $o_minDay->get();
} else {
$s_dateAsked = $o_dasked->get();
}
$a_calendar = getTemplateArrayCalendar($o_minDay, $s_dateAsked, $o_request->getPeriod());
$this->assign("calendar", $a_calendar);
// first day letters for calendar first line
if (!defined('MONDAY_FIRST') || MONDAY_FIRST == 'yes') {
$dayFirstLetter = $GLOBALS['lang']['calendrier_jours'];
} else {
for ($i = 0; $i < 7; $i++) {
$dayFirstLetter[$i == 6 ? 0 : $i + 1] = $GLOBALS['lang']['calendrier_jours'][$i];
}
ksort($dayFirstLetter);
}
$this->assign("day_first_letter", $dayFirstLetter);
// litteral date for display below the menu
$this->assign("date_litteral", getLiteralDate($o_request->getPeriod(), $s_dateAsked));
$this->assign("date_ask", $s_dateAsked);
// months info for SELECT months generation
$months_info = getTemplateArrayMonth($o_site->getMinDay(), $o_request);
$this->assign("months_available", $months_info[0]);
$this->assign("month_selected", $months_info[1]);
// sites info for SELECT sites generation
$this->assign("sites_view_available", $o_site->getAllowedSites('view'));
$this->assign("sites_admin_available", $o_site->getAllowedSites('admin'));
$this->assign("site_selected", $o_request->getSiteId(false));
$this->assign("site_selected_name", $o_site->getName());
// pdf list
$pdfConf = new PdfConfigDb($o_request->getSiteId(false), true);
$this->assign("site_pdf_list", $pdfConf->getListPdf());
}
// langs info for SELECT langs generation
$this->assign("langs_available", $o_lang->getArrayLangs());
$this->assign("lang_selected", $o_lang->getFileName());
// require menu definition and assign for menu display
$menu = array();
if (is_file(INCLUDE_PATH . '/themes/' . THEME . '/datas/MenuDefinition.php')) {
require INCLUDE_PATH . '/themes/' . THEME . '/datas/MenuDefinition.php';
} else {
require INCLUDE_PATH . '/themes/' . THEME_DEFAULT . '/datas/MenuDefinition.php';
}
//require INCLUDE_PATH . "/core/include/MenuDefinition.php";
//.........这里部分代码省略.........
示例8: buildList
private function buildList($action)
{
$objects = $this->scaffoldObject->find("all");
$length = count($objects);
if (0 == $length) {
$application = ApplicationController::getInstance();
$application->addMessage("Could not find and objects of type {$this->scaffoldObject->table_name}. Please create a new {$this->scaffoldObject->table_name} object.");
return;
}
$this->loadXML("<table></table>");
$root = $this->documentElement;
$root->setAttribute("class", "scaffolding_list");
$thead = $this->createElement("thead");
$keys = array_keys($objects[0]->values);
$tr = $this->createElement("tr");
foreach ($keys as $key) {
$td = $this->createElement("td", $key);
$tr->appendChild($td);
}
$thead->appendChild($tr);
$root->appendChild($thead);
$tbody = $this->createElement("tbody");
for ($i = 0; $i < $length; $i++) {
$tr = $this->createElement("tr");
$class = 0 == $i % 2 ? "scaffolding_list_row_even" : "scaffolding_list_row_odd";
$tr->setAttribute("class", $class);
foreach ($keys as $key) {
$td = $this->createElement("td", $objects[$i]->{$key});
$tr->appendChild($td);
}
$tbody->appendChild($tr);
}
$root->appendChild($tbody);
}