本文整理汇总了PHP中System::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP System::getInstance方法的具体用法?PHP System::getInstance怎么用?PHP System::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System
的用法示例。
在下文中一共展示了System::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$system = System::getInstance();
$this->input = $system->getInputObject();
$this->log = $system->getLogger();
$this->load = $system->getLoaderObject();
$system->log('INFO', 'Model instantiated');
}
示例2: VerifyData
function VerifyData()
{
$system = System::getInstance();
$config = array();
$_POST['num_chars'] = $system->cleanVars($_POST, 'num_chars', 6, 'int');
foreach (array_keys($this->config) as $key) {
$config[$key] = $_POST[$key];
}
return $config;
}
示例3: __construct
public function __construct()
{
$system = System::getInstance();
$system->notifySystem($this);
// notify system about existence, so its possible to load models/views in child constructor
$this->load = $system->getLoaderObject();
$this->input = $system->getInputObject();
$this->log = $system->getLogger();
$system->log('INFO', 'Controller instantiated');
}
示例4: VerifyData
public function VerifyData()
{
$system = System::getInstance();
$config = array();
$_POST['disabled'] = $system->cleanVars($_POST, 'disabled', false, 'boolean');
$_POST['mode'] = $system->cleanVars($_POST, 'mode', 'image', 'string');
$_POST['name'] = $system->cleanVars($_POST, 'name', 'xoopscaptcha', 'string');
$_POST['skipmember'] = $system->cleanVars($_POST, 'skipmember', false, 'boolean');
$_POST['maxattempts'] = $system->cleanVars($_POST, 'maxattempts', 10, 'int');
foreach (array_keys($this->config) as $key) {
$config[$key] = $_POST[$key];
}
return $config;
}
示例5: VerifyData
function VerifyData()
{
$xoops = Xoops::getInstance();
$default_lang = array_search(ucfirst($xoops->getConfig('language')), $this->getLanguages());
$default_lang = !$default_lang ? 'en' : $default_lang;
$system = System::getInstance();
$config = array();
$_POST['private_key'] = $system->cleanVars($_POST, 'private_key', 'Your private key', 'string');
$_POST['public_key'] = $system->cleanVars($_POST, 'public_key', 'Your public key', 'string');
$_POST['theme'] = $system->cleanVars($_POST, 'theme', 'red', 'string');
$_POST['lang'] = $system->cleanVars($_POST, 'lang', $default_lang, 'string');
foreach (array_keys($this->config) as $key) {
$config[$key] = $_POST[$key];
}
return $config;
}
示例6: b_system_main_edit
function b_system_main_edit($options)
{
$xoops = Xoops::getInstance();
$system = System::getInstance();
$system_module = new SystemModule();
$admin_page = new \Xoops\Module\Admin();
// Define Stylesheet
$xoops->theme()->addStylesheet('media/xoops/css/icons.css');
$xoops->theme()->addStylesheet('modules/system/css/admin.css');
// Define scripts
$xoops->theme()->addScript('media/jquery/plugins/jquery.jeditable.js');
$xoops->theme()->addScript('modules/system/js/module.js');
$admin_page->addTips(SystemLocale::MENU_TIPS);
$admin_page->renderTips();
$list = $system_module->getModuleList();
$xoops->tpl()->assign('modules_list', $list);
return $xoops->tpl()->fetch('admin:system/system_modules_menu.tpl');
}
示例7: VerifyData
public function VerifyData()
{
$system = System::getInstance();
$config = array();
$_POST['num_chars'] = $system->cleanVars($_POST, 'num_chars', 6, 'int');
$_POST['casesensitive'] = $system->cleanVars($_POST, 'casesensitive', false, 'boolean');
$_POST['fontsize_min'] = $system->cleanVars($_POST, 'fontsize_min', 10, 'int');
$_POST['fontsize_max'] = $system->cleanVars($_POST, 'fontsize_max', 24, 'int');
$_POST['background_type'] = $system->cleanVars($_POST, 'background_type', 0, 'int');
$_POST['background_num'] = $system->cleanVars($_POST, 'background_num', 50, 'int');
$_POST['polygon_point'] = $system->cleanVars($_POST, 'polygon_point', 3, 'int');
$_POST['skip_characters'] = $system->cleanVars($_POST, 'skip_characters', 'o|0|i|l|1', 'string');
$_POST['skip_characters'] = explode('|', $_POST['skip_characters']);
foreach (array_keys($this->config) as $key) {
$config[$key] = $_POST[$key];
}
return $config;
}
示例8: cleanVarsForDB
public function cleanVarsForDB()
{
$system = System::getInstance();
foreach (parent::getValues() as $k => $v) {
if ($k !== 'dohtml') {
if ($this->vars[$k]['data_type'] == XOBJ_DTYPE_STIME || $this->vars[$k]['data_type'] == XOBJ_DTYPE_MTIME || $this->vars[$k]['data_type'] == XOBJ_DTYPE_LTIME) {
$value = $system->cleanVars($_POST[$k], 'date', date('Y-m-d'), 'date') + $system->cleanVars($_POST[$k], 'time', date('u'), 'int');
$this->setVar($k, isset($_POST[$k]) ? $value : $v);
} elseif ($this->vars[$k]['data_type'] == XOBJ_DTYPE_INT) {
$value = $system->cleanVars($_POST, $k, $v, 'int');
$this->setVar($k, $value);
} elseif ($this->vars[$k]['data_type'] == XOBJ_DTYPE_ARRAY) {
$value = $system->cleanVars($_POST, $k, $v, 'array');
$this->setVar($k, $value);
} else {
$value = $system->cleanVars($_POST, $k, $v, 'string');
$this->setVar($k, $value);
}
}
}
}
示例9: show
public function show($error = null)
{
$system = System::getInstance();
$ui = Ui::getInstance();
$ui->createPage();
// Header
$logo = "<img src='../images/integria_logo_header.png' style='border:0px;' alt='Home' >";
$title = "<div style='text-align:center;'>{$logo}</div>";
$hide_logout = $system->getRequest("hide_logout", false);
if ($hide_logout) {
$left_button = "";
} else {
$left_button = $ui->createHeaderButton(array('icon' => 'back', 'pos' => 'left', 'text' => __('Exit'), 'href' => 'index.php?action=logout'));
}
$ui->createHeader($title, $left_button, null, "logo");
$ui->showFooter();
$ui->beginContent();
//List of buttons
// Workunits
$options = array('icon' => 'star', 'pos' => 'right', 'text' => __('Workunits'), 'href' => 'index.php?page=workunit');
$ui->contentAddHtml($ui->createButton($options));
// Workorders
$options = array('icon' => 'info', 'pos' => 'right', 'text' => __('Workorders'), 'href' => 'index.php?page=workorders&filter_status=0&filter_owner=' . $system->getConfig('id_user'));
$ui->contentAddHtml($ui->createButton($options));
// Incidents
$options = array('icon' => 'alert', 'pos' => 'right', 'text' => __('Incidents'), 'href' => 'index.php?page=incidents');
$ui->contentAddHtml($ui->createButton($options));
// Calendars
$options = array('icon' => 'grid', 'pos' => 'right', 'text' => __('Calendars'), 'href' => 'index.php?page=calendars');
$ui->contentAddHtml($ui->createButton($options));
if (!empty($error)) {
$options = array('popup_id' => 'error_popup');
$ui->addWarningPopup($options);
$ui->contentAddHtml("<script type=\"text/javascript\">\n\t\t\t\t\t\t\t\t\t\t\$(document).on('pageshow', function() {\n\t\t\t\t\t\t\t\t\t\t\t\$(\"#error_popup\").popup(\"open\");\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t</script>");
}
$ui->endContent();
$ui->showPage();
return;
}
示例10: dirname
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* Users Manager
*
* @copyright XOOPS Project (http://xoops.org)
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @author Maxime Cointin (AKA Kraven30)
* @package system
* @version $Id$
*/
include dirname(dirname(__DIR__)) . '/header.php';
$xoops = Xoops::getInstance();
$system = System::getInstance();
if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) {
exit(XoopsLocale::E_NO_ACCESS_PERMISSION);
}
$xoops->logger()->quiet();
//$xoops->disableErrorReporting();
if (isset($_REQUEST["op"])) {
$op = $_REQUEST["op"];
} else {
@($op = "default");
}
switch ($op) {
// Display post
case 'display_post':
include_once $xoops->path('modules/system/include/functions.php');
$uid = $system->cleanVars($_REQUEST, 'uid', 'int');
示例11: showNoPermission
private function showNoPermission()
{
$system = System::getInstance();
audit_db($system->getConfig('id_user'), $REMOTE_ADDR, "ACL Violation", "Trying to access to workorder section");
$error['title_text'] = __('You don\'t have access to this page');
$error['content_text'] = __('Access to this page is restricted to
authorized users only, please contact to system administrator
if you need assistance. <br><br>Please know that all attempts
to access this page are recorded in security logs of Integria
System Database');
$home = new Home();
$home->show($error);
}
示例12: ajax
public function ajax($method = false)
{
$system = System::getInstance();
if (!$this->permission) {
return;
} else {
switch ($method) {
case 'load_more_workunits':
if ($this->offset == 1 || $this->offset > $this->getNumPages()) {
return;
} else {
$href = $system->getRequest('href', '');
echo $this->getWorkUnitsList($href, false, "", true);
}
break;
}
}
}
示例13: ajax
public function ajax($method = false)
{
$system = System::getInstance();
if (!$this->permission) {
return;
} else {
switch ($method) {
case 'getIncidentTypeFields':
$id_incident_type = $system->getRequest('id_incident_type');
$id_incident = $system->getRequest('id_incident');
$fields = incidents_get_all_type_field($id_incident_type, $id_incident);
$fields_final = array();
foreach ($fields as $f) {
$f["data"] = safe_output($f["data"]);
array_push($fields_final, $f);
}
echo json_encode($fields_final);
return;
}
}
}
示例14: ajax
public function ajax ($method = false) {
$system = System::getInstance();
if (!$this->permission) {
return;
}
else {
switch ($method) {
case 'get_calendar':
echo $this->getCalendar();
return;
}
}
}
示例15: defaultFooter
public function defaultFooter()
{
$system = System::getInstance();
if ($system->getConfig('enteprise') == 1) {
$enterprise = "Enterprise Edition";
} else {
$enterprise = "OpenSource Edition";
}
if (isset($_SERVER['REQUEST_TIME'])) {
$time = $_SERVER['REQUEST_TIME'];
} else {
$time = get_system_time();
}
return "<div id='footer' style='font-size: 12px; text-align: center;'>\n" . "Integria IMS {$enterprise} " . "<br />\n" . $system->getConfig('version') . " - Build " . $system->getConfig('build_version') . "<br />\n" . "</div>";
}