function show($view, $loc, $title = '') { $template = new template('imagemanagermodule', $view, $loc); $uilevel = 99; // MAX if (pathos_sessions_isset("uilevel")) { $uilevel = pathos_sessions_get("uilevel"); } $template->assign('show', defined('SELECTOR') || $uilevel > UILEVEL_PREVIEW ? 1 : 0); if (!defined('SYS_FILES')) { require_once BASE . 'subsystems/files.php'; } $directory = 'files/imagemanagermodule/' . $loc->src; if (!file_exists(BASE . $directory)) { $err = pathos_files_makeDirectory($directory); if ($err != SYS_FILES_SUCCESS) { $template->assign('noupload', 1); $template->assign('uploadError', $err); } } global $db; $items = $db->selectObjects("imagemanageritem", "location_data='" . serialize($loc) . "'"); $files = $db->selectObjectsIndexedArray("file", "directory='{$directory}'"); $template->assign('items', $items); $template->assign('files', $files); $template->assign('moduletitle', $title); $template->register_permissions(array('administrate', 'post', 'edit', 'delete'), $loc); $template->output(); }
function show($view, $loc = null, $title = "") { $ui_levels = pathos_sessions_get("uilevels"); if (count($ui_levels)) { $template = new template("uiswitchermodule", $view, $loc); $template->assign("levels", $ui_levels); $default = pathos_sessions_isset("uilevel") ? pathos_sessions_get("uilevel") : max(array_keys($ui_levels)); $template->assign("default_level", $default); $template->output(); } }
function show($view, $loc = null, $title = '') { $template = new template('previewmodule', $view, $loc); $level = 99; if (pathos_sessions_isset('uilevel')) { $level = pathos_sessions_get('uilevel'); } $template->assign('editMode', pathos_sessions_loggedIn() && $level != UILEVEL_PREVIEW); $template->assign('title', $title); $template->assign('previewMode', $level == UILEVEL_PREVIEW); $template->output($view); }
function smarty_block_permissions($params, $content, &$smarty, &$repeat) { if ($content) { $uilevel = 99; // MAX if (pathos_sessions_isset("uilevel")) { $uilevel = pathos_sessions_get("uilevel"); } if (defined("PREVIEW_READONLY")) { $uilevel = -1; } $blocklevel = isset($params['level']) ? $params['level'] : 0; if ($blocklevel == UILEVEL_PERMISSIONS && substr($smarty->_tpl_vars['__loc']->src, 0, 5) == "@uid_") { return ""; } else { if ($blocklevel <= $uilevel) { return $content; } else { return ""; } } } }
ob_start(); // Initialize the Theme Subsystem if (!defined('SYS_THEME')) { require_once BASE . 'subsystems/theme.php'; } $section = pathos_sessions_isset('last_section') ? pathos_sessions_get('last_section') : SITE_DEFAULT_SECTION; $section = $db->selectObject('section', 'id=' . $section); // Handle sub themes $page = $section && $section->subtheme != '' && is_readable('themes/' . DISPLAY_THEME . '/subthemes/' . $section->subtheme . '.php') ? 'themes/' . DISPLAY_THEME . '/subthemes/' . $section->subtheme . '.php' : 'themes/' . DISPLAY_THEME . '/index.php'; if (is_readable(BASE . $page)) { define('PREVIEW_READONLY', 1); // for mods define('SELECTOR', 1); $SYS_FLOW_REDIRECTIONPATH = 'source_selector'; $source_select = array(); if (pathos_sessions_isset('source_select')) { $source_select = pathos_sessions_get('source_select'); } $count_orig = count($source_select); if (isset($_REQUEST['vview'])) { $source_select['view'] = $_REQUEST['vview']; } else { if (!isset($source_select['view'])) { $source_select['view'] = '_sourcePicker'; } } if (isset($_REQUEST['vmod'])) { $source_select['module'] = $_REQUEST['vmod']; } else { if (!isset($source_select['module'])) { $source_select['module'] = 'containermodule';
# 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: captcha.php,v 1.6 2005/02/19 00:40:17 filetreefrog Exp $ ################################################## include_once dirname(realpath(__FILE__)) . '/pathos.php'; include_once dirname(realpath(__FILE__)) . '/subsystems/image.php'; $w = isset($_GET['w']) ? $_GET['w'] : 200; $h = isset($_GET['h']) ? $_GET['h'] : 50; $name = isset($_GET['name']) ? $_GET['name'] : 'capcha_string'; if (pathos_sessions_isset($name)) { $str = pathos_sessions_get($name); } else { $str = strtoupper(substr(md5(rand()), 17, 6)); pathos_sessions_set($name, $str); } $img = pathos_image_captcha($w, $h, $str); if ($img) { $sizeinfo = array('mime' => 'image/png'); ob_end_clean(); pathos_image_output($img, $sizeinfo); }
function pathos_flow_redirect($url_type = SYS_FLOW_NONE) { global $SYS_FLOW_REDIRECTIONPATH; $access_level = pathos_sessions_loggedIn() ? SYS_FLOW_PROTECTED : SYS_FLOW_PUBLIC; // Fallback to the default redirection path in strange edge cases. if (!pathos_sessions_isset($SYS_FLOW_REDIRECTIONPATH . '_flow_last_' . $access_level)) { $SYS_FLOW_REDIRECTIONPATH = 'pathos_default'; } $url = ''; switch ($url_type) { case SYS_FLOW_NONE: $url = pathos_sessions_get($SYS_FLOW_REDIRECTIONPATH . '_flow_last_' . $access_level); break; case SYS_FLOW_SECTIONAL: case SYS_FLOW_ACTION: $url = pathos_sessions_get($SYS_FLOW_REDIRECTIONPATH . '_flow_' . $access_level . '_' . $url_type); break; } if ($url == '') { $url = URL_FULL . 'index.php?section=' . SITE_DEFAULT_SECTION; } if (DEVELOPMENT >= 2) { echo '<a href="' . $url . '">' . $url . '</a>'; } else { header("Location: {$url}"); } exit('Redirecting...'); }
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); }
function toHTML($form_id) { // Form validation script if ($this->validationScript != "") { $this->scripts[] = $this->validationScript; $this->controls["submit"]->validateJS = "validate(this.form)"; } // Persistent Form Data extension $formError = ""; if (pathos_sessions_isset("last_POST")) { // We have cached POST data. Use it to update defaults. $last_POST = pathos_sessions_get("last_POST"); foreach (array_keys($this->controls) as $name) { // may need to look to control a la parseData $this->controls[$name]->default = @$last_POST[$name]; } $formError = @$last_POST['_formError']; pathos_sessions_unset("last_POST"); } $html = "<!-- Form Object '" . $this->name . "' -->\r\n"; $html .= "<script type=\"text/javascript\" src=\"" . PATH_RELATIVE . "subsystems/forms/js/inputfilters.js.php\"></script>\r\n"; foreach ($this->scripts as $name => $script) { $html .= "<script type=\"text/javascript\" src=\"{$script}\"></script>\r\n"; } $html .= $formError; $html .= "<form name=\"" . $this->name . "\" method=\"" . $this->method . "\" action=\"" . $this->action . "\" enctype=\"" . $this->enctype . "\">\r\n"; foreach ($this->meta as $name => $value) { $html .= "<input type=\"hidden\" name=\"{$name}\" id=\"{$name}\" value=\"{$value}\" />\r\n"; } $html .= "<table cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">\r\n"; $rank = 0; foreach ($this->controlIdx as $name) { $html .= "<tr><td valign=\"top\">" . $this->controlLbl[$name] . "</td><td style='padding-left: 5px;' valign=\"top\">"; $html .= $this->controls[$name]->controlToHTML($name) . "\r\n"; $html .= "<td>"; if ($rank != count($this->controlIdx) - 1) { $html .= '<a href="?module=formbuilder&action=order_controls&p=' . $form_id . '&a=' . $rank . '&b=' . ($rank + 1) . '">'; $html .= "<img border='0' src='" . ICON_RELATIVE . "down.png' />"; $html .= '</a>'; } else { $html .= "<img src='" . ICON_RELATIVE . "down.disabled.png' />"; } $html .= " "; if ($rank != 0) { $html .= '<a href="?module=formbuilder&action=order_controls&p=' . $form_id . '&a=' . $rank . '&b=' . ($rank - 1) . '">'; $html .= "<img border='0' src='" . ICON_RELATIVE . "up.png' />"; $html .= '</a>'; } else { $html .= "<img src='" . ICON_RELATIVE . "up.disabled.png' />"; } $html .= " "; if (!$this->controls[$name]->_readonly) { $html .= '<a href="?module=formbuilder&action=edit_control&id=' . $this->controls[$name]->_id . '&form_id=' . $form_id . '">'; $html .= '<img border="0" src="' . ICON_RELATIVE . 'edit.png" />'; $html .= '</a>'; } else { $html .= '<img border="0" src="' . ICON_RELATIVE . 'edit.disabled.png" />'; } $html .= ' '; if (!$this->controls[$name]->_readonly && $this->controls[$name]->_controltype != 'htmlcontrol') { $html .= '<a href="?module=formbuilder&action=delete_control&id=' . $this->controls[$name]->_id . '" onClick="return confirm(\'Are you sure you want to delete this control? All data associated with it will be removed from the database!\');">'; } else { $html .= '<a href="?module=formbuilder&action=delete_control&id=' . $this->controls[$name]->_id . '" onClick="return confirm(\'Are you sure you want to delete this?\');">'; } $html .= '<img border="0" src="' . ICON_RELATIVE . 'delete.png" />'; $html .= '</a>'; $html .= "</td>"; $html .= "</td></tr>"; $rank++; } $html .= "<tr><td width='5%'></td><td wdith='90%'><td></td width='5%'></tr>\r\n"; $html .= "</table>\r\n"; $html .= "</form>\r\n"; return $html; }
function show($view, $loc = null, $title = '') { pathos_lang_loadDictionary('modules', 'containermodule'); $source_select = array(); $clickable_mods = null; // Show all $dest = null; $singleview = '_container'; $singlemodule = 'containermodule'; if (pathos_sessions_isset('source_select') && defined('SELECTOR')) { $source_select = pathos_sessions_get('source_select'); $singleview = $source_select['view']; $singlemodule = $source_select['module']; $clickable_mods = $source_select['showmodules']; if (!is_array($clickable_mods)) { $clickable_mods = null; } $dest = $source_select['dest']; } global $db; $container = null; if (!isset($this) || !isset($this->_hasParent) || $this->_hasParent == 0) { // Top level container. $container = $db->selectObject('container', "external='" . serialize(null) . "' AND internal='" . serialize($loc) . "'"); if ($container == null) { $container->external = serialize(null); $container->internal = serialize($loc); $container->view = $view; $container->title = $title; $container->id = $db->insertObject($container, 'container'); } if (!defined('PREVIEW_READONLY') || defined('SELECTOR')) { $view = $container->view; } $title = $container->title; } $template = new template('containermodule', $view, $loc); if ($dest) { $template->assign('dest', $dest); } $template->assign('singleview', $singleview); $template->assign('singlemodule', $singlemodule); $template->assign('top', $container); $containers = array(); foreach ($db->selectObjects('container', "external='" . serialize($loc) . "'") as $c) { if ($c->is_private == 0 || pathos_permissions_check('view', pathos_core_makeLocation($loc->mod, $loc->src, $c->id))) { $containers[$c->rank] = $c; } } if (!defined('SYS_WORKFLOW')) { require_once BASE . 'subsystems/workflow.php'; } ksort($containers); foreach (array_keys($containers) as $i) { $location = unserialize($containers[$i]->internal); $modclass = $location->mod; if (class_exists($modclass)) { $mod = new $modclass(); ob_start(); $mod->_hasParent = 1; $mod->show($containers[$i]->view, $location, $containers[$i]->title); $containers[$i]->output = trim(ob_get_contents()); ob_end_clean(); $policy = pathos_workflow_getPolicy($modclass, $location->src); $containers[$i]->info = array('module' => $mod->name(), 'source' => $location->src, 'hasContent' => $mod->hasContent(), 'hasSources' => $mod->hasSources(), 'hasViews' => $mod->hasViews(), 'class' => $modclass, 'supportsWorkflow' => $mod->supportsWorkflow() ? 1 : 0, 'workflowPolicy' => $policy ? $policy->name : '', 'workflowUsesDefault' => pathos_workflow_moduleUsesDefaultPolicy($location->mod, $location->src) ? 1 : 0, 'clickable' => $clickable_mods == null || in_array($modclass, $clickable_mods)); } else { $containers[$i]->output = sprintf(TR_CONTAINERMODULE_MODNOTFOUND, $location->mod); $containers[$i]->info = array('module' => sprintf(TR_CONTAINERMODULE_UNKNOWNMOD, $location->mod), 'source' => $location->src, 'hasContent' => 0, 'hasSources' => 0, 'hasViews' => 0, 'class' => $modclass, 'supportsWorkflow' => 0, 'workflowPolicy' => '', 'workflowUsesDefault' => 0, 'clickable' => 0); } $containers[$i]->moduleLocation = $location; $cloc = null; $cloc->mod = $loc->mod; $cloc->src = $loc->src; $cloc->int = $containers[$i]->id; $containers[$i]->permissions = array('administrate' => pathos_permissions_check('administrate', $location) ? 1 : 0, 'configure' => pathos_permissions_check('configure', $location) ? 1 : 0); //$containers[$i]->hasPerms = pathos_permissions_checkOnSource($location->mod,$location->src); } $template->assign('containers', $containers); $template->assign('hasParent', isset($this) && isset($this->_hasParent) ? 1 : 0); $template->register_permissions(array('administrate', 'add_module', 'edit_module', 'delete_module', 'order_modules'), $loc); $template->output(); }
# # $Id: edit_page.php,v 1.7 2005/04/18 15:24:44 filetreefrog Exp $ ################################################## define("SCRIPT_EXP_RELATIVE", "modules/navigationmodule/actions/"); define("SCRIPT_FILENAME", "edit_page.php"); ob_start(); require_once "../../../pathos.php"; if (!defined("SYS_THEME")) { require_once BASE . "subsystems/theme.php"; } $id = -1; if (isset($_GET['sitetemplate_id'])) { pathos_sessions_set("sitetemplate_id", $_GET['sitetemplate_id']); $id = $_GET['sitetemplate_id']; } else { if (pathos_sessions_isset("sitetemplate_id")) { $id = pathos_sessions_get("sitetemplate_id"); } } $template = $db->selectObject("section_template", "id=" . $id); $page = $template && $template->subtheme != "" && is_readable(BASE . "themes/" . DISPLAY_THEME . "/subthemes/" . $template->subtheme . ".php") ? "themes/" . DISPLAY_THEME . "/subthemes/" . $template->subtheme . ".php" : "themes/" . DISPLAY_THEME . "/index.php"; pathos_sessions_set("themeopt_override", array("src_prefix" => "@st" . $id, "ignore_mods" => array("navigationmodule", "loginmodule"), "mainpage" => PATH_RELATIVE . "modules/navigationmodule/actions/edit_page.php", "backlinktext" => "Back to Template")); #define("PREVIEW_READONLY",1); $REDIRECTIONPATH = "section_template"; if ($user && $user->is_acting_admin == 1) { if (is_readable(BASE . $page)) { include_once BASE . $page; } else { echo BASE . "{$page} not readable"; } pathos_sessions_unset("themeopt_override");
function pathos_theme_runAction() { if (pathos_theme_inAction()) { if (!AUTHORIZED_SECTION) { echo SITE_403_HTML; // return; } if (pathos_sessions_isset("themeopt_override")) { $config = pathos_sessions_get("themeopt_override"); echo "<a class='mngmntlink sitetemplate_mngmntlink' href='" . $config['mainpage'] . "'>" . $config['backlinktext'] . "</a><br /><br />"; } global $db, $user; $loc = null; $loc->mod = $_REQUEST['module']; $loc->src = isset($_REQUEST['src']) ? $_REQUEST['src'] : ""; $loc->int = isset($_REQUEST['int']) ? $_REQUEST['int'] : ""; $actfile = "/" . $_REQUEST['module'] . "/actions/" . $_REQUEST['action'] . ".php"; if (isset($_REQUEST['_common'])) { $actfile = "/common/actions/" . $_REQUEST['action'] . ".php"; } if (is_readable(BASE . 'modules/' . $actfile)) { include_once BASE . 'modules/' . $actfile; } else { pathos_lang_loadDictionary('subsystems', 'theme'); echo SITE_404_HTML . '<br /><br /><hr size="1" />'; echo sprintf(TR_THEMESUBSYSTEM_NOSUCHACTION, strip_tags($_REQUEST['module']), strip_tags($_REQUEST['action'])); echo '<br />'; } } }
# Suite 330, # Boston, MA 02111-1307 USA # # $Id: orphans_content.php,v 1.6 2005/04/26 04:40:34 filetreefrog Exp $ ################################################## if (!defined("PATHOS")) { exit(""); } // PERM CHECK $source_select = array(); $module = "containermodule"; $view = "_sourcePicker"; $clickable_mods = null; // Show all $dest = null; if (pathos_sessions_isset("source_select") && (defined("SOURCE_SELECTOR") || defined("CONTENT_SELECTOR"))) { $source_select = pathos_sessions_get("source_select"); $view = $source_select["view"]; $module = $source_select["module"]; $clickable_mods = $source_select["showmodules"]; $dest = $source_select['dest']; } $orphans = array(); foreach ($db->selectObjects("locationref", "module='" . $_GET['module'] . "' AND refcount=0") as $orphan) { $obj = null; $loc = pathos_core_makeLocation($orphan->module, $orphan->source, $orphan->internal); if (class_exists($orphan->module)) { $modclass = $orphan->module; $mod = new $modclass(); ob_start(); $mod->show("Default", $loc);
function toHTML() { // Form validation script if ($this->validationScript != "") { $this->scripts[] = $this->validationScript; $this->controls["submit"]->validateJS = "validate(this.form)"; } // Persistent Form Data extension $formError = ""; if (pathos_sessions_isset("last_POST")) { // We have cached POST data. Use it to update defaults. $last_POST = pathos_sessions_get("last_POST"); foreach (array_keys($this->controls) as $name) { // may need to look to control a la parseData $this->controls[$name]->default = @$last_POST[$name]; $this->controls[$name]->inError = 1; // Status flag for controls that need to do some funky stuff. } $formError = @$last_POST['_formError']; pathos_sessions_unset("last_POST"); } $html = "<!-- Form Object '" . $this->name . "' -->\r\n"; $html .= "<script type=\"text/javascript\" src=\"" . PATH_RELATIVE . "subsystems/forms/js/inputfilters.js.php\"></script>\r\n"; foreach ($this->scripts as $name => $script) { $html .= "<script type=\"text/javascript\" src=\"{$script}\"></script>\r\n"; } $html .= '<div class="error">' . $formError . '</div>'; $html .= "<form name=\"" . $this->name . "\" method=\"" . $this->method . "\" action=\"" . $this->action . "\" enctype=\"" . $this->enctype . "\">\r\n"; foreach ($this->meta as $name => $value) { $html .= "<input type=\"hidden\" name=\"{$name}\" id=\"{$name}\" value=\"{$value}\" />\r\n"; } $html .= "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n"; foreach ($this->controlIdx as $name) { $html .= $this->controls[$name]->toHTML($this->controlLbl[$name], $name) . "\r\n"; } $html .= "<tr><td width='5%'></td><td width='95%'></td></tr>\r\n"; $html .= "</table>\r\n"; $html .= "</form>\r\n"; return $html; }