本文整理汇总了PHP中Backend::setNotice方法的典型用法代码示例。如果您正苦于以下问题:PHP Backend::setNotice方法的具体用法?PHP Backend::setNotice怎么用?PHP Backend::setNotice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Backend
的用法示例。
在下文中一共展示了Backend::setNotice方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hook_output
public static function hook_output($to_print)
{
//Construct the object to output
$object = new StdClass();
$object->result = $to_print;
$object->error = Backend::getError();
$object->notice = Backend::getNotice();
$object->success = Backend::getSuccess();
$object->content = Backend::getContent();
$last = '';
while (ob_get_level() > self::$ob_level) {
//Ending the ob_start from __construct
$last .= ob_get_clean();
}
$object->output = $last;
//Clean up
Backend::setError();
Backend::setNotice();
Backend::setSuccess();
//Return the XML
$options = array(XML_SERIALIZER_OPTION_INDENT => "\t", XML_SERIALIZER_OPTION_RETURN_RESULT => true, XML_SERIALIZER_OPTION_DEFAULT_TAG => 'item', XML_SERIALIZER_OPTION_XML_DECL_ENABLED => true, XML_SERIALIZER_OPTION_XML_ENCODING => Controller::$view->charset, XML_SERIALIZER_OPTION_ROOT_NAME => 'XmlResult', XML_SERIALIZER_OPTION_TYPEHINTS => true);
$serializer = new XML_Serializer($options);
if ($result = @$serializer->serialize($object)) {
return $result;
} else {
return null;
}
}
示例2: hook_output
public static function hook_output($to_print)
{
Backend::add('BackendErrors', Backend::getError());
Backend::add('BackendSuccess', Backend::getSuccess());
Backend::add('BackendNotices', Backend::getNotice());
Backend::add('BackendInfo', Backend::getInfo());
Backend::setError();
Backend::setSuccess();
Backend::setNotice();
Backend::setInfo();
$content = Backend::getContent();
if (empty($content)) {
ob_start();
var_dump($to_print);
$content = ob_get_clean();
if (substr($content, 0, 4) != '<pre') {
$content = '<pre>' . $content . '</pre>';
}
Backend::addContent($content);
}
$layout = Backend::get('HTMLLayout', 'index');
if (!Render::checkTemplateFile($layout . '.tpl.php')) {
if (SITE_STATE != 'production') {
Backend::addError('Missing Layout ' . $layout);
}
$layout = 'index';
}
$to_print = Render::file($layout . '.tpl.php');
$to_print = self::addLastContent($to_print);
$to_print = self::replace($to_print);
$to_print = self::rewriteLinks($to_print);
$to_print = self::addLinks($to_print);
$to_print = self::formsAcceptCharset($to_print);
//TODO fix this
if (Component::isActive('BackendFilter')) {
$BEFilter = new BEFilterObj();
$BEFilter->read();
$filters = $BEFilter->list ? $BEFilter->list : array();
foreach ($filters as $row) {
if (class_exists($row['class'], true) && is_callable(array($row['class'], $row['function']))) {
$to_print = call_user_func(array($row['class'], $row['function']), $to_print);
}
}
}
//TODO Make this configurable
if (ConfigValue::get('html_view.TidyHTML') && function_exists('tidy_repair_string')) {
$to_print = tidy_repair_string($to_print);
}
return $to_print;
}
示例3: hook_output
public static function hook_output($to_print)
{
Backend::add('BackendErrors', Backend::getError());
Backend::add('BackendSuccess', Backend::getSuccess());
Backend::add('BackendNotices', Backend::getNotice());
Backend::add('BackendInfo', Backend::getInfo());
Backend::setError();
Backend::setSuccess();
Backend::setNotice();
Backend::setInfo();
$content = Backend::getContent();
if (empty($content)) {
ob_start();
var_dump($to_print);
$content = ob_get_clean();
if (substr($content, 0, 4) != '<pre') {
$content = '<pre>' . $content . '</pre>';
}
Backend::addContent($content);
}
$to_print = Render::renderFile('styles.area.tpl.php');
$to_print .= Render::renderFile('maincontent.tpl.php');
$to_print .= Render::renderFile('scripts.tpl.php');
$to_print = HtmlView::addLastContent($to_print);
$to_print = HtmlView::replace($to_print);
$to_print = HtmlView::rewriteLinks($to_print);
$to_print = HtmlView::addLinks($to_print);
$to_print = HtmlView::formsAcceptCharset($to_print);
if (Component::isActive('BackendFilter')) {
$BEFilter = new BEFilterObj();
$BEFilter->read();
$filters = $BEFilter->list ? $BEFilter->list : array();
foreach ($filters as $row) {
if (class_exists($row['class'], true) && is_callable(array($row['class'], $row['function']))) {
$to_print = call_user_func(array($row['class'], $row['function']), $to_print);
}
}
}
return $to_print;
}
示例4: hook_output
public static function hook_output($to_print)
{
//Construct the object to output
$object = new stdClass();
$object->result = $to_print;
$object->error = Backend::getError();
$object->notice = Backend::getNotice();
$object->success = Backend::getSuccess();
$object->info = Backend::getInfo();
$object->content = Backend::getContent();
$last = '';
while (ob_get_level() > self::$ob_level) {
//Ending the ob_start from __construct
$last .= ob_get_clean();
}
$object->output = $last;
//Clean up
Backend::setError();
Backend::setNotice();
Backend::setSuccess();
Backend::setInfo();
//$result_only = Controller::getVar('result_only');
return json_encode($object);
}