Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 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();
     }
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
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 "";
            }
        }
    }
}
 function delete($object, $rerank = false)
 {
     if ($object == null) {
         return false;
     }
     $internal = unserialize($object->internal);
     global $db;
     $section = pathos_sessions_get("last_section");
     $locref = $db->selectObject("locationref", "module='" . $internal->mod . "' AND source='" . $internal->src . "' AND internal='" . $internal->int . "'");
     $secref = $db->selectObject("sectionref", "module='" . $internal->mod . "' AND source='" . $internal->src . "' AND internal='" . $internal->int . "' AND section={$section}");
     if ($locref) {
         $locref->refcount -= 1;
         $db->updateObject($locref, "locationref", "module='" . $internal->mod . "' AND source='" . $internal->src . "' AND internal='" . $internal->int . "'");
     }
     if ($secref) {
         $secref->refcount -= 1;
         $db->updateObject($secref, "sectionref", "module='" . $internal->mod . "' AND source='" . $internal->src . "' AND internal='" . $internal->int . "' AND section={$section}");
     }
     // Fix ranks
     if ($rerank) {
         $db->decrement("container", "rank", 1, "external='" . $object->external . "' AND rank > " . $object->rank);
     }
 }
Esempio n. 6
0
#
# 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.
#
# Exponent is distributed in the hope that it
# will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of
# 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: normal.php,v 1.3 2005/02/19 00:32:35 filetreefrog Exp $
##################################################
if (!defined("PATHOS")) {
    exit("");
}
$levels = pathos_sessions_get('uilevels');
pathos_sessions_set('uilevel', max(array_keys($levels)));
pathos_flow_redirect();
Esempio n. 7
0
    require_once BASE . 'subsystems/sessions.php';
}
if (isset($_GET['redirecturl'])) {
    $redirect = urldecode($_GET['redirecturl']);
    if (substr($redirect, 0, 4) != 'http') {
        $redirect = URL_FULL . $redirect;
    }
    pathos_sessions_set('redirecturl', $redirect);
}
// Initialize the Theme Subsystem
if (!defined('SYS_THEME')) {
    require_once BASE . 'subsystems/theme.php';
}
$SYS_FLOW_REDIRECTIONPATH = 'loginredirect';
if (pathos_sessions_loggedIn()) {
    $url = pathos_sessions_get('redirecturl');
    if ($url . '' == '') {
        $SYS_FLOW_REDIRECTIONPATH = 'default';
        pathos_flow_redirect();
    }
    header('Location: ' . $url);
    exit('Redirecting...');
} else {
    if (isset($_REQUEST['module']) && isset($_REQUEST['action'])) {
        pathos_theme_runAction();
        loginmodule::show(DEFAULT_VIEW, null);
    } else {
        pathos_flow_set(SYS_FLOW_PUBLIC, SYS_FLOW_SECTIONAL);
        loginmodule::show(DEFAULT_VIEW, null);
    }
}
Esempio n. 8
0
# 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);
}
Esempio n. 9
0
# $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");
} else {
Esempio n. 10
0
function pathos_theme_goDefaultSection()
{
    $last_section = pathos_sessions_get("last_section");
    if (defined("SITE_DEFAULT_SECTION") && SITE_DEFAULT_SECTION != $last_section) {
        header("Location: " . URL_FULL . "index.php?section=" . SITE_DEFAULT_SECTION);
        exit('Redirecting...');
    } else {
        global $db;
        $section = $db->selectObject("section", "public = 1 AND active = 1");
        // grab first section, go there
        if ($section) {
            header("Location: " . URL_FULL . "index.php?section=" . $section->id);
            exit('Redirecting...');
        } else {
            echo SITE_404_HTML;
        }
    }
}
Esempio n. 11
0
function pathos_permissions_initialize()
{
    global $pathos_permissions_r;
    $pathos_permissions_r = pathos_sessions_get("permissions");
}
Esempio n. 12
0
     $container->view = '';
     $container->internal = pathos_core_makeLocation();
     $container->title = '';
     $container->rank = $_GET['rank'];
     $container->is_private = 0;
 } else {
     $container->internal = unserialize($container->internal);
     $locref = $db->selectObject('locationref', "module='" . $container->internal->mod . "' AND source='" . $container->internal->src . "'");
 }
 $template = new template('containermodule', '_form_edit', $loc);
 $template->assign('rerank', isset($_GET['rerank']) ? 1 : 0);
 $template->assign('container', $container);
 $template->assign('locref', $locref);
 $template->assign('is_edit', isset($container->id));
 $template->assign('can_activate_modules', $user->is_acting_admin);
 $template->assign('current_section', pathos_sessions_get('last_section'));
 if (!defined('SYS_JAVASCRIPT')) {
     require_once BASE . 'subsystems/javascript.php';
 }
 $haveclass = false;
 $mods = array();
 $modules_list = isset($container->id) ? pathos_modules_list() : pathos_modules_listActive();
 if (!count($modules_list)) {
     // No active modules
     $template->assign('nomodules', 1);
 } else {
     $template->assign('nomodules', 0);
 }
 if (!defined('SYS_SORTING')) {
     require_once BASE . 'subsystems/sorting.php';
 }
Esempio n. 13
0
# 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: saveuser.php,v 1.9 2005/04/18 15:24:22 filetreefrog Exp $
##################################################
if (!defined('PATHOS')) {
    exit('');
}
if (!$user && SITE_ALLOW_REGISTRATION == 1) {
    pathos_lang_loadDictionary('modules', 'loginmodule');
    $capcha_real = pathos_sessions_get('capcha_string');
    if (!defined('SYS_USERS')) {
        require_once BASE . 'subsystems/users.php';
    }
    if (!defined('SYS_SECURITY')) {
        require_once BASE . 'subsystems/security.php';
    }
    if (pathos_users_getUserByName($_POST['username']) != null) {
        $post = $_POST;
        unset($post['username']);
        $post['_formError'] = TR_LOGINMODULE_USERNAMETAKEN;
        pathos_sessions_set('last_POST', $post);
        header('Location: ' . $_SERVER['HTTP_REFERER']);
    } else {
        if ($_POST['pass1'] != $_POST['pass2']) {
            $post = $_POST;
# 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);
        $obj->output = ob_get_contents();
Esempio n. 15
0
# 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: finish.php,v 1.4 2005/04/18 15:23:54 filetreefrog Exp $
##################################################
if (!defined('PATHOS')) {
    exit('');
}
$dest_dir = pathos_sessions_get('dest_dir');
$files = pathos_sessions_get('files_data');
if (!defined('SYS_FILES')) {
    require_once BASE . 'subsystems/files.php';
}
if (!file_exists(BASE . 'files')) {
    mkdir(BASE . 'files', 0777);
}
foreach (array_keys($files) as $mod) {
    pathos_files_copyDirectoryStructure($dest_dir . '/files/' . $mod, BASE . 'files/' . $mod);
    foreach (array_keys($files[$mod][1]) as $file) {
        copy($dest_dir . '/files/' . $mod . '/' . $file, BASE . 'files/' . $mod . '/' . $file);
    }
}
pathos_sessions_unset('dest_dir');
pathos_sessions_unset('files_data');
pathos_files_removeDirectory($dest_dir);
Esempio n. 16
0
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);
}
<?php

define("SCRIPT_EXP_RELATIVE", "external/editors/connector/");
define("SCRIPT_FILENAME", "content_linked.php");
include_once "../../../pathos.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<script type="text/javascript">
		/* <![CDATA[ */
			var f_url = window.opener.document.getElementById("f_href");
			f_url.value = "?section=<?php 
echo pathos_sessions_get("last_section");
?>
#mod_<?php 
echo $_GET['cid'];
?>
";
			var f_extern = window.opener.document.getElementById("f_extern");
			f_extern.checked = false;
			//TODO: find a way(maybe via containermod:_source_picker.tpl) to pass the title of the contained module to the Link Picker
			window.close();
		/* ]]> */
		</script>
	</head>
	<body/>
</html>
Esempio n. 18
0
 function show($view, $loc = null, $title = '')
 {
     $id = pathos_sessions_get('last_section');
     $current = null;
     $sections = navigationmodule::getHierarchy();
     foreach (array_keys($sections) as $sid) {
         if ($id == $sid) {
             $current = $sections[$sid];
             break;
         }
     }
     $template = new template('navigationmodule', $view, $loc);
     $template->assign('sections', $sections);
     $template->assign('current', $current);
     $template->assign('canManage', pathos_permissions_checkOnModule('manage', 'navigationmodule'));
     $template->assign('title', $title);
     $template->output();
 }
Esempio n. 19
0
 function wrapOutput($modclass, $view, $loc = null, $title = '')
 {
     if (defined('SOURCE_SELECTOR') && strtolower($modclass) != 'containermodule') {
         $container = null;
         $mod = new $modclass();
         ob_start();
         $mod->show($view, $loc, $title);
         $container->output = ob_get_contents();
         ob_end_clean();
         $source_select = pathos_sessions_get('source_select');
         $c_view = $source_select['view'];
         $c_module = $source_select['module'];
         $clickable_mods = $source_select['showmodules'];
         if (!is_array($clickable_mods)) {
             $clickable_mods = null;
         }
         $dest = $source_select['dest'];
         $template = new template($c_module, $c_view, $loc);
         if ($dest) {
             $template->assign('dest', $dest);
         }
         $container->info = array('module' => $mod->name(), 'source' => $loc->src, 'hasContent' => $mod->hasContent(), 'hasSources' => $mod->hasSources(), 'hasViews' => $mod->hasViews(), 'class' => $modclass, 'clickable' => $clickable_mods == null || in_array($modclass, $clickable_mods));
         $template->assign('container', $container);
         $template->output();
     } else {
         call_user_func(array($modclass, 'show'), $view, $loc, $title);
     }
 }
Esempio n. 20
0
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...');
}
Esempio n. 21
0
# 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: user_imp.php,v 1.3 2005/02/19 16:53:35 filetreefrog Exp $
##################################################
$opt = $_POST['user_config'];
//Set option from previous page
$post = array_merge($_POST, pathos_sessions_get("post"));
//Stores POST information in an array
if ($opt == -1) {
    //User did not select a username conflict resolution option
    //Sets error messages
    $post['_formError'] = "Please select an option to handle the username conflicts!";
    pathos_sessions_set("last_POST", $post);
    //Puts $post array in the session for later retrieval
    header("Location: " . $_SERVER['HTTP_REFERER']);
    //Sends user to username conflict page
    exit;
}
//Grabs pMachine database
$pm_db = pathos_database_connect($post['username'], $post['pwd'], $post['host'] . ":" . $post['port'], $post['dbname'], $post['dbengine'], 1);
//Sets pMachine database prefix
$pm_db->prefix = $post['pm_prefix'];
Esempio n. 22
0
// 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';
        }
Esempio n. 23
0
 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 .= "&nbsp;";
         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 .= "&nbsp;&nbsp;";
         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 .= '&nbsp;';
         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;
 }
Esempio n. 24
0
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: loginredirect.php,v 1.6 2005/03/28 19:02:19 filetreefrog Exp $
##################################################
if (!defined('PATHOS')) {
    exit('');
}
ob_start();
if (isset($_GET['redirecturl'])) {
    $redirect = urldecode($_GET['redirecturl']);
    if (substr($redirect, 0, 4) != 'http') {
        $redirect = URL_FULL . $redirect;
    }
    pathos_sessions_set('redirecturl', $redirect);
}
//$SYS_FLOW_REDIRECTIONPATH = 'loginredirect';
pathos_flow_set(SYS_FLOW_PUBLIC, SYS_FLOW_ACTION);
if (pathos_sessions_loggedIn()) {
    header('Location: ' . pathos_sessions_get('redirecturl'));
    exit('Redirecting...');
}
loginmodule::show('Default', null, 'Log In');
$template = new template('loginmodule', '_login_redirect');
$template->assign('output', ob_get_contents());
ob_end_clean();
$template->output();
Esempio n. 25
0
 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;
 }