$go = "UPDATE"; require_once "../../config.inc.php"; $auth = new auth("PLUGIN_CONTROL"); $page = new page("Install Plugin"); $filter = new Filter("modules", "MODULE_ID"); $filter->addRule($lang->get("name"), "MODULE_NAME", "MODULE_NAME"); $filter->icon = "li_plugin.gif"; $filter->type_name = "Plugins"; $filter->newLabel = $lang->get('install_pgn', 'Install a plugin'); $filtermenu = new Filtermenu($lang->get("pg_title"), $filter); $filtermenu->tipp = $lang->get("help_pgn", "Plug-ins allow you to enhance N/X beyond its standard features. Typically, plug-ins are used to create new objects types in addition to the two standard object types text and image."); //$oid = value("oid", "NUMERIC", ''); if ($pagestate->insert) { $form = new EditForm($lang->get("pg_install"), "i_plugin.gif"); $form->addToTopText($lang->get("pg_installdesc") . "<br><br>"); $form->add(new Label("lbl", $lang->get("pg_choose"), "standard")); $form->add(new Dropdown("filenameselect", getPluginFileList(), "standard")); $form->add(new Hidden("go", "CREATE")); $form->add(new Hidden("action", "install")); } if (!$pagestate->insert || value("action") == "install" || value("action") == "uninstall") { $form = new StdEDForm($lang->get("pgn_info", "Plugin information")); if (value("action") == "install") { $oid = install(); $page_state = "start"; } includePGNSource($oid); $modRef = createPGNRef($oid, 0); if ($modRef->helpfile != "") { $form->buttonbar->add("help", $lang->get("disp_doc", "Display Documentation"), "button", "window.open('" . $c["docroot"] . "plugin/" . $modRef->helpfile . "', 'pgnhelp', '')"); }
$page->add($form); $handled = true; $forward = doc(); } else if ($action == $lang->get("edit_access") && $auth->checkAccessToFunction("ED_FOLDER_ACL")) { $go = "UPDATE"; $oid = $pnode; $page_action = "UPDATE"; $title = getDBCell("categories", "CATEGORY_NAME", "CATEGORY_ID = " . $pnode); // used by ACLPanel. // Build breadcrumb $aclPanel = new EditForm($lang->get("edit_access")); if ($pnode == "") $pnode = "0"; $str = pathToRootFolder($pnode); $aclPanel->add(new Label("lbl", $str, "informationheader", 2)); $aclPanel->add(new Hidden("action", $lang->get("edit_access"))); $aclid = $pnode; $aclType = "folder"; include $c["path"] . "api/userinterface/panels/acl_panel.inc.php"; $aclPanel->add(new Hidden("pnode", $pnode)); $page->add($aclPanel); $handled = true; } } // end isset($action) /** * internally used only for creating a array for deleting a folder tree.
<?php require_once "../../config.inc.php"; $auth = new auth("ANALYSE_RATINGS"); $page_action = "update"; $go = "update"; $page = new Page("Rating Results"); $form = new EditForm($lang->get("rateres", "Rate Results")); $interval = array(); $count = countRows("pgn_rating", "RATINGID", "COMMENT <>''"); $steps = $count / 50; for ($i = 0; $i < $steps; $i++) { $interval[$i][0] = $i * 50 . " - " . (($i + 1) * 50 - 1); $interval[$i][1] = $i; } $form->add(new Label("lbl", $lang->get("display", "Display"), "standard")); $form->add(new Select("display", $interval, "standardlight", value("display"), 1)); $grid = new NXGrid("grid", 3); $grid->setRatio(array(150, 350, 100)); $grid->addRow(array(new Label("lbl", "<b>" . $lang->get("page", "Page") . "</b>"), new Label("lbl", "<b>" . $lang->get("comment", "Comment") . "</b>"), new Label("lbl", "<b>" . $lang->get("date", "Date") . "</b>"))); $thisInterval = value("interval"); $sql = "SELECT SOURCEID, COMMENT, TIMESTAMP FROM pgn_rating WHERE COMMENT <> '' ORDER BY TIMESTAMP DESC"; $query = new query($db, $sql); while ($query->getrow()) { $grid->addRow(array(new Label("lbl", resolvePageToLink($query->field("SOURCEID"))), new Label("lbl", str_replace('\\\\', '\\', $query->field("COMMENT"))), new Label("lbl", formatDBTimestamp($query->field('TIMESTAMP'))))); } $query->free(); $form->add($grid); $page->add($form); $page->draw();
/** * Create a form for smart translation and return the form reference. * */ function createSmartTranslateForm() { global $c, $page_action, $specialID, $page_state; $page_action = 'UPDATE'; if (value('tsaving', '', '') != 'yes') $page_state = ''; $oldvalues = value('oldfields', '', '0'); if ($oldvalues != '0') { $commas2 = $oldvalues; $commas = "'" . str_replace(",", "','", $oldvalues) . "'"; } else { $commas = implode(',', $this->smarttranslator); $commas2 = str_replace("'", '', $commas); } $tform = new EditForm('N/X Smarttranslator', '', 'smarttranslator'); $oid = $c["smarttranslate"]; $items = createDBCArray('internal_resources', 'RESID', "LANGID='".$oid."' AND UPPER(RESID) IN (".$commas.")", 'ORDER BY RESID ASC'); for ($i = 0; $i < count($items); $i++) { $specialID = $items[$i]; $tform->add(new Label("lbl", "<b>Translate: </b>" . getDBCell("internal_resources", "VALUE", "RESID='" . $items[$i] . "' AND LANGID='EN'"), "standardlight", 2)); $tform->add(new TextInput($items[$i], "internal_resources", "VALUE", "RESID='" . $items[$i] . "' AND LANGID='$oid'", "type:textarea,size:2,width:400")); $tform->add(new TextInput("Tooltip".$items[$i], "internal_resources", "TOOLTIP", "RESID='" . $items[$i] . "' AND LANGID='$oid'", "type:textarea,size:2,width:400")); $tform->add(new Spacer(2)); } $tform->add(new Hidden('oldfields', $commas2)); $tform->add(new Hidden('tsaving', 'yes')); return $tform; }
<? /********************************************************************** * @module Application **********************************************************************/ require_once "../../config.inc.php"; $auth = new auth("ANY"); $page = new page("User Administration"); $page->setJS("md5"); // get user id from session id. $oid = getDBCell("user_session", "USER_ID", "SESSION_ID='$auth->session'"); // restrict operations to update, do not alow insert $page_action = "UPDATE"; $go = "UPDATE"; $form = new EditForm($lang->get("user_profile"), "i_myprofile.gif"); $form->submitButtonAction = "if (document.form1.users_PASSWORD_1.value != '') document.form1.users_PASSWORD_1.value = document.form1.users_PASSWORD_2.value = hex_md5(document.form1.users_PASSWORD_1.value);"; $cond = "USER_ID = $oid"; $form->add(new TextInput($lang->get("full_name"), "users", "FULL_NAME", $cond, "type:text,width:200,size:32", "MANDATORY")); $form->add(new PasswordInput($lang->get("password"), "users", "PASSWORD", $cond, "type:text,width:200,size:32", "MANDATORY")); $form->add(new TextInput($lang->get("user_email"), "users", "EMAIL", $cond, "type:text,width:200,size:64", "MANDATORY")); $form->add(new SelectOneInput($lang->get("user_bl"), "users", "LANGID", "internal_resources_languages", "NAME", "LANGID", "1", $cond, "type:dropdown", "MANDATORY", "TEXT")); $page->add($form); $page->draw(); $db->close(); ?>
$form->add(new Hidden("action", "newobject")); $form->add(new NonDisplayedValueOnInsert("cluster_templates", "CATEGORY_ID", $cond, $pnode, "NUMBER")); $form->add(new NonDisplayedValueOnInsert("cluster_templates", "DELETED", $cond, 0, "NUMBER")); $form->forbidDelete(true); $form->forbidUpdate(true); $page->add($form); // edit the properties of an object. } else if ($action == "objectprop" && $aclf->checkAccessToFunction("ED_CL_TEMP_PROPS")) { $form = new EditForm($lang->get("clt_properties"), "i_scheme.gif"); $cond = $form->setPK("cluster_templates", "CLT_ID"); $form->headerlink = crHeaderLink($lang->get('ed_clt'), "modules/clustertemplate/clustertemplates.php?sid=$sid&oid=".value("oid", "NUMERIC")."&action=editobject"); $oname = new TextInput($lang->get("clt_name"), "cluster_templates", "NAME", $cond, "type:text,width:300,size:32", "MANDATORY&UNIQUE"); $oname->setFilter("CATEGORY_ID = $pnode"); $form->add($oname); $form->add(new SelectOneInput($lang->get("metatemplate"), "cluster_templates", "MT_ID", "meta_templates", "NAME", "MT_ID", "INTERNAL=0 AND VERSION=0", $cond, "type:dropdown,width:300", "MANDATORY")); $form->add(new FolderDropdown($lang->get("r_parent"), "cluster_templates", "CATEGORY_ID", $cond)); $form->add(new TextInput($lang->get("description"), "cluster_templates", "DESCRIPTION", $cond, "type:textarea,width:300,size:3", "")); $tempbox = new CheckboxTxtInput($lang->get("is_compound","Compound Cluster with own Layout" ), "cluster_templates", "CLT_TYPE_ID", $cond, "1", "0"); $tempbox->setJSPayload("onClick='toggle(\"templ\");'"); $form->add($tempbox); $show = ' style="display:block;" '; if (getDBCell("cluster_templates", "CLT_TYPE_ID", $cond) == 0) { $show = ' style="display:none;" '; } $form->add(new IDWrapper("templ", new TextInput($lang->get("template", "Template"), "cluster_templates", "TEMPLATE", $cond, "type:textarea,width:400,size:20") ,"embedded", $show,2)); $form->add(new CheckboxTxtInput($lang->get('is_shop_cat_class','Enable for Use as Shop Category Template'), 'cluster_templates', 'IS_SHOP_CATEGORY', $cond)); $form->add(new CheckboxTxtInput($lang->get('is_shop_cat_product','Enable for Use as Shop Product Template'), 'cluster_templates', 'IS_SHOP_PRODUCT', $cond));
$form->add(new Hidden("oid", $oid)); $page->add($form); } } else if (value("pnode", "NUMERIC") == "0" && $oid ==0 && $auth->userName == "Administrator") { $go="UPDATE"; $form = new EditForm($lang->get("node_access", "Set access for site root"), ""); $aclPanel = new Container; $aclid = "1"; $aclType = "page"; $title = $name[0]; include $c["path"] . "api/userinterface/panels/acl_panel.inc.php"; $aclPanel->add(new Hidden("mid", $mid)); $aclPanel->add(new Hidden("oid", $spid)); $aclPanel->add(new Hidden("view", $view)); $aclPanel->add(new Hidden("processing", "yes")); $form->add($aclPanel); $page->add($form); } else if ($action != "0" || value("view") != "0") { if ($action =="") $action = value("acstate"); $page_action = "UPDATE"; // Fetch variables $view = initValue("view", doc()."view", 1); if ($view == "0") $view = 1; $oid = value("oid", "NUMERIC"); if ($action == "pproperties" || (value("acstate") == "pproperties")) {