示例#1
0
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: view_dictionary.php,v 1.4 2005/03/13 20:40:47 filetreefrog Exp $
##################################################
if (!defined("PATHOS")) {
    exit("");
}
$lang = null;
if (isset($_GET['lang_id'])) {
    $lang = $db->selectObject('translation_language', 'id=' . $_GET['lang_id']);
}
if ($lang) {
    pathos_flow_set(SYS_FLOW_PROTECTED, SYS_FLOW_ACTION);
    $ref_constants = translatormodule::parseDictionary($_GET['type'], $_GET['name'], 'en');
    $these_constants = array();
    foreach ($db->selectObjects('translation_dictentry', "lang_id='" . $lang->id . "' AND dictionary='" . $_GET['type'] . '/' . $_GET['name'] . "'") as $entry) {
        $these_constants[$entry->constant] = $entry;
    }
    $added_constants = array_diff(array_keys($ref_constants), array_keys($these_constants));
    $removed_constants = array_diff(array_keys($these_constants), array_keys($ref_constants));
    $all_constants = array_merge(array_keys($these_constants), $added_constants);
    usort($all_constants, 'strnatcmp');
    $template = new template('translatormodule', '_viewDictionary');
    $template->assign('d_type', $_GET['type']);
    $template->assign('d_name', $_GET['name']);
    $template->assign('lang', $lang);
    $template->assign('ref_constants', $ref_constants);
    $template->assign('these_constants', $these_constants);
示例#2
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();
示例#3
0
function pathos_theme_mainContainer()
{
    if (!AUTHORIZED_SECTION) {
        // Set this so that a login on an Auth Denied page takes them back to the previously Auth-Denied page
        pathos_flow_set(SYS_FLOW_PROTECTED, SYS_FLOW_SECTIONAL);
        echo SITE_403_HTML;
        return;
    }
    if (PUBLIC_SECTION) {
        pathos_flow_set(SYS_FLOW_PUBLIC, SYS_FLOW_SECTIONAL);
    } else {
        pathos_flow_set(SYS_FLOW_PROTECTED, SYS_FLOW_SECTIONAL);
    }
    #	if (pathos_sessions_isset("themeopt_override")) {
    #		$config = pathos_sessions_get("themeopt_override");
    pathos_theme_showSectionalModule("containermodule", "Default", "", "@section");
    #	} else {
    #		pathos_theme_showSectionalModule("containermodule","Default","","@section");
    #	}
}
示例#4
0
    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);
    }
}
$template = new standalonetemplate('loginredirect');
$template->assign('output', ob_get_contents());
ob_end_clean();
$template->output();
示例#5
0
 function show($view, $loc = null)
 {
     global $db;
     if (!defined("SYS_FORMS")) {
         require_once BASE . "subsystems/forms.php";
     }
     pathos_forms_initialize();
     if (defined("PREVIEW_READONLY") && !defined("SELECTOR")) {
         echo "";
     } else {
         $f = null;
         $f = $db->selectObject("formbuilder_form", "location_data='" . serialize($loc) . "'");
         if (!$f) {
             //Create a form if it's missing...
             $f->name = "New Form";
             $f->description = "";
             $f->location_data = serialize($loc);
             $f->table_name = "";
             $f->is_email = 0;
             $f->is_saved = 0;
             $f->submitbtn = "Submit";
             $f->resetbtn = "Reset";
             $f->response = "Your form has been submitted.";
             $f->subject = "Submitted form from site.";
             $frmid = $db->insertObject($f, "formbuilder_form");
             //Create Default Report;
             $rpt->name = "Default Report";
             $rpt->description = "";
             $rpt->location_data = $f->location_data;
             $rpt->text = "";
             $rpt->column_names = "";
             $rpt->form_id = $frmid;
             $db->insertObject($rpt, "formbuilder_report");
             $f->id = $frmid;
         }
         global $SYS_FLOW_REDIRECTIONPATH;
         pathos_flow_set(SYS_FLOW_PUBLIC, SYS_FLOW_ACTION);
         $SYS_FLOW_REDIRECTIONPATH = "editfallback";
         pathos_flow_set(SYS_FLOW_PUBLIC, SYS_FLOW_ACTION);
         $SYS_FLOW_REDIRECTIONPATH = "pathos_default";
         $floc = unserialize($f->location_data);
         $controls = $db->selectObjects("formbuilder_control", "form_id=" . $f->id);
         if (!defined("SYS_SORTING")) {
             require_once BASE . "subsystems/sorting.php";
         }
         usort($controls, "pathos_sorting_byRankAscending");
         $form = new form();
         foreach ($controls as $c) {
             $ctl = unserialize($c->data);
             $ctl->_id = $c->id;
             $ctl->_readonly = $c->is_readonly;
             $form->register($c->name, $c->caption, $ctl);
         }
         $form->register(uniqid(""), "", new htmlcontrol("<br><br>"));
         $form->register("submit", "", new buttongroupcontrol($f->submitbtn, $f->resetbtn, ""));
         $form->meta("action", "submit_form");
         $form->meta("m", $floc->mod);
         $form->meta("s", $floc->src);
         $form->meta("i", $floc->int);
         $form->meta("id", $f->id);
         $formmsg = '';
         $form->location(pathos_core_makeLocation("formbuilder", $floc->src, $floc->int));
         if (count($controls) == 0) {
             $form->controls['submit']->disabled = true;
             $formmsg .= 'This form is blank. Select "Edit Form" to add input fields.<br>';
         }
         if ($f->is_saved == 0 && $f->is_email == 0) {
             $form->controls['submit']->disabled = true;
             $formmsg .= 'There are no actions assigned to this form. Select "Edit Form Settings" then select "Email Form" and/or "Save to Database".';
         }
         $template = new template("formmodule", $view, $loc);
         $template->assign("formmsg", $formmsg);
         $template->assign("form_html", $form->toHTML($f->id));
         $template->assign("form", $f);
         $template->register_permissions(array("administrate", "editform", "editformsettings", "editreport", "viewdata", "editdata", "deletedata"), $loc);
         $template->output();
     }
 }