public function build($context)
 {
     if (!empty($this->_errors)) {
         $this->_valid = false;
     }
     parent::build($context);
 }
 function build($context = NULL)
 {
     $this->invalid_credentials = false;
     $this->Headers->append('Content-Type', 'text/html; charset=UTF-8');
     $this->Html->setAttribute('lang', Symphony::lang());
     $meta = $this->createElement('meta');
     $this->insertNodeIntoHead($meta);
     $meta->setAttribute('http-equiv', 'Content-Type');
     $meta->setAttribute('content', 'text/html; charset=UTF-8');
     $this->insertNodeIntoHead($this->createStylesheetElement(ADMIN_URL . '/assets/css/peripheral.css'));
     parent::setTitle(__('%1$s – %2$s', array(__('Symphony'), __('Login'))));
     ## Build the form
     $this->Form = $this->createElement('form');
     $this->Form->setAttribute('action', Administration::instance()->getCurrentPageURL());
     $this->Form->setAttribute('method', 'POST');
     $this->Form->setAttribute('class', 'panel');
     $this->Body->appendChild($this->Form);
     $this->Form->appendChild($this->createElement('h1', __('Symphony')));
     if ($context) {
         $this->_context = $context;
     }
     if (isset($_REQUEST['action'])) {
         $this->action();
     }
     $this->view();
 }
示例#3
0
 public function __construct(&$parent)
 {
     parent::__construct($parent);
     $this->setTitle('Symphony – Member Roles – Setup');
     $this->setPageType('form');
     $this->_driver = $parent->ExtensionManager->create('members');
 }
 public function view($call_parent = TRUE)
 {
     $this->addElementToHead(new XMLElement('script', "Symphony.Context.add('elasticsearch', " . json_encode(Symphony::Configuration()->get('elasticsearch')) . ")", array('type' => 'text/javascript')), 99);
     if ($call_parent) {
         parent::view();
     }
 }
 public function insertBreadcrumbsUsingPageIdentifier($page_id, $preserve_last = true)
 {
     if ($page_id == 0) {
         return parent::insertBreadcrumbs(array(Widget::Anchor(__('Pages'), SYMPHONY_URL . '/blueprints/pages/')));
     }
     $pages = PageManager::resolvePage($page_id, 'handle');
     foreach ($pages as &$page) {
         // If we are viewing the Page Editor, the Breadcrumbs should link
         // to the parent's Page Editor.
         if ($this->_context[0] == 'edit') {
             $page = Widget::Anchor(PageManager::fetchTitleFromHandle($page), SYMPHONY_URL . '/blueprints/pages/edit/' . PageManager::fetchIDFromHandle($page) . '/');
             // If the pages index is nested, the Breadcrumb should link to the
             // Pages Index filtered by parent
         } elseif (Symphony::Configuration()->get('pages_table_nest_children', 'symphony') == 'yes') {
             $page = Widget::Anchor(PageManager::fetchTitleFromHandle($page), SYMPHONY_URL . '/blueprints/pages/?parent=' . PageManager::fetchIDFromHandle($page));
             // If there is no nesting on the Pages Index, the breadcrumb is
             // not a link, just plain text
         } else {
             $page = new XMLElement('span', PageManager::fetchTitleFromHandle($page));
         }
     }
     if (!$preserve_last) {
         array_pop($pages);
     }
     parent::insertBreadcrumbs(array_merge(array(Widget::Anchor(__('Pages'), SYMPHONY_URL . '/blueprints/pages/')), $pages));
 }
 function __construct(&$parent)
 {
     parent::__construct($parent);
     $this->setTitle('Symphony – Member Roles – Untitled');
     $ExtensionManager = new ExtensionManager($parent);
     $this->_driver = $ExtensionManager->create('members');
 }
 function __construct(&$parent)
 {
     parent::__construct($parent);
     $FileManager =& $this->_Parent->ExtensionManager->create('filemanager');
     $file = $_REQUEST['file'];
     $FileManager->download($file);
     exit;
 }
 public function __construct()
 {
     parent::__construct();
     if ($this->_context[0]) {
         $this->formatter = TextformatterManager::create($this->_context[0]);
     }
     $this->_driver = ExtensionManager::create('templatedtextformatters');
 }
示例#9
0
 public function __construct(Administration &$parent)
 {
     parent::__construct($parent);
     self::$entryManager = new EntryManager(Administration::instance());
     self::$sectionManager = self::$entryManager->sectionManager;
     self::$fieldManager = self::$entryManager->fieldManager;
     $this->_driver = Symphony::ExtensionManager()->create('bulkimporter');
 }
 public function build(array $context = array())
 {
     $section_id = $context[1];
     if (isset($section_id)) {
         $context['associations'] = array('parent' => SectionManager::fetchParentAssociations($section_id), 'child' => SectionManager::fetchChildAssociations($section_id));
     }
     return parent::build($context);
 }
 public function __construct()
 {
     parent::__construct();
     $this->_cols = array('IP' => __('IP Address'), 'FailedCount' => __('Failed Count'), 'DateCreated' => __('Date Created'), 'Source' => __('Source'));
     $this->_tables = array('black' => __('Black list'), 'gray' => __('Gray list'), 'white' => __('White list'));
     $this->_curColor = isset($_REQUEST['list']) && array_key_exists($_REQUEST['list'], $this->_tables) ? $_REQUEST['list'] : 'black';
     $this->_data = array();
 }
 public function __construct()
 {
     parent::__construct();
     $this->setTitle(__('%1$s – %2$s', array(__('Symphony'), __('Settings'))));
     /*
     			$element = $this->createElement('p');
     			$element->appendChild(new DOMEntityReference('ndash'));
     			$this->Body->appendChild($element);*/
 }
示例#13
0
 public function build()
 {
     parent::build();
     parent::addStylesheetToHead(URL . '/extensions/importcsv/assets/importcsv.css');
     // parent::addStylesheetToHead(URL . '/symphony/assets/forms.css');
     parent::addScriptToHead(URL . '/extensions/importcsv/assets/importcsv.js', 70);
     $this->setTitle('Symphony - Import / export CSV');
     $this->Context->appendChild(new XMLElement('h2', __('Import / Export CSV')));
 }
 public function build($context)
 {
     if (@$context[0] == 'edit' or @$context[0] == 'new') {
         $this->__prepareEdit($context);
     } else {
         $this->__prepareIndex();
     }
     parent::build($context);
 }
 public function build($context)
 {
     if (@$context[0] == 'show') {
         $this->_log = (object) $this->_driver->getLog($context[1]);
     } else {
         $this->__prepareIndex();
     }
     parent::build($context);
 }
示例#16
0
 public function __switchboard($type = 'view')
 {
     $this->_type = $type;
     if (!isset($this->_context[0]) || in_array(trim($this->_context[0]), ['', 'saved', 'completed'])) {
         $this->_function = 'index';
     } else {
         $this->_function = $this->_context[0];
     }
     parent::__switchboard($type);
 }
示例#17
0
 public function __construct(&$parent)
 {
     parent::__construct($parent);
     if (!is_object($this->_Parent->FormatterManager)) {
         $this->_Parent->FormatterManager = new TextformatterManager($this->_Parent);
     }
     if ($this->_context[0]) {
         $this->formatter = $this->_Parent->FormatterManager->create($this->_context[0]);
     }
     $this->_driver = $this->_Parent->ExtensionManager->create('templatedtextformatters');
 }
 /**
  * Build the page
  * @param array $context
  */
 public function build($context)
 {
     if (Administration::instance()->Author()->isDeveloper()) {
         if ($_POST['with-selected'] == 'delete' && is_array($_POST['items'])) {
             foreach ($_POST['items'] as $id_role => $value) {
                 $this->_driver->deleteRole($id_role);
             }
         }
         parent::build($context);
     }
 }
 public function build($context)
 {
     if (@$context[0] == 'edit' or @$context[0] == 'new') {
         if ($this->_editing = $context[0] == 'edit') {
             $this->_fields = $this->_driver->getFormatter($context[1]);
         }
         $this->_handle = $context[1];
         $this->_status = $context[2];
     } else {
         $this->__prepareIndex();
     }
     parent::build($context);
 }
示例#20
0
 public function build($context)
 {
     if (@$context[0] == 'edit' or @$context[0] == 'new') {
         if ($this->_editing = $context[0] == 'edit') {
             $this->_fields = $this->_driver->getRule((int) $context[1]);
         }
         $this->_fields = isset($_POST['fields']) ? $_POST['fields'] : $this->_fields;
         $this->_status = $context[2];
         $this->_sections = $this->_driver->getSections();
     } else {
         $this->_rules = $this->_driver->getRules();
     }
     parent::build($context);
 }
 public function build($context)
 {
     if (isset($context[0])) {
         if ($context[0] == 'edit' || $context[0] == 'new') {
             $this->__prepareEdit($context);
         } else {
             if ($context[0] == 'run') {
                 $this->__prepareRun($context);
             }
         }
     } else {
         $this->__prepareIndex();
     }
     parent::build($context);
 }
		public function build($context) {
			if (@$context[0] == 'edit' or @$context[0] == 'new') {
				$this->_editing = $context[0] == 'edit';
				$this->_status = $context[2];
				
				if ($this->_editing) {
					$this->_fields = $this->_driver->getRule($context[1]);
				}
				
			} else {
				$this->__prepareIndex();
			}
			
			parent::build($context);
		}
 public function build($context)
 {
     if (@$context[0] == 'edit' or @$context[0] == 'new') {
         if ($this->_editing = $context[0] == 'edit') {
             $this->_fields = $this->_driver->getSet((int) $context[1]);
             $this->_params = $this->_driver->getParameters((int) $context[1]);
         }
         $this->_fields = isset($_POST['fields']) ? $_POST['fields'] : $this->_fields;
         $this->_params = isset($_POST['params']) ? $_POST['params'] : $this->_params;
         $this->_status = $context[2];
         $this->_pages = $this->_driver->getPages();
     } else {
         $this->_sets = $this->_driver->getSets();
     }
     parent::build($context);
 }
 public function build($context)
 {
     if (@$context[0] == 'edit' or @$context[0] == 'new') {
         if ($this->_editing = $context[0] == 'edit') {
             $this->_fields = $this->_driver->getTemplate((int) $context[1]);
             $this->_conditions = $this->_driver->getConditions((int) $context[1]);
         }
         $this->_fields = isset($_POST['fields']) ? $_POST['fields'] : $this->_fields;
         $this->_conditions = isset($_POST['conditions']) ? $_POST['conditions'] : $this->_conditions;
         $this->_status = $context[2];
         $this->_pages = $this->_driver->getPages();
     } else {
         $this->_templates = $this->_driver->getTemplates();
     }
     parent::build($context);
 }
示例#25
0
 public function build($context)
 {
     $this->_action = isset($context[0]) ? $context[0] : false;
     if ($this->_action == 'edit' && isset($context[1]) && is_numeric($context[1])) {
         // Load the data:
         $this->_id_role = $context[1];
         $this->_data = $this->_driver->getData($this->_id_role);
     }
     if (isset($_POST['save'])) {
         // Save:
         $this->_id_role = $this->_driver->saveData($_POST);
         if ($this->_id_role != false) {
             $this->_data = $this->_driver->getData($this->_id_role);
             $this->pageAlert(__('Role successfully created/updated.'), Alert::SUCCESS);
         } else {
             $this->pageAlert(__('Role not saved: Please enter a name.'), Alert::ERROR);
         }
     }
     parent::addStylesheetToHead(URL . '/extensions/author_roles/assets/author_roles.css', 'screen', 70);
     parent::addScriptToHead(URL . '/extensions/author_roles/assets/author_roles.js', 71);
     parent::build($context);
 }
 public function generate()
 {
     if ($this->_useTemplate !== false) {
         $template = $this->viewDir . '/' . (empty($this->_useTemplate) ? $this->_getTemplate($this->_type, $this->_function) : $this->_useTemplate . '.xsl');
         if (file_exists($template)) {
             $current_path = explode(dirname($_SERVER['SCRIPT_NAME']), $_SERVER['REQUEST_URI'], 2);
             $current_path = '/' . ltrim(end($current_path), '/');
             $params = array('today' => DateTimeObj::get('Y-m-d'), 'current-time' => DateTimeObj::get('H:i'), 'this-year' => DateTimeObj::get('Y'), 'this-month' => DateTimeObj::get('m'), 'this-day' => DateTimeObj::get('d'), 'timezone' => DateTimeObj::get('P'), 'website-name' => Symphony::Configuration()->get('sitename', 'general'), 'root' => URL, 'symphony-url' => SYMPHONY_URL, 'workspace' => URL . '/workspace', 'current-page' => strtolower($this->_type) . ucfirst($this->_function), 'current-path' => $current_path, 'current-url' => URL . $current_path, 'upload-limit' => min($upload_size_php, $upload_size_sym), 'symphony-version' => Symphony::Configuration()->get('version', 'symphony'));
             $html = $this->_XSLTProc->process($this->_XML->generate(), file_get_contents($template), $params);
             if ($this->_XSLTProc->isErrors()) {
                 $errstr = NULL;
                 while (list($key, $val) = $this->_XSLTProc->getError()) {
                     $errstr .= 'Line: ' . $val['line'] . ' - ' . $val['message'] . self::CRLF;
                 }
                 throw new SymphonyErrorPage(trim($errstr), NULL, 'xslt-error', array('proc' => clone $this->_XSLTProc));
             }
         } else {
             Administration::instance()->errorPageNotFound();
         }
         $this->Form = NULL;
         $this->Contents->setValue($html);
     }
     return parent::generate();
 }
 public function build(array $context = array())
 {
     $this->__setContext((int) $_GET['section']);
     parent::build($context);
 }
示例#28
0
 function __construct(&$parent)
 {
     parent::__construct($parent);
     $this->_FileManager =& $this->_Parent->ExtensionManager->create('filemanager');
     $this->setTitle(__('Symphony – File Manager – Untitled'));
 }
 public function __construct(&$parent)
 {
     parent::__construct($parent);
 }
示例#30
0
 public function __construct(&$parent)
 {
     parent::__construct($parent);
     $this->_driver = $this->_Parent->ExtensionManager->create('order_entries');
 }