/** * Smarty {yuimenu} function plugin * * Type: function<br> * Name: yuimenu<br> * Purpose: display a yui menu * * @param $params * @param \Smarty $smarty * @return bool */ function smarty_function_yuimenu($params, &$smarty) { $menu = ' function buildmenu () { var oMenuSidenavJs = new YAHOO.widget.Menu("' . $params['buildon'] . '", { position: "static", hidedelay: 100, lazyload: true }); var aSubmenuData = ' . navigationmodule::navtojson() . '; oMenuSidenavJs.subscribe("beforeRender", function () { if (this.getRoot() == this) { for (i=0; i<=this.getItems().length; i++){ var j=i; // console.debug(aSubmenuData[j].itemdata.length); if (aSubmenuData[j].itemdata.length>0){ this.getItem(i).cfg.setProperty("submenu", aSubmenuData[j]); } } } }); oMenuSidenavJs.render(); } YAHOO.util.Event.onDOMReady(buildmenu); '; expJavascript::pushToFoot(array("unique" => "yuimenubar-" . $params['buildon'], "yui2mods" => "menu", "yui3mods" => $smarty->getTemplateVars('__name'), "content" => $menu, "src" => "")); }
/** * Smarty {yuimenubar} function plugin * * Type: function<br> * Name: yuimenubar<br> * Purpose: display a yui menu bar * * @param $params * @param \Smarty $smarty * @return bool */ function smarty_function_yuimenubar($params, &$smarty) { $menu = ' function buildmenu () { var oMenuBar = new YAHOO.widget.MenuBar("' . $params['buildon'] . '", { constraintoviewport:false, postion:"dynamic", visible:true, zIndex:250, autosubmenudisplay: true, hidedelay: 750, lazyload: true }); var aSubmenuData = ' . navigationmodule::navtojson() . '; oMenuBar.subscribe("beforeRender", function () { if (this.getRoot() == this) { for (i=0; i<=this.getItems().length; i++){ var j=i; if (aSubmenuData[j].itemdata.length>0){ this.getItem(i).cfg.setProperty("submenu", aSubmenuData[j]); } } } }); oMenuBar.render(); } YAHOO.util.Event.onDOMReady(buildmenu); '; expJavascript::pushToFoot(array("unique" => "yuimenubar-" . $params['buildon'], "yui2mods" => "menu", "yui3mods" => $smarty->getTemplateVars('__name'), "content" => $menu, "src" => "")); }
# You should have received a copy of the GNU # General Public License along with Exponent; if # not, write to: # # Free Software Foundation, Inc., # 59 Temple Place, # Suite 330, # Boston, MA 02111-1307 USA # # $Id: view_template.php,v 1.5 2005/04/03 07:57:14 filetreefrog Exp $ ################################################## if (!defined('PATHOS')) { exit(''); } if ($user && $user->is_acting_admin == 1) { $page = null; if (isset($_GET['id'])) { $page = $db->selectObject('section_template', 'id=' . $_GET['id']); } if ($page) { pathos_flow_set(SYS_FLOW_PROTECTED, SYS_FLOW_ACTION); $template = new template('navigationmodule', '_view_template', $loc); $template->assign('template', $page); $template->assign('subs', navigationmodule::getTemplateHierarchyFlat($page->id)); $template->output(); } else { echo SITE_404_HTML; } } else { echo SITE_403_HTML; }
foreach ($moveNextSiblings as $value) { $value->rank = $value->rank + 1; eDebug($value); $db->updateObject($value, 'section'); } $db->updateObject($moveSec, 'section'); //handle re-ranking of previous parent $oldSiblings = $db->selectObjects("section", "parent=" . $oldParent . " AND rank>" . $oldRank . " ORDER BY rank"); $rerank = 0; foreach ($oldSiblings as $value) { if ($value->id != $moveSec->id) { $value->rank = $rerank; $db->updateObject($value, 'section'); $rerank++; } } if ($oldParent != $moveSec->parent) { //we need to re-rank the children of the parent that the miving section has just left $chilOfLastMove = $db->selectObjects("section", "parent=" . $oldParent . " ORDER BY rank"); for ($i = 0; $i < count($chilOfLastMove); $i++) { $chilOfLastMove[$i]->rank = $i; $db->updateObject($chilOfLastMove[$i], 'section'); } } } } navigationmodule::checkForSectionalAdmins($move); expSession::clearAllUsersSessionCache('navigationmodule'); } else { echo SITE_403_HTML; }
/** * Smarty {navtojson} function plugin * * Type: function<br> * Name: navtojson<br> * Purpose: caonvert navigation structure to javascript via json * * @param $params * @param \Smarty $smarty * @return bool */ function smarty_function_navtojson($params, &$smarty) { echo navigationmodule::navtojson(); }
################################################## # # Copyright (c) 2004-2006 OIC Group, Inc. # Written and Designed by James Hunt # # This file is part of Exponent # # Exponent is free software; you can redistribute # it and/or modify it under the terms of the GNU # General Public License as published by the Free # Software Foundation; either version 2 of the # License, or (at your option) any later version. # # GPL: http://www.gnu.org/licenses/gpl.txt # ################################################## if (!defined('EXPONENT')) { exit(''); } if (exponent_permissions_checkOnModule('manage', 'navigationmodule')) { exponent_flow_set(SYS_FLOW_PROTECTED, SYS_FLOW_ACTION); $template = new template('navigationmodule', '_manager', $loc); $template->assign('sections', navigationmodule::levelTemplate(0, 0)); // Templates $tpls = $db->selectObjects('section_template', 'parent=0'); $template->assign('templates', $tpls); $template->output(); } else { echo SITE_403_HTML; }
function isPublic($section) { $hier = navigationmodule::getHierarchy(); while (true) { if ($section->public == 0) { // Not a public section. Check permissions. return false; } else { // Is public. check parents. if ($section->parent <= 0) { // Out of parents, and since we are still checking, we haven't hit a private section. return true; } else { $section = $hier[$section->parent]; } } } }
public function getSearchResults($terms, $readonly = 0) { global $db, $user; // get the search terms //$terms = $this->params['search_string']; if (SAVE_SEARCH_QUERIES && $readonly == 0) { if (INCLUDE_ANONYMOUS_SEARCH == 1 || $user->id != 0) { $queryObj = new stdClass(); $queryObj->user_id = $user->id; $queryObj->query = $terms; $queryObj->timestamp = time(); $db->insertObject($queryObj, 'search_queries'); } } //setup the sql query /*$sql = "SELECT *, MATCH (s.title,s.body) AGAINST ('".$terms."') as score from ".DB_TABLE_PREFIX."_search as s "; $sql .= "LEFT OUTER JOIN ".DB_TABLE_PREFIX."_product p ON s.original_id = p.id WHERE MATCH(title,body) against ('".$terms."' IN BOOLEAN MODE)"; SELECT *, MATCH (s.title,s.body) AGAINST ('army combat uniform') as score from exponent_search as s LEFT OUTER JOIN exponent_product p ON s.original_id = p.id WHERE MATCH(s.title,s.body) against ('army combat uniform' IN BOOLEAN MODE)*/ $sql = "SELECT *, MATCH (s.title,s.body) AGAINST ('" . $terms . "*') as score from " . DB_TABLE_PREFIX . "_search as s "; $sql .= "WHERE MATCH(title,body) against ('" . $terms . "*' IN BOOLEAN MODE) "; // look up the records. //eDebug($sql); $records = $db->selectObjectsBySql($sql); //eDebug($records); //FIXME: The page count is off when have to not show // search results due to permissions...not sure what to do about that. $recs = $records; for ($i = 0; $i < count($records); $i++) { if ($records[$i]->ref_type == 'product') { $score = $records[$i]->score; if (!product::canView($records[$i]->original_id)) { unset($recs[$i]); } /*else { $records[$i] = new product($records[$i]->original_id); $records[$i]->score = $score; }*/ } else { if ($records[$i]->ref_type == 'section') { $section = $db->selectObject('section', 'id=' . $records[$i]->original_id); if (empty($section) || !navigationmodule::canView($section)) { unset($recs[$i]); //$records[$i]->canview = false; } } else { $rloc = unserialize($records[$i]->location_data); if (!empty($rloc)) { $sectionref = $db->selectObject("sectionref", "module='" . expModules::getControllerClassName($rloc->mod) . "' AND source='" . $rloc->src . "'"); if (!empty($sectionref)) { $section = $db->selectObject("section", "id=" . $sectionref->section); if (empty($section) || !navigationmodule::canView($section)) { unset($recs[$i]); //$records[$i]->canview = false; } } } } } } return $recs; }
function internalAliasForm($object = null) { pathos_lang_loadDictionary('standard', 'core'); pathos_lang_loadDictionary('modules', 'navigationmodule'); // Initialize the forms subsystem for use. if (!defined('SYS_FORMS')) { require_once BASE . 'subsystems/forms.php'; } pathos_forms_initialize(); if (!isset($object->id)) { $object->internal_id = 0; } // Grab the basic form that all page types share // This has the name and positional dropdowns registered. // This call also initializes the section object, if it is not an existing section. $form = section::_commonForm($object); // Add a dropdown to allow the user to choose an internal page. $form->register('internal_id', TR_NAVIGATIONMODULE_INTLINK, new dropdowncontrol($object->internal_id, navigationmodule::hierarchyDropDownControlArray())); // Add the'Public?' checkbox. The 'Active?' checkbox is omitted, because it makes no sense. $form->register('public', TR_NAVIGATIONMODULE_ISPUBLIC, new checkboxcontrol($object->public)); // Add a Submit / Cancel button. $form->register('submit', '', new buttongroupcontrol(TR_CORE_SAVE, '', TR_CORE_CANCEL)); // Return the form to the calling scope (usually an action in the navigation module). return $form; }
public function configure_site() { expHistory::set('manageable', $this->params); // TYPES OF ANTISPAM CONTROLS... CURRENTLY ONLY ReCAPTCHA $as_types = array('0' => '-- ' . gt('Please Select an Anti-Spam Control') . ' --', "recaptcha" => 'reCAPTCHA'); //THEMES FOR RECAPTCHA $as_themes = array("red" => gt('DEFAULT RED'), "white" => gt('White'), "blackglass" => gt('Black Glass'), "clean" => gt('Clean (very generic)')); // Available Themes $themes = array(); if (is_readable(BASE . 'themes')) { $theme_dh = opendir(BASE . 'themes'); while (($theme_file = readdir($theme_dh)) !== false) { if (is_readable(BASE . 'themes/' . $theme_file . '/class.php')) { // Need to avoid the duplicate theme problem. if (!class_exists($theme_file)) { include_once BASE . 'themes/' . $theme_file . '/class.php'; } if (class_exists($theme_file)) { // Need to avoid instantiating non-existent classes. $t = new $theme_file(); $themes[$theme_file] = $t->name(); } } } } uasort($themes, 'strnatcmp'); // Available Languages $langs = expLang::langList(); // ksort($langs); // smtp protocol $protocol = array('ssl' => 'SSL', 'tls' => 'TLS'); // attribution $attribution = array('firstlast' => 'John Doe', 'lastfirst' => 'Doe, John', 'first' => 'John', 'username' => 'jdoe'); // These funcs need to be moved up in to new subsystems // Date/Time Format $datetime_format = expSettings::dropdownData('datetime_format'); // Date Format $date_format = expSettings::dropdownData('date_format'); // Time Format $time_format = expSettings::dropdownData('time_format'); // Start of Week $start_of_week = expSettings::dropdownData('start_of_week'); // File Permissions $file_permisions = expSettings::dropdownData('file_permissions'); // File Permissions $dir_permissions = expSettings::dropdownData('dir_permissions'); // Homepage Dropdown $section_dropdown = navigationmodule::levelDropDownControlArray(0); // Timezone Dropdown $list = DateTimeZone::listAbbreviations(); $idents = DateTimeZone::listIdentifiers(); $data = $offset = $added = array(); foreach ($list as $abbr => $info) { foreach ($info as $zone) { if (!empty($zone['timezone_id']) and !in_array($zone['timezone_id'], $added) and in_array($zone['timezone_id'], $idents)) { $z = new DateTimeZone($zone['timezone_id']); $c = new DateTime(null, $z); $zone['time'] = $c->format('H:i a'); $data[] = $zone; $offset[] = $z->getOffset($c); $added[] = $zone['timezone_id']; } } } array_multisort($offset, SORT_ASC, $data); $tzoptions = array(); foreach ($data as $key => $row) { $tzoptions[$row['timezone_id']] = self::formatOffset($row['offset']) . ' ' . $row['timezone_id']; } assign_to_template(array('as_types' => $as_types, 'as_themes' => $as_themes, 'themes' => $themes, 'langs' => $langs, 'protocol' => $protocol, 'attribution' => $attribution, 'datetime_format' => $datetime_format, 'date_format' => $date_format, 'time_format' => $time_format, 'start_of_week' => $start_of_week, 'timezones' => $tzoptions, 'file_permisions' => $file_permisions, 'dir_permissions' => $dir_permissions, 'section_dropdown' => $section_dropdown)); }
static function checkForSectionalAdmins($id) { global $db; $section = $db->selectObject('section', 'id=' . $id); $branch = navigationmodule::levelTemplate($id, 0); array_unshift($branch, $section); $allusers = array(); $allgroups = array(); while ($section->parent > 0) { $ploc = expCore::makeLocation('navigationmodule', null, $section); $allusers = array_merge($allusers, $db->selectColumn('userpermission', 'uid', "permission='manage' AND module='navigationmodule' AND internal=" . $section->parent)); $allgroups = array_merge($allgroups, $db->selectColumn('grouppermission', 'gid', "permission='manage' AND module='navigationmodule' AND internal=" . $section->parent)); $section = $db->selectObject('section', 'id=' . $section->parent); } foreach ($branch as $section) { $sloc = expCore::makeLocation('navigationmodule', null, $section->id); // remove any manage permissions for this page and it's children // $db->delete('userpermission', "module='navigationmodule' AND internal=".$section->id); // $db->delete('grouppermission', "module='navigationmodule' AND internal=".$section->id); foreach ($allusers as $uid) { $u = user::getUserById($uid); expPermissions::grant($u, 'manage', $sloc); } foreach ($allgroups as $gid) { $g = group::getGroupById($gid); expPermissions::grantGroup($g, 'manage', $sloc); } } }
/** * Internal Alias Form method * * This method returns a form object to be used when allowing the user * to create a new section that is actually a link to another page in the * Exponent site hierarchy. * * @param Object $object The section object to build the form from. * * @return Form A form object that can be used to create a new section, or * edit an existing one. */ static function internalAliasForm($object = null) { // Initialize the forms subsystem for use. // Initialization if (!isset($object->id)) { $object->internal_id = 0; } // Grab the basic form that all page types share // This has the name and positional dropdowns registered. // This call also initializes the section object, if it is not an existing section. $form = section::_commonForm($object); // the sef_name is already set in this existing page $form->unregister('sef_name'); // Add a dropdown to allow the user to choose an internal page. $form->register('internal_id', gt('Page'), new dropdowncontrol($object->internal_id, navigationmodule::levelDropDownControlArray(0, 0, array(), false, 'manage'))); // Add the'Public?' checkbox. The 'Active?' checkbox is omitted, because it makes no sense. $form->register('public', gt('Public'), new checkboxcontrol($object->public)); // Add a Submit / Cancel button. $form->register('submit', '', new buttongroupcontrol(gt('Save'), '', gt('Cancel'))); // Return the form to the calling scope (usually an action in the navigation module). return $form; }
# # Copyright (c) 2004-2006 OIC Group, Inc. # Copyright (c) 2006 Maxim Mueller # Written and Designed by James Hunt # # This file is part of Exponent # # Exponent is free software; you can redistribute # it and/or modify it under the terms of the GNU # General Public License as published by the Free # Software Foundation; either version 2 of the # License, or (at your option) any later version. # # GPL: http://www.gnu.org/licenses/gpl.txt # ################################################## if (!defined('EXPONENT')) { exit(''); } $i18n = exponent_lang_loadFile('conf/extensions/site.structure.php'); foreach (glob(BASE . "external/editors/*.glue") as $installed_glue_file) { $installed_editor = basename($installed_glue_file, ".glue"); $installed_editors[$installed_editor] = $installed_editor; } $stuff = array($i18n['title'], array('SITE_TITLE' => array('title' => $i18n['site_title'], 'description' => $i18n['site_title_desc'], 'control' => new textcontrol()), 'USE_LANG' => array('title' => $i18n['use_lang'], 'description' => $i18n['use_lang_desc'], 'control' => new dropdowncontrol(0, exponent_lang_list())), 'SITE_ALLOW_REGISTRATION' => array('title' => $i18n['allow_registration'], 'description' => $i18n['allow_registration_desc'], 'control' => new checkboxcontrol()), 'SITE_USE_CAPTCHA' => array('title' => $i18n['use_captcha'], 'description' => $i18n['use_captcha_desc'], 'control' => new checkboxcontrol()), 'SITE_KEYWORDS' => array('title' => $i18n['site_keywords'], 'description' => $i18n['site_keywords_desc'], 'control' => new texteditorcontrol('', 10, 30)), 'SITE_DESCRIPTION' => array('title' => $i18n['site_description'], 'description' => $i18n['site_description_desc'], 'control' => new texteditorcontrol('', 15, 50)), 'SITE_404_HTML' => array('title' => $i18n['site_404'], 'description' => $i18n['site_404_desc'], 'control' => new texteditorcontrol('', 15, 50)), 'SITE_403_REAL_HTML' => array('title' => $i18n['site_403'], 'description' => $i18n['site_403_desc'], 'control' => new texteditorcontrol('', 15, 50)), 'SITE_DEFAULT_SECTION' => array('title' => $i18n['default_section'], 'description' => $i18n['default_section_desc'], 'control' => new dropdowncontrol('', navigationmodule::levelDropDownControlArray(0))), 'SITE_WYSIWYG_EDITOR' => array('title' => $i18n['wysiwyg_editor'], 'description' => $i18n['wysiwyg_editor_desc'], 'control' => new dropdowncontrol(null, $installed_editors)), 'SESSION_TIMEOUT' => array('title' => $i18n['session_timeout'], 'description' => $i18n['session_timeout_desc'], 'control' => new textcontrol()), 'SESSION_TIMEOUT_HTML' => array('title' => $i18n['timeout_error'], 'description' => $i18n['timeout_error_desc'], 'control' => new texteditorcontrol('', 15, 50)), 'FILE_DEFAULT_MODE_STR' => array('title' => $i18n['fileperms'], 'description' => $i18n['fileperms_desc'], 'control' => new dropdowncontrol(null, exponent_config_dropdownData('file_permissions'))), 'DIR_DEFAULT_MODE_STR' => array('title' => $i18n['dirperms'], 'description' => $i18n['dirperms_desc'], 'control' => new dropdowncontrol(null, exponent_config_dropdownData('dir_permissions'))), 'ENABLE_SSL' => array('title' => $i18n['ssl'], 'description' => $i18n['ssl_desc'], 'control' => new checkboxcontrol()), 'NONSSL_URL' => array('title' => $i18n['nonssl_url'], 'description' => $i18n['nonssl_url_desc'], 'control' => new textcontrol()), 'SSL_URL' => array('title' => $i18n['ssl_url'], 'description' => $i18n['ssl_url_desc'], 'control' => new textcontrol()), 'WORKFLOW_REVISION_LIMIT' => array('title' => $i18n['revision_limit'], 'description' => $i18n['revision_limit_desc'], 'control' => new textcontrol()))); $info = gd_info(); if (!EXPONENT_HAS_GD) { $stuff[1]['SITE_USE_CAPTCHA']['description'] = $i18n['use_captcha_desc'] . '<br /><br />' . $i18n['no_gd_support']; $stuff[1]['SITE_USE_CAPTCHA']['control']->disabled = true; } return $stuff;
public function getSectionObj($section) { global $db; if ($section == "*") { $action = $this->params['controller'] . "Controller"; $sectionObj = call_user_func($action . "::getSection", $this->params); } else { $sectionObj = $db->selectObject('section', 'id=' . intval($section)); } // $sectionObj = $db->selectObject('section','id='. intval($section)); if (!navigationmodule::canView($sectionObj)) { define('AUTHORIZED_SECTION', 0); } else { define('AUTHORIZED_SECTION', 1); } if (!navigationmodule::isPublic($sectionObj)) { define('PUBLIC_SECTION', 0); } else { define('PUBLIC_SECTION', 1); } if (isset($_REQUEST['section'])) { expSession::set('last_section', intval($_REQUEST['section'])); } else { //expSession::unset('last_section'); } return $sectionObj; }
# Written and Designed by James Hunt # # This file is part of Exponent # # Exponent is free software; you can redistribute # it and/or modify it under the terms of the GNU # General Public License as published by the Free # Software Foundation; either version 2 of the # License, or (at your option) any later version. # # GPL: http://www.gnu.org/licenses/gpl.txt # ################################################## if (!defined('EXPONENT')) { exit(''); } if ($user->is_admin == 1 || $user->is_acting_admin == 1) { $section = $db->selectObject('section', 'id=' . intval($_GET['id'])); if ($section) { navigationmodule::deleteLevel($section->id); $db->delete('section', 'id=' . $section->id); $db->decrement('section', 'rank', 1, 'rank > ' . $section->rank . ' AND parent=' . $section->parent); expSession::clearAllUsersSessionCache('navigationmodule'); expHistory::back(); // redirect_to($_SERVER['HTTP_REFERER'].'#tab=1'); } else { echo SITE_403_HTML; } } else { echo SITE_404_HTML; }
require_once BASE . 'subsystems/core.php'; // Initialize the Database Subsystem require_once BASE . 'subsystems/database.php'; $db = pathos_database_connect(DB_USER, DB_PASS, DB_HOST . ':' . DB_PORT, DB_NAME); // Initialize the Modules Subsystem. require_once BASE . 'subsystems/modules.php'; pathos_modules_initialize(); // Initialize the Template Subsystem. require_once BASE . 'subsystems/template.php'; // Initialize the Permissions Subsystem. require_once BASE . 'subsystems/permissions.php'; // Initialize the Flow Subsystem. if (!defined('SYS_FLOW')) { require_once BASE . 'subsystems/flow.php'; } // Validate session pathos_sessions_validate(); // Initialize permissions variables pathos_permissions_initialize(); $section = pathos_sessions_isset('last_section') ? pathos_sessions_get('last_section') : SITE_DEFAULT_SECTION; $section = $db->selectObject('section', 'id=' . $section); if (!navigationmodule::canView($section)) { define('AUTHORIZED_SECTION', 0); } else { define('AUTHORIZED_SECTION', 1); } if (!navigationmodule::isPublic($section)) { define('PUBLIC_SECTION', 0); } else { define('PUBLIC_SECTION', 1); }
} $search_string = trim(strtolower($_GET['search_string'])); if ($search_string == "") { pathos_lang_loadDictionary('modules', 'searchmodule'); echo TR_SEARCHMODULE_NEEDTERM; return; } $term_status = pathos_search_cleanSearchQuery(array_map("addslashes", array_map("trim", split(" ", $search_string)))); $terms = $term_status['valid']; $results = array(); foreach ($db->selectObjects("search", pathos_search_whereClause(array("title", "body"), $terms, SEARCH_TYPE_ANY)) as $r) { $result = null; $rloc = unserialize($r->location_data); $sectionref = $db->selectObject("sectionref", "module='" . $rloc->mod . "' AND source='" . $rloc->src . "'"); $section = $db->selectObject("section", "id=" . $sectionref->section); $canview = navigationmodule::canView($section); if ($canview && $r->view_perm != '') { // No point in checking the perm stuff if they cant even see the section $canview = false; // They need to have specific perms on the module. foreach (explode(',', $r->view_perm) as $p) { if (pathos_permissions_check($p, $rloc)) { $canview = true; break; } } } if ($canview) { $weight = 0; $body_l = strtolower($r->body); $title_l = strtolower($r->title);
# not, write to: # # Free Software Foundation, Inc., # 59 Temple Place, # Suite 330, # Boston, MA 02111-1307 USA # # $Id: manage.php,v 1.6 2005/04/06 15:53:34 filetreefrog Exp $ ################################################## if (!defined('PATHOS')) { exit(''); } if (pathos_permissions_checkOnModule('manage', 'navigationmodule')) { pathos_flow_set(SYS_FLOW_PROTECTED, SYS_FLOW_ACTION); $template = new template('navigationmodule', '_manager', $loc); $sections = navigationmodule::getHierarchy(); $last_manage_depth = -1; $last_admin_depth = -1; if ($user && $user->is_acting_admin) { foreach (array_keys($sections) as $id) { $sections[$id]->canManage = 1; $sections[$id]->canManageRank = 1; $sections[$id]->canAdmin = 1; } } else { $thisloc = pathos_core_makelocation('navigationmodule'); foreach (array_keys($sections) as $id) { $thisloc->int = $id; $depth = $sections[$id]->depth; if ($last_manage_depth == -1 && pathos_permissions_check('manage', $thisloc)) { $sections[$id]->canManage = 1;
# This file is part of Exponent # # Exponent is free software; you can redistribute # it and/or modify it under the terms of the GNU # General Public License as published by the Free # Software Foundation; either version 2 of the # License, or (at your option) any later version. # # GPL: http://www.gnu.org/licenses/gpl.txt # ################################################## if (!defined('EXPONENT')) { exit(''); } global $router, $section; if (expPermissions::check('manage', expCore::makeLocation('navigationmodule', '', $section))) { global $user; expHistory::set('manageable', $router->params); $template = new template('navigationmodule', '_manager', $loc); $template->assign('sections', navigationmodule::levelTemplate(0, 0)); // Templates $template->assign('canManageStandalones', navigationmodule::canManageStandalones()); $template->assign('user', $user); $template->assign('canManagePagesets', $user->isAdmin()); $tpls = $db->selectObjects('section_template', 'parent=0'); $template->assign('templates', $tpls); $template->output(); } else { flash('error', SITE_403_HTML); expHistory::back(); }
# You should have received a copy of the GNU # General Public License along with Exponent; if # not, write to: # # Free Software Foundation, Inc., # 59 Temple Place, # Suite 330, # Boston, MA 02111-1307 USA # # $Id: remove.php,v 1.3 2005/04/03 07:57:14 filetreefrog Exp $ ################################################## if (!defined("PATHOS")) { exit(""); } $section = null; if (isset($_GET['id'])) { $section = $db->selectObject("section", "id=" . $_GET['id']); } if ($section) { if (pathos_permissions_check('manage', pathos_core_makeLocation('navigationmodule', '', $section->id))) { navigationmodule::removeLevel($section->id); $db->decrement("section", "rank", 1, "rank > " . $section->rank . " AND parent=" . $section->parent); $section->parent = -1; $db->updateObject($section, 'section'); pathos_flow_redirect(); } else { echo SITE_403_HTML; } } else { echo SITE_404_HTML; }
<?php ################################################## # # Copyright (c) 2004-2006 OIC Group, Inc. # Written and Designed by James Hunt # # This file is part of Exponent # # Exponent is free software; you can redistribute # it and/or modify it under the terms of the GNU # General Public License as published by the Free # Software Foundation; either version 2 of the # License, or (at your option) any later version. # # GPL: http://www.gnu.org/licenses/gpl.txt # ################################################## if (!defined('EXPONENT')) { exit(''); } if ($user) { $sections = navigationmodule::levelTemplate(0, 0); $standalones = $db->selectObjects('section', 'parent = -1'); $template = new template('navigationmodule', '_linker'); $template->assign('sections', $sections); $template->assign('standalones', $standalones); $template->assign('haveStandalones', count($standalones)); $template->output(); }
# MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU # General Public License along with Exponent; if # not, write to: # # Free Software Foundation, Inc., # 59 Temple Place, # Suite 330, # Boston, MA 02111-1307 USA # # $Id: site.structure.php,v 1.14 2005/04/25 15:35:53 filetreefrog Exp $ # 24/08/2005 MaxxCorp ################################################## if (!defined('PATHOS')) { exit(''); } pathos_lang_loadDictionary('config', 'site'); foreach (glob(BASE . "external/editors/*.glue") as $installed_glue_file) { $installed_editor = basename($installed_glue_file, ".glue"); $installed_editors[$installed_editor] = $installed_editor; } $stuff = array(TR_CONFIG_SITE_TITLE, array('SITE_TITLE' => array('title' => TR_CONFIG_SITE_SITE_TITLE, 'description' => TR_CONFIG_SITE_SITE_TITLE_DESC, 'control' => new textcontrol()), 'USE_LANG' => array('title' => TR_CONFIG_SITE_USE_LANG, 'description' => TR_CONFIG_SITE_USE_LANG, 'control' => new dropdowncontrol(0, pathos_lang_list())), 'SITE_ALLOW_REGISTRATION' => array('title' => TR_CONFIG_SITE_ALLOW_REGISTRATION, 'description' => TR_CONFIG_SITE_ALLOW_REGISTRATION_DESC, 'control' => new checkboxcontrol()), 'SITE_USE_CAPTCHA' => array('title' => TR_CONFIG_SITE_USE_CAPTCHA, 'description' => TR_CONFIG_SITE_USE_CAPTCHA_DESC, 'control' => new checkboxcontrol()), 'SITE_KEYWORDS' => array('title' => TR_CONFIG_SITE_KEYWORDS, 'description' => TR_CONFIG_SITE_KEYWORDS_DESC, 'control' => new texteditorcontrol('', 10, 30)), 'SITE_DESCRIPTION' => array('title' => TR_CONFIG_SITE_DESCRIPTION, 'description' => TR_CONFIG_SITE_DESCRIPTION_DESC, 'control' => new texteditorcontrol('', 15, 50)), 'SITE_404_HTML' => array('title' => TR_CONFIG_SITE_404, 'description' => TR_CONFIG_SITE_404_DESC, 'control' => new htmleditorcontrol('', '', 15, 50)), 'SITE_403_REAL_HTML' => array('title' => TR_CONFIG_SITE_403, 'description' => TR_CONFIG_SITE_403_DESC, 'control' => new htmleditorcontrol('', '', 15, 50)), 'SITE_DEFAULT_SECTION' => array('title' => TR_CONFIG_SITE_DEFAULT_SECTION, 'description' => TR_CONFIG_SITE_DEFAULT_SECTION_DESC, 'control' => new dropdowncontrol('', navigationmodule::hierarchyDropDownControlArray())), 'SITE_WYSIWYG_EDITOR' => array('title' => TR_CONFIG_SITE_WYSIWYG_EDITOR, 'description' => TR_CONFIG_SITE_WYSIWYG_EDITOR_DESC, 'control' => new dropdowncontrol(null, $installed_editors)), 'SESSION_TIMEOUT' => array('title' => TR_CONFIG_SITE_SESSION_TIMEOUT, 'description' => TR_CONFIG_SITE_SESSION_TIMEOUT_DESC, 'control' => new textcontrol()), 'SESSION_TIMEOUT_HTML' => array('title' => TR_CONFIG_SITE_TIMEOUT_ERROR, 'description' => TR_CONFIG_SITE_TIMEOUT_ERROR_DESC, 'control' => new htmleditorcontrol('', 15, 50)), 'FILE_DEFAULT_MODE_STR' => array('title' => TR_CONFIG_SITE_FILEPERMS, 'description' => TR_CONFIG_SITE_FILEPERMS_DESC, 'control' => new dropdowncontrol(null, pathos_config_dropdownData('file_permissions'))), 'DIR_DEFAULT_MODE_STR' => array('title' => TR_CONFIG_SITE_DIRPERMS, 'description' => TR_CONFIG_SITE_DIRPERMS_DESC, 'control' => new dropdowncontrol(null, pathos_config_dropdownData('dir_permissions'))), 'ENABLE_SSL' => array('title' => TR_CONFIG_SITE_ENABLE_SSL, 'description' => TR_CONFIG_SITE_ENABLE_SSL_DESC, 'control' => new checkboxcontrol()), 'NONSSL_URL' => array('title' => TR_CONFIG_SITE_NONSSL_URL, 'description' => TR_CONFIG_SITE_NONSSL_URL_DESC, 'control' => new textcontrol()), 'SSL_URL' => array('title' => TR_CONFIG_SITE_SSL_URL, 'description' => TR_CONFIG_SITE_SSL_URL_DESC, 'control' => new textcontrol()), 'WORKFLOW_REVISION_LIMIT' => array('title' => 'Revision History Limit', 'description' => 'The maximum number of major revisions (excluding the "current" revision) to keep per item of content. A limit of 0 (zero) means that all revisions will be kept.', 'control' => new textcontrol()))); $info = gd_info(); if (!PATHOS_HAS_GD) { $stuff[1]['SITE_USE_CAPTCHA']['description'] = TR_CONFIG_SITE_USE_CAPTCHA_DESC . '<br /><br />' . TR_CONFIG_SITE_USE_CAPTCHA_NOSUPPORT; $stuff[1]['SITE_USE_CAPTCHA']['control']->disabled = true; } return $stuff;
// Initialize the Flow Subsystem. if (!defined('SYS_FLOW')) { require_once BASE . 'subsystems/flow.php'; } // Validate session exponent_sessions_validate(); // Initialize permissions variables exponent_permissions_initialize(); #$section = (exponent_sessions_isset('last_section') ? exponent_sessions_get('last_section') : SITE_DEFAULT_SECTION); if (isset($_REQUEST['action']) && isset($_REQUEST['module'])) { $section = exponent_sessions_isset('last_section') ? exponent_sessions_get('last_section') : SITE_DEFAULT_SECTION; } else { $section = isset($_REQUEST['section']) ? $_REQUEST['section'] : SITE_DEFAULT_SECTION; } $section = $db->selectObject('section', 'id=' . intval($section)); if (!navigationmodule::canView($section)) { define('AUTHORIZED_SECTION', 0); } else { define('AUTHORIZED_SECTION', 1); } if (!navigationmodule::isPublic(intval($section))) { define('PUBLIC_SECTION', 0); } else { define('PUBLIC_SECTION', 1); } function eDebug($var) { echo "<xmp>"; print_r($var); echo "</xmp>"; }
$section->sef_name = $router->encode($section->name); } if (!section::isValidName($section->sef_name)) { expValidator::failAndReturnToForm('You have invalid characters in the SEF Name field.'); } if (section::isDuplicateName($section)) { expValidator::failAndReturnToForm(gt('The name specified in the SEF Name field is a duplicate of an existing page.')); } if (isset($section->id)) { if ($section->parent != $old_parent) { // Old_parent id was different than the new parent id. Need to decrement the ranks // of the old children (after ours), and then add $section = section::changeParent($section, $old_parent, $section->parent); } // Existing section. Update the database record. // The 'id=x' where clause is implicit with an updateObject $db->updateObject($section, 'section'); } else { // Since this is new, we need to increment ranks, in case the user // added it in the middle of the level. $db->increment('section', 'rank', 1, 'rank >= ' . $section->rank . ' AND parent=' . $section->parent); // New section. Insert a new database record. $section->id = $db->insertObject($section, 'section'); } expSession::clearAllUsersSessionCache('navigationmodule'); navigationmodule::checkForSectionalAdmins($section->id); // Go back to where we came from. Probably the navigation manager. expHistory::back(); } else { echo SITE_403_HTML; }
} $section = section::updatePageset($_POST, null); // make sure the SEF name is valid global $router; if (empty($section->sef_name)) { $section->sef_name = $router->encode($section->name); } if (!section::isValidName($section->sef_name)) { expValidator::failAndReturnToForm(gt('You have invalid characters in the SEF Name field.')); } if (section::isDuplicateName($section)) { expValidator::failAndReturnToForm(gt('The name specified in the SEF Name field is a duplicate of an existing page.')); } if (expPermissions::check('manage', expCore::makeLocation('navigationmodule', '', $section->parent))) { // Still have to do some pageset processing, mostly handled by a handy // member method of the navigationmodule class. // Since this is new, we need to increment ranks, in case the user // added it in the middle of the level. $db->increment('section', 'rank', 1, 'rank >= ' . $section->rank . ' AND parent=' . $section->parent); // New section (Pagesets always are). Insert a new database // record, and save the ID for the processing methods that need them. $section->id = $db->insertObject($section, 'section'); // Process the pageset, to add sections and subsections, as well as default content // that the pageset writer added to each element of the set. expSession::clearAllUsersSessionCache('navigationmodule'); navigationmodule::process_section($section, $_POST['pageset']); // Go back to where we came from. Probably the navigation manager. expHistory::back(); } else { echo SITE_403_HTML; }
/** exdoc * Creates a location object, based off of the three arguments passed, and returns it. * * @internal param \The $mo module component of the location. * * @internal param \The $src source component of the location. * * @internal param \The $int internal component of the location. * @return array * @node Subsystems:expCore */ public static function initializeNavigation() { // $sections = array(); $sections = navigationmodule::levelTemplate(0, 0); return $sections; }
function internalAliasForm($object = null) { $i18n = exponent_lang_loadFile('datatypes/section.php'); // Initialize the forms subsystem for use. if (!defined('SYS_FORMS')) { require_once BASE . 'subsystems/forms.php'; } exponent_forms_initialize(); // Initialization if (!isset($object->id)) { $object->internal_id = 0; } // Grab the basic form that all page types share // This has the name and positional dropdowns registered. // This call also initializes the section object, if it is not an existing section. $form = section::_commonForm($object); // Add a dropdown to allow the user to choose an internal page. $form->register('internal_id', $i18n['internal_link'], new dropdowncontrol($object->internal_id, navigationmodule::levelDropDownControlArray(0, 0))); // Add the'Public?' checkbox. The 'Active?' checkbox is omitted, because it makes no sense. $form->register('public', $i18n['public'], new checkboxcontrol($object->public)); // Add a Submit / Cancel button. $form->register('submit', '', new buttongroupcontrol($i18n['save'], '', $i18n['cancel'])); // Return the form to the calling scope (usually an action in the navigation module). return $form; }