/** * Initiate main app loop and service the current HTTP request. * Should be called after app bootstrap and setup is complete. * * @return void */ public function serveRequest() { if ($this->config->Get('APP', 'force_https')) { $this->redirectProtocol(); } else { $this->passToRouter(); } }
/** * Build the XHTML * * @access public * @return void */ function buildXHTML() { $label = $this->_Label->GetValue(); if (!empty($label)) { $this->_Container->PackStart($this->_Label); } $this->_Container->PackStart($this->_ToolbarControl); $this->_Container->PackStart($this->TextArea); $this->_Container->SetWidth($this->_Width); $this->extraBuild(); $this->_XHTML = $this->_Container->Get(); }
/** * Validates the form according to it's rules. * @param object $object The data object that requires form validation. * @return boolean True if the validation succeeded. */ function Validate($object) { global $c; if (!count($this->rules)) { return; } $valid = true; foreach ($this->rules as $rule) { list($fieldname, $error_message, $function_name) = $rule; if (!$this->{$function_name}($object->Get($fieldname))) { $valid = false; $c->messages[] = $error_message; } } return $valid; }
/** * Build the XHTML * * @access public * @return string XHTML content */ function buildXHTML() { $label = $this->_Label->GetValue(); if (!empty($label)) { $this->_Container->PackStart($this->_Label); } $this->_Container->PackStart($this->TextArea); $this->_Container->SetWidth($this->_Width); $this->_XHTML .= $this->_Container->Get(); $extraPlugins = array(); $pluginDir = JAWS_PATH . 'libraries/ckeditor/plugins/'; if (is_dir($pluginDir)) { $dirs = scandir($pluginDir); foreach ($dirs as $dir) { if ($dir[0] != '.' && is_dir($pluginDir . $dir)) { if (!in_array($dir, $this->_DefaultPlugins)) { $extraPlugins[] = $dir; } } } } $tpl = new Jaws_Template(); $tpl->Load('CKEditor.html', 'include/Jaws/Resources'); $block = JAWS_SCRIPT == 'admin' ? 'ckeditor_backend' : 'ckeditor_frontend'; $tpl->SetBlock($block); $tpl->SetVariable('name', $this->_Name); $tpl->SetVariable('baseUrl', Jaws_Utils::getBaseURL('/', true)); $tpl->SetVariable('contentsLangDirection', $this->_Direction); $tpl->SetVariable('language', $this->_Language); $tpl->SetVariable('AutoDetectLanguage', 'false'); $tpl->SetVariable('autoParagraph', 'false'); $tpl->SetVariable('height', $this->_Height); $tpl->SetVariable('skin', $this->_Skin); $tpl->SetVariable('theme', $this->_Theme); $tpl->SetVariable('readOnly', $this->_IsEnabled ? 'false' : 'true'); $tpl->SetVariable('resize_enabled', $this->_IsResizable ? 'true' : 'false'); $tpl->SetVariable('toolbar', json_encode($this->toolbars)); if (!empty($extraPlugins)) { $tpl->SetBlock("{$block}/extra"); $tpl->SetVariable('extraPlugins', implode(',', $extraPlugins)); $tpl->ParseBlock("{$block}/extra"); } // removed plugins $tpl->SetVariable('removePlugins', $this->_RemovePlugins); // direction if ('rtl' == $this->_Direction) { $tpl->SetVariable('contentsCss', 'gadgets/ControlPanel/Resources/ckeditor.rtl.css'); } else { $tpl->SetVariable('contentsCss', 'gadgets/ControlPanel/Resources/ckeditor.css'); } // FileBrowser if (Jaws_Gadget::IsGadgetInstalled('FileBrowser')) { $tpl->SetBlock("{$block}/filebrowser"); $tpl->SetVariable('filebrowserBrowseUrl', BASE_SCRIPT . '?gadget=FileBrowser&action=BrowseFile'); $tpl->SetVariable('filebrowserFlashBrowseUrl', BASE_SCRIPT . '?gadget=FileBrowser&action=BrowseFile'); $tpl->ParseBlock("{$block}/filebrowser"); } // Phoo if (Jaws_Gadget::IsGadgetInstalled('Phoo')) { $tpl->SetBlock("{$block}/phoo"); $tpl->SetVariable('filebrowserImageBrowseUrl', BASE_SCRIPT . '?gadget=Phoo&action=BrowsePhoo'); $tpl->ParseBlock("{$block}/phoo"); } // Directory if (Jaws_Gadget::IsGadgetInstalled('Directory')) { $tpl->SetBlock("{$block}/directory"); $tpl->SetVariable('filebrowserFlashBrowseUrl', BASE_SCRIPT . '?gadget=Directory&action=Browse'); $tpl->ParseBlock("{$block}/directory"); } $tpl->ParseBlock($block); $this->_XHTML .= $tpl->Get(); }
/** * Build the XHTML * * @access public * @return void */ function buildXHTML() { static $alreadyLoaded; $alreadyLoaded = isset($alreadyLoaded) ? true : false; $plugins = array(); $lang = $GLOBALS['app']->GetLanguage(); $pluginDir = JAWS_PATH . 'libraries/tinymce/plugins/'; if (is_dir($pluginDir)) { $dirs = scandir($pluginDir); foreach ($dirs as $dir) { if ($dir[0] != '.' && is_dir($pluginDir . $dir)) { $plugins[] = $dir; } } } $plugins = implode(',', $plugins); $label = $this->_Label->GetValue(); if (!empty($label)) { $this->_Container->PackStart($this->_Label); } $this->_Container->PackStart($this->TextArea); $this->_Container->SetWidth($this->_Width); $this->_XHTML .= $this->_Container->Get(); $ibrowser = ''; if (Jaws_Gadget::IsGadgetInstalled('Phoo')) { $ibrowser = $GLOBALS['app']->getSiteURL() . '/' . BASE_SCRIPT . '?gadget=Phoo&action=BrowsePhoo'; } $fbrowser = ''; if (Jaws_Gadget::IsGadgetInstalled('FileBrowser')) { $fbrowser = $GLOBALS['app']->getSiteURL() . '/' . BASE_SCRIPT . '?gadget=FileBrowser&action=BrowseFile'; } $mbrowser = ''; if (Jaws_Gadget::IsGadgetInstalled('Directory')) { $mbrowser = $GLOBALS['app']->getSiteURL() . '/' . BASE_SCRIPT . '?gadget=Directory&action=Browse'; } if (JAWS_SCRIPT == 'admin') { $plugins = str_replace(',bbcode,', ',', $plugins); $block = 'tinymce_backend'; } else { $block = 'tinymce_frontend'; } $tpl = new Jaws_Template(); $tpl->Load('TinyMCE.html', 'include/Jaws/Resources'); $tpl->SetBlock($block); $tpl->SetVariable('ibrowser', $ibrowser); $tpl->SetVariable('fbrowser', $fbrowser); $tpl->SetVariable('mbrowser', !empty($mbrowser) ? $mbrowser : $fbrowser); $tpl->SetVariable('mode', $this->_Mode); $tpl->SetVariable('lang', $lang); $tpl->SetVariable('theme', $this->_Theme); $tpl->SetVariable('plugins', $plugins); // set toolbars $index = 0; foreach ($this->toolbars as $key => $toolbar) { $tpl->SetBlock("{$block}/toolbar"); $index = $key + 1; $tpl->SetVariable('theme', $this->_Theme); $tpl->SetVariable('key', $index); $tpl->SetVariable('toolbar', $toolbar); $tpl->ParseBlock("{$block}/toolbar"); } $index = $index + 1; $tpl->SetVariable('key', $index); $tpl->SetVariable('browsers', implode($this->_Browsers, ',')); $tpl->SetVariable('dir', _t('GLOBAL_LANG_DIRECTION')); $tpl->SetVariable('valid_elements', $this->_ExtendedValidElements); $tpl->SetVariable('invalid_elements', $this->_InvalidElements); $tpl->SetVariable('class', $this->_Class); $tpl->ParseBlock($block); $this->_XHTML .= $tpl->Get(); }
/** * Associates the object object to this one * @return boolean */ function GetObject() { $object = new object(); return $object->Get($this->objectId); }
} //test to avoid loading same sibling/child multiple times echo "<br/>printing children list"; echo "<pre>"; $childrenList = $parent->GetObjectList(); print_r($childrenList); echo "</pre>"; echo "<br/><br/>here we expect the same result as above"; echo "<pre>"; $childrenList2 = $parent->GetObjectList(); print_r($childrenList2); echo "</pre>"; $id = $object->objectId; $object = null; $object = new object(); $object->Get($id); echo "<br/>printing sibling list"; echo "<pre>"; $siblingList = $object->GetSiblingList(array(array("siblingId", ">", 0))); foreach ($siblingList as $s) { echo $s->siblingId; } print_r($siblingList); echo "</pre>"; echo "<br/><br/>here we expect the same result as above"; echo "<pre>"; $siblingList2 = $object->GetSiblingList(); print_r($siblingList2); echo "</pre>"; //setchildlist $sibling2 = new sibling('new sibling1');