/** * Lite Publisher * Copyright (C) 2010 - 2015 Vladimir Yushko http://litepublisher.ru/ http://litepublisher.com/ * Dual licensed under the MIT (mit.txt) * and GPL (gpl.txt) licenses. **/ function tlocalmergerInstall($self) { $dir = litepublisher::$paths->data . 'languages'; if (!is_dir($dir)) { @mkdir($dir, 0777); } @chmod($dir, 0777); $lang = litepublisher::$options->language; $self->lock(); $self->add('default', "lib/languages/{$lang}/default.ini"); $self->add('admin', "lib/languages/{$lang}/admin.ini"); $self->add('mail', "lib/languages/{$lang}/mail.ini"); if (litepublisher::$options->language != 'en') { $self->add('translit', "lib/languages/{$lang}/translit.ini"); } else { $self->items['translit'] = array('files' => array(), 'texts' => array()); } $self->add('install', "lib/languages/{$lang}/install.ini"); $self->addhtml('lib/languages/adminhtml.ini'); $self->addhtml('lib/languages/posteditor.ini'); $self->unlock(); //after install litepublisher::$options->timezone = tlocal::get('installation', 'timezone'); date_default_timezone_set(tlocal::get('installation', 'timezone')); $html = tadminhtml::i(); $html->loadinstall(); }
public function gethtml() { $result = tadminhtml::i(); $result->section = $this->section; $lang = tlocal::admin($this->section); return $result; }
public function processform() { $widget = tsubcatwidget::i(); $id = (int) tadminhtml::getparam('idwidget', 0); if (isset($widget->items[$id])) { $item = $widget->items[$id]; extract($_POST, EXTR_SKIP); $item['maxcount'] = (int) $maxcount; $item['showcount'] = isset($showcount); $item['showsubitems'] = isset($showsubitems); $item['sortname'] = $sort; $widget->items[$id] = $item; $widget->save(); return ''; } $tags = array(); foreach ($widget->items as $id => $item) { $tags[] = $item['idtag']; } $list = tposteditor::processcategories(); $add = array_diff($list, $tags); $delete = array_diff($tags, $list); if (count($add) == 0 && count($delete) == 0) { return ''; } $widget->lock(); foreach ($delete as $idtag) { $widget->tagdeleted($idtag); } foreach ($add as $idtag) { $widget->add($idtag); } $widget->unlock(); }
public function getcontent() { $plugin = tlivejournalposter::i(); $dir = dirname(__FILE__) . DIRECTORY_SEPARATOR; if ($plugin->template == '') { $plugin->template = file_get_contents($dir . 'livejournalposter.tml'); } $about = tplugins::getabout(tplugins::getname(__FILE__)); $lang = tplugins::getlangabout(__FILE__); $html = tadminhtml::i(); $html->section = $lang->section; $args = targs::i(); $args->add($about); $args->add($plugin->data); $args->public = 'public' == $plugin->privacy; $args->private = 'private' == $plugin->privacy; $args->friends = 'friends' == $plugin->privacy; return $html->adminform('[text=host] [text=login] [password=password] [text=community] <p><strong>$lang.privacy</strong> <label><input name="privacy" type="radio" value="public" $public/>$lang.public</label> <label><input name="privacy" type="radio" value="private" $private />$lang.private</label> <label><input name="privacy" type="radio" value="frinds" $friends/>$lang.friends</label> </p> [editor=template]', $args); }
public function processform() { $widget = texcerptslide::i(); $id = (int) tadminhtml::getparam('idwidget', 0); if (isset($widget->items[$id])) { $widget->items[$id]['maxcount'] = (int) $_POST['maxcount']; $widget->items[$id]['invertorder'] = isset($_POST['invertorder']); $widget->save(); litepublisher::$urlmap->clearcache(); return ''; } $tags = array(); foreach ($widget->items as $id => $item) { $tags[] = $item['idtag']; } $list = tposteditor::processcategories(); $add = array_diff($list, $tags); $delete = array_diff($tags, $list); if (count($add) == 0 && count($delete) == 0) { return ''; } $widget->lock(); foreach ($delete as $idtag) { $widget->tagdeleted($idtag); } foreach ($add as $idtag) { $widget->add($idtag); } $widget->unlock(); litepublisher::$urlmap->clearcache(); }
public static function getradio($idicon) { $items = self::getallicons(); if (count($items) == 0) { return ''; } $html = tadminhtml::i(); $html->section = 'files'; $args = targs::i(); //add empty icon $args->id = 0; $args->checked = 0 == $idicon; $args->filename = ''; $args->title = tlocal::i()->empty; $result = $html->radioicon($args); $files = tfiles::i(); $url = litepublisher::$site->files . '/files/'; foreach ($items as $id) { $item = $files->getitem($id); $args->add($item); $args->id = $id; $args->checked = $id == $idicon; $args->link = $url . $item['filename']; $result .= $html->radioicon($args); } return $result; }
public function getcontent() { $merger = tlocalmerger::i(); $tabs = new tuitabs(); $html = $this->html; $lang = tlocal::i('options'); $args = targs::i(); foreach ($merger->items as $section => $items) { $tab = new tuitabs(); $tab->add($lang->files, $html->getinput('editor', $section . '_files', tadminhtml::specchars(implode("\n", $items['files'])), $lang->files)); $tabtext = new tuitabs(); foreach ($items['texts'] as $key => $text) { $tabtext->add($key, $html->getinput('editor', $section . '_text_' . $key, tadminhtml::specchars($text), $key)); } $tab->add($lang->text, $tabtext->get()); $tabs->add($section, $tab->get()); } $tabs->add('HTML', $html->getinput('editor', 'adminhtml_files', tadminhtml::specchars(implode("\n", $merger->html)), $lang->files)); $args->formtitle = $lang->optionslocal; $args->dateformat = litepublisher::$options->dateformat; $dirs = tfiler::getdir(litepublisher::$paths->languages); $args->language = tadminhtml::array2combo(array_combine($dirs, $dirs), litepublisher::$options->language); $zones = timezone_identifiers_list(); $args->timezone = tadminhtml::array2combo(array_combine($zones, $zones), litepublisher::$options->timezone); return $html->adminform('[text=dateformat] [combo=language] [combo=timezone]' . $tabs->get(), $args); }
public function getcontent() { $result = ''; $this->basename = 'authors'; $users = tusers::i(); $lang = $this->lang; $html = $this->html; if ('delete' == $this->action) { $id = $this->idget(); if (!$users->itemexists($id)) { return $this->notfound(); } if (!$this->confirmed) { return $html->confirmdelete($id, $this->adminurl, $lang->confirmdelete); } if (!$this->deleteauthor($id)) { return $this->notfount; } $result .= $html->h4->deleted; } $args = new targs(); $perpage = 20; $total = $users->db->getcount("status = 'comuser'"); $from = $this->getfrom($perpage, $total); $res = $users->db->query("select * from {$users->thistable} where status = 'comuser' order by id desc limit {$from}, {$perpage}"); $items = litepublisher::$db->res2assoc($res); $result .= sprintf($html->h4->listhead, $from, $from + count($items), $total); $adminurl = $this->adminurl; $editurl = tadminhtml::getadminlink('/admin/users/', 'id'); $result .= $html->buildtable($items, array(array('left', $lang->author, '$name'), array('left', 'E-Mail', '$email'), array('left', $lang->website, '$website'), array('center', $lang->edit, "<a href='{$editurl}=\$id&action=edit'>{$lang->edit}</a>"), array('center', $lang->delete, "<a href='{$adminurl}=\$id&action=delete'>{$lang->delete}</a>"))); $theme = ttheme::i(); $result .= $theme->getpages($this->url, litepublisher::$urlmap->page, ceil($total / $perpage)); return $result; }
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() { $redir = tredirector::i(); $html = $this->html; $lang = $this->lang; $args = targs::i(); $from = tadminhtml::getparam('from', ''); if (isset($redir->items[$from])) { $args->from = $from; $args->to = $redir->items[$from]; } else { $args->from = ''; $args->to = ''; } $args->action = 'edit'; $args->formtitle = $lang->edit; $result = $html->adminform('[text=from] [text=to] [hidden=action]', $args); $id = 1; $items = array(); foreach ($redir->items as $from => $to) { $items[] = array('id' => $id++, 'from' => $from, 'to' => $to); } $adminurl = tadminhtml::getadminlink($this->url, 'from'); $args->table = $html->buildtable($items, array(array('center', '+', '<input type="checkbox" name="checkbox_$id" id="checkbox_$id" value="$from" />'), array('left', $lang->from, '<a href="$site.url$from" title="$from">$from</a>'), array('left', $lang->to, '<a href="$site.url$to" title="$to">$to</a>'), array('center', $lang->edit, "<a href=\"{$adminurl}=\$from\">{$lang->edit}</a>"))); $args->action = 'delete'; $result .= $html->parsearg('<form name="deleteform" action="" method="post"> [hidden=action] $table <p><input type="submit" name="delete" value="$lang.delete" /></p> </form>', $args); $result = $html->fixquote($result); return $result; }
public function getcontent() { $result = ''; $this->basename = 'downloaditems'; $html = $this->inihtml(); $lang = tlocal::admin('downloaditems'); $lang->ini['downloaditems'] = $lang->ini['downloaditem'] + $lang->ini['downloaditems']; $html->push_section('editor'); $downloaditem = tdownloaditem::i($this->idpost); ttheme::$vars['downloaditem'] = $downloaditem; $args = new targs(); $this->getpostargs($downloaditem, $args); $html->pop_section(); $args->downloadurl = $downloaditem->downloadurl; $args->authorname = $downloaditem->authorname; $args->authorurl = $downloaditem->authorurl; $args->version = $downloaditem->version; $types = array('theme' => tlocal::get('downloaditem', 'theme'), 'plugin' => tlocal::get('downloaditem', 'plugin')); $args->type = tadminhtml::array2combo($types, $downloaditem->type); if ($downloaditem->id > 0) { $result .= $html->headeditor(); } $result .= $html->form($args); $result = $html->fixquote($result); unset(ttheme::$vars['downloaditem']); return $result; }
public function processform() { $downloaditems = tdownloaditems::i(); if ($this->name == 'addurl') { $url = trim($_POST['url']); if ($url == '') { return ''; } if ($downloaditem = taboutparser::parse($url)) { $id = $downloaditems->add($downloaditem); litepublisher::$urlmap->redir(tadminhtml::getadminlink('/admin/downloaditems/editor/', "id={$id}")); } return ''; } $status = isset($_POST['publish']) ? 'published' : (isset($_POST['setdraft']) ? 'draft' : 'delete'); foreach ($_POST as $key => $id) { if (!is_numeric($id)) { continue; } $id = (int) $id; if ($status == 'delete') { $downloaditems->delete($id); } else { $downloaditem = tdownloaditem::i($id); $downloaditem->status = $status; $downloaditems->edit($downloaditem); } } }
public function processform() { $result = ''; $idview = tadminhtml::getparam('idview', 1); $view = tview::i($idview); if (isset($_POST['reparse'])) { $parser = tthemeparser::i(); try { $parser->reparse($view->theme->name); } catch (Exception $e) { $result = $e->getMessage(); } } else { if (empty($_POST['selection'])) { return ''; } try { $view->themename = $_POST['selection']; $result = $this->html->h2->success; } catch (Exception $e) { $view->themename = 'default'; $result = $e->getMessage(); } } ttheme::clearcache(); return $result; }
public function getcontent() { $html = tadminhtml::i(); $lang = tlocal::admin('polls'); $args = new targs(); //note to open admin menus $result = $html->h3->noteoptions; $polls = tpolls::i(); $man = tpollsman::i(); $args->addtopost = $man->addtopost; $items = array(); $polls->loadall_tml(); foreach ($polls->tml_items as $id => $tml) { $items[$id] = $tml['name']; } $args->pollpost = tadminhtml::array2combo($items, $man->pollpost); $args->lifetime = $man->lifetime; $args->formtitle = $lang->Options; $result .= $html->adminform(' [checkbox=addtopost] [combo=pollpost] [text=lifetime] ', $args); return $result; }
public function getcontent() { $widget = tpostcatwidget::i(); $about = tplugins::getabout(tplugins::getname(__FILE__)); $args = targs::i(); $id = (int) tadminhtml::getparam('idwidget', 0); if (isset($widget->items[$id])) { $item = $widget->items[$id]; $args->mode = 'edit'; $args->idwidget = $id; } else { $item = array('title' => '', 'content' => '', 'template' => 'widget', 'cats' => array()); $args->mode = 'add'; $args->idwidget = 0; } $cats = tposteditor::getcategories($item['cats']); $html = $this->html; $html->section = 'widgets'; $args->add($item); $args->widgettitle = $item['title']; $args->template = tadminhtml::array2combo(self::gettemplates(), $item['template']); $args->formtitle = $item['title'] == '' ? $this->lang->widget : $item['title']; $result = $html->adminform(' [text=widgettitle] [editor=content] [combo=template] [hidden=idwidget] [hidden=mode]' . sprintf('<h4>%s</h4>', $about['cats']) . $cats, $args); $result .= $this->getlist($widget); return $result; }
public function getcontent() { $result = ''; $types = tpolltypes::i(); $html = tadminhtml::i(); $lang = tlocal::admin('polls'); $args = new targs(); $type = isset($_GET['type']) ? $_GET['type'] : ''; if (isset($types->items[$type])) { $args->type = $type; $tabs = new tuitabs(); foreach ($types->items[$type] as $name => $value) { $args->{$name} = $value; $tabs->add($lang->{$name}, "[editor={$name}]"); } $args->formtitle = $lang->edittype; $result .= $html->adminform($tabs->get(), $args); } $result .= $html->h4->alltypes; $result .= '<ul>'; $adminurl = $html->getadminlink($this->url, 'type='); foreach ($types->items as $type => $item) { $result .= sprintf('<li><a href="%s%2$s" title="%2$s">%2$s</a></li>', $adminurl, $type); } $result .= '</ul>'; return $result; }
public static function processform($holder, $menu) { $id = (int) tadminhtml::getparam('id', 0); if ($id == 0) { $item = $menu->defaultitem; foreach ($item as $k => $v) { if (isset($_POST[$k])) { $item[$k] = $_POST[$k]; } } $id = $holder->db->add($item); $item['id'] = $id; $_POST['id'] = $id; $_GET['id'] = $id; } else { $item = $holder->getitem($id); foreach ($item as $k => $v) { if (isset($_POST[$k])) { $item[$k] = $_POST[$k]; } } $item['id'] = $id; $holder->db->update($item); } $holder->items[$id] = $item; }
public function gettab($html, $args, $lang) { $a = $this->getadmininfo($lang); $result = $html->p(sprintf($lang->odnoklass_reg, 'http://dev.odnoklassniki.ru/wiki/display/ok/How+to+add+application+on+site')); $result .= $html->getinput('text', "client_id_{$this->name}", tadminhtml::specchars($this->client_id), $a['client_id']); $result .= $html->getinput('text', "client_secret_{$this->name}", tadminhtml::specchars($this->client_secret), $a['client_secret']); $result .= $html->getinput('text', "public_key_{$this->name}", tadminhtml::specchars($this->public_key), $lang->odnoklass_public_key); return $result; }
/** * Lite Publisher * Copyright (C) 2010 - 2015 Vladimir Yushko http://litepublisher.ru/ http://litepublisher.com/ * Dual licensed under the MIT (mit.txt) * and GPL (gpl.txt) licenses. **/ function trssholdcommentsInstall($self) { $self->idurl = litepublisher::$urlmap->add($self->url, get_class($self), null, 'usernormal'); $html = tadminhtml::i(); $html->section = 'installation'; $self->template = $html->rsstemplate; $self->save(); tcomments::i()->changed = $self->commentschanged; }
public function processform() { $plugin = textrasidebars::i(); $plugin->beforepost = isset($_POST['beforepost']); $plugin->afterpost = isset($_POST['afterpost']); $plugin->themes = tadminhtml::check2array('theme-'); $plugin->save(); ttheme::clearcache(); }
public function getcontent() { $type = tadminhtml::getparam('type', 'tags') == 'tags' ? 'tags' : 'categories'; $tags = $type == 'tags' ? ttags::i() : tcategories::i(); if ($err = self::auth()) { return $err; } $id = tadminhtml::idparam(); if ($id > 0 && !$tags->itemexists($id)) { return self::error403(); } $theme = tview::i(tviews::i()->defaults['admin'])->theme; $html = tadminhtml::i(); $html->section = 'tags'; $lang = tlocal::i('tags'); if ($id == 0) { $views = tviews::i(); $name = $type == 'tags' ? 'tag' : 'category'; $item = array('title' => '', 'idview' => isset($views->defaults[$name]) ? $views->defaults[$name] : 1, 'idperm' => 0, 'icon' => 0, 'includechilds' => $tags->includechilds, 'includeparents' => $tags->includeparents, 'invertorder' => false, 'lite' => $tags->lite, 'liteperpage' => 1000, 'url' => '', 'keywords' => '', 'description' => '', 'head' => ''); } else { $item = $tags->getitem($id); } switch ($_GET['get']) { case 'view': if ($id > 0) { foreach (array('includechilds', 'includeparents', 'invertorder', 'lite') as $prop) { $item[$prop] = (int) $item[$prop] > 0; } } $args = new targs(); $args->add($item); $result = $html->parsearg('[checkbox=includechilds] [checkbox=includeparents] [checkbox=invertorder] [checkbox=lite] [text=liteperpage]', $args); $result .= $this->getviewicon($item['idview'], $item['icon']); $result .= tadminperms::getcombo($item['idperm']); break; case 'seo': $args = targs::i(); if ($id == 0) { $args->url = ''; $args->keywords = ''; $args->description = ''; $args->head = ''; } else { $args->add($tags->contents->getitem($id)); $args->url = $tags->items[$id]['url']; } $result = $html->parsearg('[text=url] [text=description] [text=keywords] [editor=head]', $args); break; case 'text': $result = $this->geteditor('raw', $id == 0 ? '' : $tags->contents->getcontent($id), true); $result .= $this->gethead(); break; default: $result = var_export($_GET, true); } return turlmap::htmlheader(false) . $result; }
public function gethtml($name = '') { $result = tadminhtml::i(); if ($name == '') { $name = 'login'; } $result->section = $name; $lang = tlocal::admin($name); return $result; }
public function getcontent() { $plugin = tmarkdownplugin::i(); $about = tplugins::getabout(tplugins::getname(__FILE__)); $args = targs::i(); $html = tadminhtml::i(); $args->formtitle = $about['name']; $args->data['$lang.deletep'] = $about['deletep']; $args->deletep = $plugin->deletep; return $html->adminform('[checkbox=deletep]', $args); }
public function getcontent() { $plugin = tyoutubeplayer::i(); $about = tplugins::getabout(tplugins::getname(__FILE__)); $args = targs::i(); $args->formtitle = $about['formtitle']; $args->data['$lang.template'] = $about['template']; $args->template = $plugin->template; $html = tadminhtml::i(); return $html->adminform('[editor:template]', $args); }
public function getcontent() { $plugin = tpostcontentplugin::i(); $html = tadminhtml::i(); $args = targs::i(); $about = tplugins::getabout(tplugins::getname(__FILE__)); $args->formtitle = $about['formtitle']; $args->data['$lang.before'] = $about['before']; $args->data['$lang.after'] = $about['after']; $args->before = $plugin->before; $args->after = $plugin->after; return $html->adminform('[editor=before] [editor=after]', $args); }
public function getpluginsmenu() { $result = ''; $link = tadminhtml::getadminlink($this->url, 'plugin='); $plugins = tplugins::i(); foreach ($this->names as $name) { $about = tplugins::getabout($name); if (isset($plugins->items[$name]) && !empty($about['adminclassname'])) { $result .= sprintf('<li><a href="%s%s">%s</a></li>', $link, $name, $about['name']); } } return sprintf('<ul>%s</ul>', $result); }
public function getcontent() { $plugin = ttagreplacer::i(); $html = tadminhtml::i(); $tabs = new tuitabs(); $args = targs::i(); $about = tplugins::getabout('tagreplacer'); $args->formtitle = $about['name']; $tabs->add($about['new'], $html->getinput('text', 'where-add', '', $about['where']) . $html->getinput('text', 'search-add', '', $about['search']) . $html->getinput('editor', 'replace-add', '', $about['replace'])); foreach ($plugin->items as $i => $item) { $tabs->add($item['where'], $html->getinput('text', "where-{$i}", tadminhtml::specchars($item['where']), $about['where']) . $html->getinput('text', "search-{$i}", tadminhtml::specchars($item['search']), $about['search']) . $html->getinput('editor', "replace-{$i}", tadminhtml::specchars($item['replace']), $about['replace'])); } return $html->adminform($tabs->get(), $args); }
public function getcontent() { $result = parent::getcontent(); $args = targs::i(); $args->script = $this->script; $args->ignorelink = $this->ignorelink; $about = tplugins::getabout(tplugins::getname(__FILE__)); $args->scriptlabel = $about['scriptlabel']; $args->ignorelinklabel = $about['ignorelink']; $tml = file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'form.tml'); $html = tadminhtml::i(); $result .= $html->parsearg($tml, $args); return $result; }
public function getcontent() { $ulogin = ulogin::i(); $html = tadminhtml::i(); $args = new targs(); $lang = tplugins::getnamelang('ulogin'); $args->formtitle = $lang->options; $args->panel = $ulogin->panel; $args->button = $ulogin->button; return $html->adminform(' [editor=panel] [editor=button] ', $args); }
public function processform() { $pages = tuserpages::i(); $pages->createpage = isset($_POST['createpage']); $pages->lite = isset($_POST['lite']); $pages->save(); $groups = tusergroups::i(); $groups->defaults = tadminhtml::check2array('idgroup-'); $groups->defaulthome = trim($_POST['defaulthome']); $groups->save(); $linkgen = tlinkgenerator::i(); $linkgen->data['user'] = $_POST['linkschema']; $linkgen->save(); }