public function getcontent() { $id = tadminhtml::idparam(); $menus = tmenus::i(); if ($id != 0 && !$menus->itemexists($id)) { return self::error403(); } $menu = tmenu::i($id); if (litepublisher::$options->group == 'author' && litepublisher::$options->user != $menu->author) { return self::error403(); } if ($id > 0 && !$menus->itemexists($id)) { return self::error403(); } $views = tviews::i(); $theme = tview::i($views->defaults['admin'])->theme; $html = tadminhtml::i(); $html->section = 'menu'; switch ($_GET['get']) { case 'view': $result = tadminviews::getcomboview($id == 0 ? $views->defaults['menu'] : $menu->idview); break; case 'seo': $args = targs::i(); $args->url = $menu->url; $args->keywords = $menu->keywords; $args->description = $menu->description; $args->head = $menu->data['head']; $result = $html->parsearg('[text=url] [text=description] [text=keywords] [editor=head]', $args); break; default: $result = var_export($_GET, true); } return turlmap::htmlheader(false) . $result; }
public function getcontent() { $result = parent::getcontent(); $plugin = tsourcefiles::i(); $result .= $plugin->getcachecontent('', ''); return $result; }
protected function create() { parent::create(); $this->cache = false; $this->data['subject'] = ''; $this->data['errmesg'] = ''; $this->data['success'] = ''; }
public function gethead() { $result = parent::gethead(); $result .= '<style type="text/css"> .faqlist p { display:none;} </style> <script type="text/javascript"> $(document).ready(function() { $("a[rel=\'faqitem\']").click(function() { $(this).parent().children("p").slideToggle(); return false; }); }); </script>'; return $result; }
private function menutostruct($id) { if (strbegin($id, 'menu_')) { $id = substr($id, strlen('menu_')); } $id = (int) $id; $menus = tmenus::i(); if (!$menus->itemexists($id)) { return xerror(404, "Sorry, no such page."); } $menu = tmenu::i($id); if ($menu->parent > 0) { $parent = tmenu::i($menu->parent); $ParentTitle = $parent->title; } else { $ParentTitle = ""; } $Result = array("dateCreated" => new IXR_Date(time()), "userid" => $menu->author, "page_id" => "menu_" . $menu->id, "page_status" => $menu->status == 'published' ? 'publish' : 'draft', "description" => $menu->content, "title" => $menu->title, "link" => $menu->url, "permaLink" => $menu->url, "categories" => array(), "excerpt" => '', "text_more" => '', "mt_allow_comments" => 0, "mt_allow_pings" => 0, "wp_slug" => $menu->url, "wp_password" => $menu->password, "wp_author" => 'ADMIN', "wp_page_parent_id" => "menu_" . $menu->parent, "wp_page_ParentTitle" => $ParentTitle, "wp_page_order" => $menu->order, "wp_author_id" => $menu->author, "wp_author_display_name" => 'ADMIN', "date_created_gmt" => new IXR_Date(time() - litepublisher::$options->gmt)); return $Result; }
public function getcontent() { $result = parent::getcontent(); $db = litepublisher::$db; $items = $db->res2items($db->query("select id, class from {$db->prefix}codedoc order by class")); if (count($items) == 0) { return $result; } tposts::i()->loaditems(array_keys($items)); $theme = tview::getview($this)->theme; $args = new targs(); $result .= '<ul class="doc_classes">'; $tml = '<li id="doc-class-$id"><a href="#">$class</a> $post.excerptcontent</li>'; foreach ($items as $id => $item) { $args->add($item); ttheme::$vars['post'] = tpost::i($id); $result .= $theme->parsearg($tml, $args); } $result .= '</ul>'; return $result; }
public function request($arg) { //$this->parseselectors(); if (isset($_GET['type'])) { $this->type = trim($_GET['type']) == 'left' ? 'left' : 'right'; } tlocal::usefile('themegenerator'); $lang = tlocal::i('themegenerator'); $this->colors = $lang->ini['themecolors']; parent::request($arg); if (isset($_POST['formtype']) && ($_POST['formtype'] == 'headerurl' || $_POST['formtype'] == 'logourl')) { return $this->formresult; } }
public function processform() { //dumpvar($_POST); $result = ''; switch ($this->name) { case 'views': $views = tviews::i(); $idview = (int) tadminhtml::getparam('idview', 0); if (!$idview || !$views->itemexists($idview)) { return ''; } if ($this->action == 'delete') { if ($idview > 1) { $views->delete($idview); } return ''; } $view = tview::i($idview); if ($idview > 1) { $view->customsidebar = isset($_POST['customsidebar']); $view->disableajax = isset($_POST['disableajax']); } $view->name = trim($_POST['name']); $view->themename = trim($_POST['theme_idview']); $view->menuclass = $_POST['menu']; $view->hovermenu = isset($_POST['hovermenu']); $this->set_custom($idview); if ($idview == 1 || $view->customsidebar) { $widgets = twidgets::i(); foreach (range(0, 2) as $index) { $view->sidebars[$index] = array(); $idwidgets = explode(',', trim($_POST["sidebar{$index}"])); foreach ($idwidgets as $idwidget) { $idwidget = (int) trim($idwidget); if (!$widgets->itemexists($idwidget)) { continue; } $view->sidebars[$index][] = array('id' => $idwidget, 'ajax' => isset($_POST["inline{$idwidget}"]) ? 'inline' : isset($_POST["ajax{$idwidget}"])); } } } $view->save(); break; case 'addview': $name = trim($_POST['name']); if ($name != '') { $views = tviews::i(); $id = $views->add($name); } break; case 'spec': foreach (self::getspecclasses() as $classname) { $obj = getinstance($classname); $obj->lock(); $obj->setidview($_POST["idview-{$classname}"]); if (isset($obj->data['keywords'])) { $obj->keywords = $_POST["keywords-{$classname}"]; } if (isset($obj->data['description '])) { $obj->description = $_POST["description-{$classname}"]; } if (isset($obj->data['head'])) { $obj->head = $_POST["head-{$classname}"]; } $obj->unlock(); } break; case 'group': switch ($_POST['action']) { case 'posts': $posts = tposts::i(); $idview = (int) $_POST['postview']; if (dbversion) { $posts->db->update("idview = '{$idview}'", 'id > 0'); } else { foreach ($posts->items as $id => $item) { $post = tpost::i($id); $post->idview = $idview; $post->save(); $post->free(); } } break; case 'menus': $idview = (int) $_POST['menuview']; $menus = tmenus::i(); foreach ($menus->items as $id => $item) { $menu = tmenu::i($id); $menu->idview = $idview; $menu->save(); } break; case 'themes': $themename = $_POST['themeview']; $views = tviews::i(); $views->lock(); foreach ($views->items as $id => $item) { $view = tview::i($id); $view->themename = $themename; $view->save(); } $views->unlock(); break; } break; case 'defaults': $views = tviews::i(); foreach ($views->defaults as $name => $id) { $views->defaults[$name] = (int) $_POST[$name]; } $views->save(); break; case 'headers': $template = ttemplate::i(); $template->heads = $_POST['heads']; $template->save(); $adminmenus = tadminmenus::i(); $adminmenus->heads = $_POST['adminheads']; $adminmenus->save(); $ajax = tajaxposteditor::i(); $ajax->lock(); $ajax->ajaxvisual = isset($_POST['ajaxvisual']); $ajax->visual = trim($_POST['visual']); $ajax->unlock(); litepublisher::$options->show_file_perm = isset($_POST['show_file_perm']); break; case 'admin': return $this->adminoptionsform->processform(); } ttheme::clearcache(); }
protected function create() { parent::create(); $this->data['type'] = ''; }
public function getcont() { if (litepublisher::$options->admincache) { $id = isset($_POST['id']) ? (int) $_POST['id'] : 0; $filename = 'adminmenu.' . litepublisher::$options->user . '.' . md5($_SERVER['REQUEST_URI'] . '&id=' . $id) . '.php'; if ($result = litepublisher::$urlmap->cache->get($filename)) { return $result; } $result = parent::getcont(); litepublisher::$urlmap->cache->set($filename, $result); return $result; } else { return parent::getcont(); } }
private function doaction($id, $action) { $menus = tmenus::i(); if (!$menus->itemexists($id)) { return $this->notfound; } $args = targs::i(); $html = $this->html; $h2 = $html->h2; $menuitem = tmenu::i($id); switch ($action) { case 'delete': if (!$this->confirmed) { $args->adminurl = $this->adminurl; $args->id = $id; $args->action = 'delete'; $args->confirm = sprintf($this->lang->confirm, tlocal::get('common', $action), $menus->getlink($id)); return $this->html->confirmform($args); } else { $menus->delete($id); return $h2->confirmeddelete; } case 'setdraft': $menuitem->status = 'draft'; $menus->edit($menuitem); return $h2->confirmedsetdraft; case 'publish': $menuitem->status = 'published'; $menus->edit($menuitem); return $h2->confirmedpublish; } return ''; }
public function __construct() { parent::__construct(); if ($id = $this->getowner()->class2id(get_class($this))) { $this->loaddata($id); } }