예제 #1
0
 public function laikas()
 {
     $page = new AdminPage();
     $panel = new TvarkymoPrognozavimas();
     $page->addToContainer(2, $panel->getHtml());
     $page->pagePrint();
 }
예제 #2
0
 public static function on_get_create_form(Context $ctx)
 {
     $node = Node::create('type', array('parent_id' => $parent_id, 'isdictionary' => true));
     $schema = $node->getFormFields();
     unset($schema['tags']);
     // unset($schema['fields']);
     $schema['isdictionary'] = new HiddenControl(array('value' => 'isdictionary', 'default' => 1));
     $form = $schema->getForm();
     $form->title = t('Добавление справочника');
     $form->addClass('tabbed');
     $form->action = "?q=nodeapi.rpc&action=create&type=type&destination=admin/content/dict";
     $form->addControl(new SubmitControl(array('text' => t('Добавить'))));
     $page = new AdminPage(html::em('content', array('name' => 'create'), $form->getXML($node)));
     return $page->getResponse($ctx);
 }
예제 #3
0
 public static function submenu(Context $ctx, $query, array $pathinfo)
 {
     AdminPage::checkperm($ctx, $pathinfo);
     $router = new Router();
     $router->poll($ctx);
     $menu = new AdminMenu($router->getStatic());
     if (false === ($submenu = $menu->getSubMenu($ctx))) {
         throw new PageNotFoundException();
     }
     if (false === ($content = $submenu->getXML($ctx, 'content', array('type' => 'submenu')))) {
         throw new PageNotFoundException();
     }
     $page = new AdminPage($content);
     return $page->getResponse($ctx);
 }
예제 #4
0
파일: search.php 프로젝트: gudwin/extasy
 public function __construct()
 {
     parent::__construct();
     $this->addGet('filter,term', 'searchForJqueryUI');
     $this->addPost('filter,term', 'searchForJqueryUI');
     $this->addGet('query,start,limit,callback', 'search');
 }
예제 #5
0
파일: Details.php 프로젝트: nburka/blorg
 protected function buildNavBar()
 {
     parent::buildNavBar();
     $this->navbar->popEntry();
     $this->navbar->addEntry(new SwatNavBarEntry($this->getComponentTitle(), $this->getComponentName()));
     $this->navbar->addEntry(new SwatNavBarEntry($this->tag->title));
 }
예제 #6
0
파일: apc.php 프로젝트: bitemyapp/Sblam
 function __construct(ISblamServices $s)
 {
     parent::__construct($s);
     if (!function_exists('apc_cache_info')) {
         throw new Exception("APC not installed");
     }
 }
예제 #7
0
 function save()
 {
     global $plugins;
     //Special considerations for the Google 404
     $aa404 = false;
     foreach ($plugins as $value) {
         if (isset($value['id']) && isset($_POST[$value['id']]) && !empty($_POST[$value['id']])) {
             if (strpos($_POST[$value['id']], "aagoog404") !== false) {
                 $aa404 = true;
             }
         }
     }
     if ($aa404) {
         if (!class_exists('AskApacheGoogle404')) {
             require_once TEMPLATEPATH . "/plugins/askapache-google-404/askapache-google-404.php";
         }
         $tmp = new AskApacheGoogle404();
         $tmp->activate();
     } else {
         if (!class_exists('AskApacheGoogle404')) {
             require_once TEMPLATEPATH . "/plugins/askapache-google-404/askapache-google-404.php";
         }
         $tmp = new AskApacheGoogle404();
         $tmp->deactivate();
     }
     parent::save();
 }
 function __construct()
 {
     parent::__construct();
     if (isset($_POST['name'])) {
         $this->error = $this->processForm();
         if (!$this->error) {
             header("Location: " . $this->SUCCESS_REDIRECT_PAGE);
             //Redirect to admin menu, if succeeded
         }
     } else {
         if (isset($_POST['reset_data'])) {
             $this->error = $this->processResetForm();
             if (!$this->error) {
                 header("Location: " . $this->SUCCESS_REDIRECT_PAGE);
                 //Redirect to admin menu, if succeeded
             } else {
                 if ($this->error == "project_deleted") {
                     header("Location: " . $this->LOGOUT_REDIRECT_PAGE);
                     //Redirect to admin menu, if succeeded
                 }
             }
         }
     }
     $this->setTitle(sprintf(Messages::getString('ManageProjectPage.Title'), $this->project->getName()));
     $this->menu = array(Messages::getString('General.AdminMenu') => "admin.php") + $this->menu;
 }
예제 #9
0
 public function build()
 {
     parent::build();
     header('Content-Type: ' . $this->photo->getMimeType($this->dimension_shortname));
     readfile($this->photo->getFilePath($this->dimension_shortname));
     exit;
 }
예제 #10
0
파일: index.php 프로젝트: gudwin/extasy
 public function __construct()
 {
     parent::__construct();
     $this->addPost('node', 'getData');
     $this->addPost('method,path,title', 'call');
     $this->addPost('method,path', 'call');
 }
예제 #11
0
파일: Index.php 프로젝트: nburka/blorg
 protected function buildInternal()
 {
     parent::buildInternal();
     $this->buildMessages();
     $this->buildSiteSettingsView();
     $this->buildAdSettingsView();
 }
예제 #12
0
 function __construct()
 {
     parent::__construct();
     $this->setTitle(sprintf("Enter results for %s:", $this->project->getName()));
     $this->menu = array("Admin Menu" => "admin.php") + $this->menu;
     $this->db = Database::getInstance();
 }
예제 #13
0
파일: aliases.php 프로젝트: gudwin/extasy
 public function __construct()
 {
     parent::__construct();
     $this->addGet('id', 'showAliases');
     $this->addPost('id,aliasId,delete', 'delete');
     $this->addPost('id,url,submit', 'add');
 }
예제 #14
0
 function __construct()
 {
     parent::__construct();
     $this->setTitle(sprintf(Messages::getString('EnterDataPage.Title'), $this->project->getName()));
     $this->menu = array(Messages::getString('General.AdminMenu') => "admin.php") + $this->menu;
     $this->db = Database::getInstance();
 }
예제 #15
0
 public function __construct()
 {
     parent::__construct();
     $this->addPost('sql', 'post');
     $this->addGet('dump', 'getDump');
     $this->addPost('import', 'import');
     if (empty($_SESSION['cms_sql_session'])) {
         $_SESSION['cms_sql_session'] = array();
     }
     $this->aSession =& $_SESSION['cms_sql_session'];
     // Не более десяти запросов
     if (sizeof($this->aSession) > 30) {
         array_shift($this->aSession);
     }
     // Сохраняем результат
     if (empty($_SESSION['cms_sql_result'])) {
         $_SESSION['cms_sql_result'] = array();
     }
     $this->aResult =& $_SESSION['cms_sql_result'];
     // Сохраняем ошибку
     if (empty($_SESSION['cms_sql_error'])) {
         $_SESSION['cms_sql_error'] = array();
     }
     $this->szError =& $_SESSION['cms_sql_error'];
 }
예제 #16
0
파일: config.php 프로젝트: gudwin/extasy
 public function __construct()
 {
     parent::__construct();
     $this->addPost('ssl,server,port,name,password,from_email,from_name', 'post');
     $this->title = 'Редактирование данных для аутентификации';
     $this->begin = array('Почта' => './index.php', $this->title => '#');
     $this->register = new SystemRegister('System/email');
 }
예제 #17
0
 public function getHTML($preset = null, array $options = array())
 {
     $this->setUp($preset);
     $data = $this->getData();
     $output = $data;
     $output .= $this->getPager();
     if ($raw = !empty($options['#raw'])) {
         unset($options['#raw']);
     }
     $options = array_merge(array('name' => 'list', 'title' => $this->title, 'preset' => $preset ? $preset : 'default', 'search' => $this->hidesearch ? null : 'yes', 'type' => $this->getType(), 'addlink' => $this->addlink, 'author' => $this->ctx->get('author')), $options);
     $output = html::em('content', $options, $output);
     if ($raw) {
         return $output;
     }
     $page = new AdminPage($output);
     return $page->getResponse($this->ctx);
 }
예제 #18
0
파일: edit.php 프로젝트: gudwin/extasy
 public function __construct()
 {
     parent::__construct();
     $this->addGet('id', 'showEditForm');
     $this->addPost('sitemapId,submit', 'post');
     $this->addPost('sitemapId,fieldName,action', 'ajaxEditColumn');
     $this->addPost('sitemapId,fieldnName,action,data', 'ajaxEditColumn');
 }
예제 #19
0
 /**
  * Вывод административной страницы. Вызывает обработчик, указанный в next,
  * предварительно проверив права пользователя.
  */
 public static function serve(Context $ctx, $path, array $pathinfo)
 {
     if (class_exists('APIStream')) {
         APIStream::init($ctx);
     }
     try {
         self::checkperm($ctx, $pathinfo);
         if (!$ctx->user->id and empty($pathinfo['anonymous'])) {
             throw new UnauthorizedException();
         }
         if (empty($pathinfo['next'])) {
             if (!empty($pathinfo['xsl'])) {
                 $pathinfo['next'] = 'AdminPage::xsltonly';
             } else {
                 throw new RuntimeException(t('Не указан обработчик для страницы %path (параметр <tt>next</tt>).', array('%path' => $path)));
             }
         }
         if (!is_callable($pathinfo['next'])) {
             throw new RuntimeException(t('Неверный обработчик для страницы %path (<tt>%next()</tt>).', array('%path' => $path, '%next' => $pathinfo['next'])));
         }
         $args = func_get_args();
         $output = call_user_func_array($pathinfo['next'], $args);
         if (!$output instanceof Response) {
             $xsl = empty($pathinfo['xsl']) ? null : implode(DIRECTORY_SEPARATOR, explode('/', $pathinfo['xsl']));
             $tmp = new AdminPage($output, $xsl);
             $output = $tmp->getResponse($ctx);
         }
         return $output;
     } catch (NotConnectedException $e) {
         Logger::trace($e);
         if (is_dir(os::path('lib', 'modules', 'install'))) {
             $ctx->redirect('install?destination=' . urlencode(MCMS_REQUEST_URI));
         } else {
             throw new RuntimeException('Система не проинсталлирована и модуля install нет.');
         }
     } catch (Exception $e) {
         Logger::trace($e);
         $data = array('status' => 500, 'error' => get_class($e), 'message' => $e->getMessage(), 'version' => MCMS_VERSION, 'release' => MCMS_RELEASE, 'base' => $ctx->url()->getBase($ctx), 'prefix' => MCMS_SITE_FOLDER . '/themes', 'back' => urlencode(MCMS_REQUEST_URI), 'next' => urlencode($ctx->get('destination')), 'clean' => !empty($_GET['__cleanurls']));
         if ($e instanceof UserErrorException) {
             $data['status'] = $e->getCode();
         }
         $xsl = os::path('lib', 'modules', 'admin', 'template.xsl');
         xslt::transform(html::em('page', $data), $xsl)->send();
     }
 }
예제 #20
0
 public function __construct()
 {
     parent::__construct();
     $this->addPost('tplFile,content,comment', 'post');
     $this->addPost('tplFile,content,comment', 'post');
     $this->addPost('tpl', 'create');
     $this->addPost('type,path', 'create');
     $this->addGet('tplFile', 'show');
 }
예제 #21
0
파일: regedit.php 프로젝트: gudwin/extasy
 public function __construct()
 {
     parent::__construct();
     $this->addGet('json', 'getData');
     $this->addPost('json', 'getData');
     $this->addPost('node', 'getData');
     $this->addPost('name,type,comment,value,parent,create', 'create');
     $this->addPost('id,name,comment,value,update', 'update');
     $this->addPost('delete', 'delete');
 }
예제 #22
0
 /**
  * Set a global variable containing the option values to be used throughout
  * the program.
  */
 private function set_global_variable()
 {
     $var_name = "";
     if (null != $this->config->global_variable) {
         $var_name = $this->config->global_variable;
     } else {
         $var_name = $this->page->get_slug() . '_options';
     }
     $GLOBALS[$var_name] = $this->options->get();
 }
예제 #23
0
파일: data-list.php 프로젝트: gudwin/extasy
 public function __construct()
 {
     parent::__construct();
     $this->addGet('parent,add', 'add');
     $this->addGet('parent,page', 'processParent');
     $this->addGet('parent', 'processParent');
     $this->addGet('page', 'main');
     $this->addPost('id,page,move_up', 'orderMoveUp');
     $this->addPost('id,page,move_down', 'orderMoveDown');
     $this->addPost('id', 'delete');
 }
예제 #24
0
 public function __construct($param)
 {
     global $_DIR;
     parent::__construct($param);
     $this->valid = new Validation();
     $function = isset($this->param[2]) ? $this->param[2] : '';
     $id = isset($this->param[3]) ? $this->param[3] : '';
     switch ($function) {
         case 'new':
             $this->tpl->assign('edit', false);
             $this->tpl->assign('new', true);
             $this->setIncludeTemplate('admin/admin_newUser.tpl');
             break;
         case 'add':
             if (!$this->validateFields()) {
                 $this->tpl->assign('edit', true);
                 $this->tpl->assign('new', true);
                 $this->tpl->assign('user', $this->tempUser);
                 $this->setIncludeTemplate('admin/admin_newUser.tpl');
             } else {
                 $this->addUser();
                 header('Location: ' . $_DIR['webRoot'] . '/' . $_DIR['adminPage'] . '/users/');
             }
             break;
         case 'edit':
             $this->tpl->assign('edit', true);
             $this->tpl->assign('new', false);
             $this->setIncludeTemplate('admin/admin_newUser.tpl');
             $this->getUser($id);
             break;
         case 'change':
             if (!$this->validateFields()) {
                 $this->tpl->assign('edit', true);
                 $this->tpl->assign('new', false);
                 $this->tpl->assign('user', $this->tempUser);
                 $this->setIncludeTemplate('admin/admin_newUser.tpl');
             } else {
                 $this->editUser($id);
                 header('Location: ' . $_DIR['webRoot'] . '/' . $_DIR['adminPage'] . '/users/');
             }
             break;
         case 'delete':
             $this->deleteUser($id);
             header('Location: ' . $_DIR['webRoot'] . '/' . $_DIR['adminPage'] . '/users/');
             break;
         default:
             $this->setIncludeTemplate('admin/admin_userPage.tpl');
             $this->getUsers();
             break;
     }
     $this->tpl->assign('error', $this->errorMessage);
 }
예제 #25
0
파일: Index.php 프로젝트: gauthierm/pinhole
 public function finalize()
 {
     parent::finalize();
     $this->layout->addHtmlHeadEntrySet(XML_RPCAjax::getHtmlHeadEntrySet());
     $yui = new SwatYUI(array('dom', 'event'));
     $this->layout->addHtmlHeadEntrySet($yui->getHtmlHeadEntrySet());
     $this->layout->addHtmlHeadEntry(new SwatJavaScriptHtmlHeadEntry('packages/pinhole/admin/javascript/pinhole-geo-tag-map.js', Pinhole::PACKAGE_ID));
     $this->layout->addHtmlHeadEntry(new SwatStyleSheetHtmlHeadEntry('packages/pinhole/admin/styles/pinhole-geo-tag-index.css', Pinhole::PACKAGE_ID));
     $this->layout->startCapture('html_head_entries');
     echo "\n\n<!-- head entries for Google Maps -->\n";
     printf('<script src="http://maps.google.com/maps?file=api&amp;' . 'v=2&amp;sensor=false&amp;key=%s"></script>', $this->app->config->pinhole->google_maps_admin_api_key);
     echo "\n\n";
     $this->layout->endCapture();
 }
예제 #26
0
 function __construct()
 {
     parent::__construct();
     $db = Database::getInstance();
     $this->pdfTexts = $db->getProjectPdfTexts($this->project->getId());
     //Construct access URL:
     if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
         $this->url = 'https://';
     } else {
         $this->url = 'http://';
     }
     $PHP_SELF = $_SERVER['PHP_SELF'];
     $this->url .= $_SERVER['HTTP_HOST'] . substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'));
 }
예제 #27
0
파일: config.php 프로젝트: gudwin/extasy
 function __construct($aBegin, $szTitle, $szConfigPath, $aButton = array())
 {
     parent::__construct();
     $this->addPost('submit', 'post');
     $this->config = new Config();
     $this->path = $szConfigPath;
     $aResultBegin = array();
     foreach ($aBegin as $key => $row) {
         $aResultBegin[_msg($key)] = $row;
     }
     $this->aBegin = $aResultBegin;
     $this->szTitle = _msg($szTitle);
     $this->aButton = $aButton;
 }
예제 #28
0
파일: edit.php 프로젝트: gudwin/extasy
 protected function output()
 {
     // Вывод начала
     $controls = $this->schema->selectTabbedControls();
     // Сортируем вкладки по алфавиту
     ksort($controls);
     $title = sprintf('Редактирование "%s"', $this->schema->getTitle());
     $sheets = $this->getTabSheets($controls);
     if ($this->schema->getSitemapLink() == 0) {
         $begin = array($title => '#');
     } else {
         $parents = Sitemap_CMS::getParents($this->schema->getSitemapLink());
         $begin = Sitemap_CMS::selectBegin($parents, $title);
     }
     $this->outputHeader($begin, $title, array(), array(), $this->embed);
     $this->outputEditingForm($sheets, $controls);
     parent::output();
 }
예제 #29
0
 /**
  * Constructor Checking which page to show and manage the templates
  * @param string $param Parameter given with the url
  */
 public function __construct($param)
 {
     global $_DIR;
     parent::__construct($param);
     $function = isset($this->param[2]) ? $this->param[2] : '';
     $id = isset($this->param[3]) ? $this->param[3] : '';
     if (isset($_POST['guest_id']) || isset($_POST['title']) || isset($_POST['text'])) {
         $this->postFields = array('guest_id' => $_POST['guest_id'], 'title' => $_POST['title'], 'content' => $_POST['text']);
     }
     switch ($function) {
         case 'edit':
             $this->tpl->assign('edit', true);
             $this->getBlogItem($id);
             $this->getGuests();
             $this->getGuest($this->dbBlog->guest_id);
             $this->getCategories();
             $this->setIncludeTemplate('admin/admin_newBlogItem.tpl');
             break;
         case 'change':
             $this->editBlogItem($id);
             header('Location: ' . $_DIR['webRoot'] . '/' . $_DIR['adminPage'] . '/blogs/');
             break;
         case 'ip':
             $this->banGuest($id, 'ip');
             $this->hideBlogByIp($this->dbGuest->ip);
             header('Location: ' . $_DIR['webRoot'] . '/' . $_DIR['adminPage'] . '/blogs/');
             break;
         case 'guest':
             $this->banGuest($id, 'guest');
             $this->hideBlog($id);
             header('Location: ' . $_DIR['webRoot'] . '/' . $_DIR['adminPage'] . '/blogs/');
             break;
         case 'delete':
             $this->deleteBlogItem($id);
             header('Location: ' . $_DIR['webRoot'] . '/' . $_DIR['adminPage'] . '/blogs/');
             break;
         default:
             $this->getGuests();
             $this->getBlogItems();
             $this->setIncludeTemplate('admin/admin_BlogPage.tpl');
             break;
     }
 }
예제 #30
0
 function __construct()
 {
     parent::__construct();
     //Construct access URL:
     if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
         $this->url = 'https://';
     } else {
         $this->url = 'http://';
     }
     $PHP_SELF = $_SERVER['PHP_SELF'];
     $this->url .= $_SERVER['HTTP_HOST'] . substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'));
     $this->introduction = $this->project->getIntroduction();
     if (isset($_POST['introduction'])) {
         $this->introduction = stripslashes($_POST['introduction']);
     }
     $this->hint = $this->project->getHint();
     if (isset($_POST['hint'])) {
         $this->hint = stripslashes($_POST['hint']);
     }
 }