function draw() { global $lang, $page_action; if ($this->value == "") $this->value = 999; $values = createNameValueArrayEx("sitemap", "NAME", "POSITION", "PARENT_ID = ".$this->parentId, " AND DELETED=0 ORDER BY POSITION"); for ($i=0; $i < count($values); $i++) { $values[$i][0] = $lang->get("after", "After:")." ".$values[$i][0]; if ($this->value > $values[$i][1] || $page_action == "INSERT") { $values[$i][1]++; } else if ($this->value == $values[$i][1] && $page_action != "INSERT") { $values[$i][0] = $lang->get("remain_pos", "Do not change position"); } } if (is_array($values)) { array_unshift($values, array($lang->get("begin", "At the beginnging"), "1")); } else { $values = array(array($lang->get("begin", "At the beginnging"), "1")); } if ($this->value == "999") { $this->v_wuiobject->selectedValue = $values[count($values)-1][1]; } $this->v_wuiobject->value = $values; return DBO::draw(); }
/** * Draw the Category Overview */ function draw() { $categories = createNameValueArrayEx("categories", "CATEGORY_NAME", "CATEGORY_ID", "PARENT_CATEGORY_ID=" . $this->parentCat, "order by CATEGORY_NAME"); if (count($categories) > 0) { Container::draw(); echo '<tr><td colspan="' . $this->columns . '">'; echo '<table width="100%" cellpadding="0" cellspacing="0" border="0">'; $style = ' style="border-bottom:1px solid #cccccc;cursor:pointer;padding-top:2px; padding-bottom:2px;" '; for ($i = 0; $i < count($categories); $i++) { echo "<tr class=\"grid\" onMouseOver='this.style.backgroundColor=\"#ffffcc\";' onMouseOut='this.style.backgroundColor=\"#e8eef7\";' onClick='document.location.href=\"" . $this->editAction . $categories[$i][1] . "\";'>"; echo "<td {$style}> " . $categories[$i][0] . '</td>'; echo "</tr>"; } echo '</table>'; echo '</td></tr>'; } return $this->columns; }
/** * Populate selectbox */ function populateSelectbox() { global $chcat, $lang; if (!isset($chcat)) { $chcat = array(); $channels = createNameValueArrayEx("channels", "NAME", "CHID", "1 ORDER BY NAME ASC"); if (!is_array($channels)) { $channels = array(); } $chcat[] = array($lang->get("all", "All"), '1'); foreach ($channels as $channel) { $chcat[] = $channel; $categories = createNameValueArrayEx("channel_categories", "NAME", "CH_CAT_ID", "CHID = " . $channel[1] . " ORDER BY NAME"); if (count($categories) > 0) { foreach ($categories as $category) { $chcat[] = array($channel[0] . " - " . $category[0], $category[1]); } } } } }
function TagEditor($title, $store_table, $pkKey, $pkValue, $fkKey, $values) { $this->title = $title; $this->store_table = $store_table; $this->pkKey = $pkKey; $this->pkValue = $pkValue; $this->fkKey = $fkKey; $this->values = $values; global $page_state, $page_action, $db; if ($page_state == "processing") { // Get Values form PoST $this->selectedValues = explode(",", value($this->store_table.$this->pkKey.'selection', "NOSPACES")); } else { if (($page_action == "UPDATE" || $page_action == "DELETE") && $this->cond != "1") { // Load Values from database $this->selectedValues = createDBCArray($this->store_table, $this->fkKey, $this->pkKey.'='.$this->pkValue); } } // selected values jetzt fett machen.... if (is_array($this->selectedValues)) { $this->selectedValues = createNameValueArrayEx("pgn_recipes_tags", "TAG", "TAG_ID", "TAG_ID IN (".implode(",", $this->selectedValues).")", "ORDER BY TAG ASC"); } else { $this->selectedValues = array(); } // extract selected Values from given values $newValues = array(); for ($i=0; $i<count($this->values); $i++) { $found = false; for ($j=0; $j<count($this->selectedValues); $j++) { if ($this->values[$i][1] == $this->selectedValues[$j][1]) $found = true; } if (!$found) $newValues[] = $this->values[$i]; } $this->values = $newValues; }
/** * Creates the input fields for editing text * @param integer &$form link to the form the input-fields are to be created in */ function edit(&$form) { global $lang, $sid, $c; // add button for external editor. $cond = "FKID = $this->fkid"; $form->add(new TextInput($lang->get("feed_url", "Feed URL"), "pgn_feeds", "FEEDURL", $cond, "type:text,width:350,size:255", "")); $form->add(new CheckboxTxtInput($lang->get("aggregate", "Aggregate news in channel"), "pgn_feeds", "SHOWLINKS", $cond)); $chcat = array(); $channels = createNameValueArrayEx("channels", "NAME", "CHID", "1 ORDER BY NAME ASC"); if (!is_array($channels)) $channels=array(); foreach ($channels as $channel){ $categories = createNameValueArrayEx("channel_categories", "NAME", "CH_CAT_ID", "CHID = ".$channel[1]." ORDER BY NAME"); if (count($categories)>0) { foreach ($categories as $category) { $chcat[] = array($channel[0]." - ".$category[0], $category[1]); } } } $form->add(new SelectOneInputFixed($lang->get("channel"), "pgn_feeds", "CHANNEL_CAT", $chcat, $cond)); $form->add(new SitepageSelector($lang->get("cop", "Channel Overview Page"), "pgn_feeds", 'CHANNEL_OVERVIEW_PAGE', $cond)); }
/** * standard constructor * @param string Text that is to be shown as description or label with your object. * @param string Table, you want to connect with the object. * @param string column, you want to connect with the object. * @param string name of the table, you want to join to the input-value. * @param string name of the column, you want to use as diplay in dropdown for value. * @param string name of the column, you want to retrieve the values from for the table and column. * foreign key to table->column. * @param string $foreign_data_identifier where-condition in SQL-Clause for selections of input-values. * @param string $row_identifier Usually to be generated with form->setPK. Identifies the * row in db, you want to affect with operation. Keep empty for insert. (Example: stdEDForm) * @param string allowed is type:DROPDOWN|SELECT as paramter for choosing a dropdown or selectbox. For select * you may also use size:XX for number of rows. * @param string $check Does checks on user input. Allowed are MANDATORY (=not null)|UNIQUE. Unique will not make sense in most cases! * @param string $datatype Datatype of the database, you want to use. Allowed are CHAR|NUMBER|DATE|DATETIME|TIMESTAMP|PASSWORD */ function SelectOneInput($label, $table, $column, $foreign_table, $foreign_name, $foreign_value, $foreign_data_identifier = "1", $row_identifier = "1", $param = "type:dropdown", $check = "MANDATORY", $datatype = "NUMBER") { $chktmp = $check; DBO::DBO($label, $table, $column, $row_identifier, $param, $datatype, $chktmp); if (!$this->mandatory) { $values = createNameValueArray($foreign_table, $foreign_name, $foreign_value, $foreign_data_identifier); } else { $values = createNameValueArrayEx($foreign_table, $foreign_name, $foreign_value, $foreign_data_identifier); } switch ($this->type): case "DROPDOWN": $this->v_wuiobject = new Dropdown($this->name, $values, $this->std_style, $this->value, $this->width); break; case "SELECT": $this->v_wuiobject = new Select($this->name, $values, "", $this->value, $this->size, $this->std_style, $this->width); break; endswitch; }
if ($auth->checkAccessToFunction("CHANNEL_LAUNCH")) { $form->buttonbar->add("action", $lang->get("launch")); $form->add(new Hidden("action", "")); if (value("action") == $lang->get("launch")) { launchChannel($oid); if ($errors == "") { $form->addToTopText($lang->get("chnlaunched", "The channel was launched successfully.")); $form->topicon = "ii_success.gif"; } else { $form->addToTopText($lang->get("chnlaunchederr", "An error occured while launching the channel.")); $form->topicon = "ii_error.gif"; } $page_action = "UPDATE"; $go = "update"; $processing = "no"; $page_state = "start"; } } $form->add(new TextInput($lang->get("name"), "channels", "NAME", $cond, "type:text,width:200,size:64", "MANDATORY&UNIQUE")); if ($page_action != "INSERT") { $updateHandler = new ActionHandler("UPDATE"); $updateHandler->addFNCAction("syncSPMVariations"); $form->registerActionHandler($updateHandler); $members = createNameValueArrayEx("cluster_templates", "NAME", "CLT_ID", "CLT_TYPE_ID=1 AND DELETED=0 AND VERSION=0"); $form->add(new SelectMultiple2Input($lang->get("spm_variations"), "sitepage_variations", "VARIATION_ID", "SPM_ID=" . $oid, "variations", "NAME", "VARIATION_ID", "DELETED=0")); $form->add(new SelectMultipleInputPos($lang->get("clt_select", "Select cluster templates"), $members, "channel_cluster_templates", "CLT_ID", "CHID", $cond, "cluster_templates", "CLT_ID", "NAME", "standardlight", 2)); } $page->addMenu($filtermenu); $page->add($form); $page->drawAndForward("modules/channels/channels.php?sid={$sid}&oid=<oid>&go=update"); echo $errors;
if ($type == 1) { $propPanel->add(new Cell("clc", "", 3, 600, 10)); $propPanel->add(new Label("lbl", "<b>" . $lang->get("sp_launchdates") . "</b>", "headbox", 3)); $propPanel->add(new Cell("clc", "", 3, 600, 10)); if ($auth->checkAccessToFunction("AUTO_EXP_LAUN")) { $propPanel->add(new DateTimeInput($lang->get("sp_launchdate"), "sitepage", "LAUNCH_DATE", "SPID = {$spid}")); } if ($auth->checkAccessToFunction("AUTO_EXP_LAUN")) { $propPanel->add(new DateTimeInput($lang->get("sp_expiredate"), "sitepage", "EXPIRE_DATE", "SPID = {$spid}")); } } $propPanel->add(new Cell("clc", "", 3, 600, 10)); $propPanel->add(new Label("lbl", "<b>" . $lang->get("sp_properties") . "</b>", "headbox", 3)); $propPanel->add(new Cell("clc", "", 3, 600, 10)); $cond = "MENU_ID = {$menuID}"; $alternativeTemplates = createNameValueArrayEx("sitepage_master", "NAME", "SPM_ID", "CLT_ID = {$clt} AND DELETED=0"); if (count($alternativeTemplates) > 1 && $aclf->checkAccessToFunction("CHANGE_TEMPLATE")) { $sel = new SelectOneInputFixed($lang->get("change_template", "Change Template"), "sitepage", "SPM_ID", $alternativeTemplates, $cond); $propPanel->add($sel); $propPanel->add(new NonDisplayedValue("sitemap", "SPM_ID", $cond, $sel->value, "NUMBER")); } else { $propPanel->add(new Label("lbl", $lang->get("ptempl", "Page Template"), "standard")); $propPanel->add(new Label("lbl", getSPMLink($spm), "standard")); } $propPanel->add(new Label("lbl", $lang->get("spm_cluster"), "standard")); $propPanel->add(new Label("lbl", $cltname, "standard")); $propPanel->add(new Label("lbl", $lang->get("cli"), "standard")); $propPanel->add(new Label("lbl", $clnname, "standard")); $parentMenuID = getDBCell("sitemap", "PARENT_ID", "MENU_ID = " . $menuID); if ($auth->checkAccessToFunction("SITEPAGE_PROPS")) { //$propPanel->add(new MenuDropdown($lang->get("sp_parmenu"), "sitemap", "PARENT_ID", $cond, "type:dropdown", "MANDATORY"));
$page = new page("Compound Groups"); $filter = new Filter("compound_groups", "CGID"); $filter->addRule($lang->get("name"), "NAME", "NAME"); $filter->setAdditionalCondition("VERSION = 0"); $filter->type_name = $lang->get("cp_group");; $filter->icon = "li_cggroup.gif"; $filtermenu = new Filtermenu($lang->get("cp_group"), $filter); $name = getDBCell("compound_groups", "NAME", "CGID = $oid"); $form = new stdEDForm($lang->get("ed_cpgroup", "Edit Compound Group").":".$name); $cond = $form->setPK("compound_groups", "CGID"); if ($oid != "") { $form->headerlink = crHeaderLink($lang->get("ed_cpgroupgeneral", "Edit Group General"), "modules/compoundgroup/compound_groups.php?sid=$sid&oid=$oid&go=update"); } $compoundClts = createDBCArray("cluster_templates", "CLT_ID", "CLT_TYPE_ID=1"); if (count($compoundClts) > 0 ) { $members = createNameValueArrayEx("cluster_node", "NAME", "CLNID", "VERSION=0 AND CLT_ID IN (".implode(", ", $compoundClts).")", "ORDER BY NAME ASC"); } else { $members = array(); } $form->add(new SelectMultipleInputPos($lang->get("cpg_members_select", "Select members of this compound group"), $members, "compound_group_members", "CGMID", "CGID", $cond, "cluster_node", "CLNID", "NAME", "standardlight", 2)); $form->forbidDelete(true); $page->addMenu($filtermenu); $page->add($form); $page->draw(); $db->close(); ?>
/** * Get the values for the dropdownbox */ function getNameValueArray() { return createNameValueArrayEx('cluster_templates', 'NAME', 'CLT_ID', $this->cltFilter . ' AND VERSION=0', 'ORDER BY NAME ASC'); }
function rebuildRecipeCache() { global $db; $recipes = createNameValueArrayEx("pgn_recipes", "NAME", "ID", "1"); }
/** * standard constructor */ function ACLEditor($acl, $title = "") { global $lang; Container::Container(3); $this->acl = $acl; $this->title = $title; $id = $acl->guid; // load the data of the field. global $page_state, $page_action; if ($page_state == "processing") { $acl->inherit = value("acl_inherit" . $id); // because the config is not displayed in inherit mode, this is necessarry to load the data! if ($acl->inherit != value("checkednow")) { $page_state = "start"; } else { $acl->owner = value("acl_owner" . $id); } } // prepare the form.... $clc = new Cell("clc", "embedded", 1, 195, 1); $this->add($clc); $this->add($clc); $this->add($clc); $this->add(new Subtitle("title", $lang->get("acl_title", "Setting permissions for "). "<b> $title</b>", 3)); $this->add(new CheckboxTxt("acl_inherit" . $id, 1, $lang->get("acl_inherit", "Inherit permissions from parent"), "standard", $acl->inherit, 3)); $this->add(new Hidden("checkednow", $acl->inherit)); if ($acl->inherit) { $this->add(new Label("lbl", $lang->get("acl_inherit_note", "Note: When the box is checked, there is no other configuration available!"), "standardlight", 3)); $this->add(new Subtitle("title", $lang->get("acl_info", "Inherited Access from parent"), 3)); $this->add(new ACLInfo($acl)); } else { $this->add(new Subtitle("title", $lang->get("alc_owner", "Set owner"), 3)); $groups = createNameValueArrayEx("groups", "GROUP_NAME", "GROUP_ID", "1"); $this->add(new Label("lbl", $lang->get("acl_owner", "Owner"), "standard", 1)); $this->add(new Select("acl_owner" . $id, $groups, "standard", $acl->owner, 1, "", 250, 2)); $this->add(new Subtitle("title", $lang->get("acl_access", "Edit permissions in groups on "). "<b> $title</b>", 3)); // Create Comboeditor. $groups = createNameValueArray("groups", "GROUP_NAME", "GROUP_ID", "1"); $roles = createNameValueArray("roles", "ROLE_NAME", "ROLE_ID", "1"); $headlines = array ( "head1" => $lang->get("acl_groups", "Select Group to add"), "head1_selected" => $lang->get("acl_groupedit", "Select group to edit roles"), "head2_selected" => $lang->get("acl_role", "Select roles for group") ); $pk = array ( array ( "GUID", $id, "NUMBER" ) ); $comboeditor = new CombinationEditor($groups, $roles, $headlines, "acl_relations", $pk, "ACCESSOR_GUID", "NUMBER", "ROLE_ID", "NUMBER"); $this->add($comboeditor); } $acl->syncEx(); }
/** * Returns a list with all the calendars in the system */ function getCalendars($orderBy="ORDER BY NAME DESC") { return createNameValueArrayEx("pgn_cal_calendars", "NAME", "CALID", "1", $orderBy); }
$form = new YesNoForm($lang->get("cr_vr", "Create variation"), $lang->get("crlib_mes", "The content element does not exists in the selected variation. Do you want to create it?")); $form->add(new Hidden("action", "cr_content")); $form->add(new Hidden("oid", $oid)); $form->add(new Hidden("crvar", $variation)); $handled = true; } } if (! $handled) { $form = new PanelForm($lang->get("edit_content", "Edit Content"). ": " . $name, '', 'con'); if ($aclf->checkAccessToFunction("EDIT_OBJECT")) { $editpanel = new Panel($lang->get("edit_content")); $buttonbar = new ButtonBar("variations"); $buttonbar->selectBoxDescr = true; $buttonbar->setVariationSelector(createNameValueArrayEx("variations", "NAME", "VARIATION_ID", "1"), $variation); $editpanel->add($buttonbar); $editpanel->add(new Subtitle("st", $lang->get("title"))); $oname = new TextInput($lang->get("o_name"), "content", "NAME", $cond, "type:text,width:200,size:32", "MANDATORY&UNIQUE"); $oname->setFilter("CATEGORY_ID = $category_id"); $editpanel->add($oname); $editpanel->add(new TextInput($lang->get('access_key', 'Access Key', 'Key-Value with which you can access this content from the editor by typing [key].'), 'content', 'ACCESSKEY', $cond, "type:text,width:100,size:16",'UNIQUE')); $editpanel->backto = $c["docroot"] . "modules/content/objectbrowser.php?sid=$sid&resetfilter=1&pnode=$category_id"; // Edit $editpanel->add(new Subtitle("st", $lang->get("edit_content"))); includePGNSource ($content_MODULE_ID); $ref = createPGNRef($content_MODULE_ID, $fkid); if ($ref != "") { $ref->edit($editpanel);
/** * Add the variation(language)-selector to the form */ function enableVariationSelector() { global $oid, $go, $page_action, $page_state; $this->buttonbar->setVariationSelector(createNameValueArrayEx("variations", "NAME", "VARIATION_ID", "DELETED=0", "ORDER BY NAME ASC"), variation()); $this->add(new Hidden("goon", $page_action)); if (isset($oid)) { $this->add(new Hidden("oid", $oid)); } if (value("changevariation") != "0") $page_state=""; }
} if ($aclf->checkAccessToFunction("B_RELAUNCH_TREE")) { $clustereditbar->addAction($lang->get("sp_rltree", "Refresh Tree")); } if ($aclf->checkAccessToFunction("B_EXPIRE_TREE")) { $clustereditbar->addAction($lang->get('exp_tree', 'Expire Tree')); } if ($aclf->checkAccessToFunction("B_DESTROY_TREE") && $isDeletable) { $clustereditbar->addAction('separator'); $clustereditbar->addAction($lang->get('del_tree', 'Delete Tree')); } } if (!$c["disableTranslationHelp"] && $editState && countRows("variations", "VARIATION_ID", "1") > 1) { $toolbar = new Buttonbar("Toolbar"); $toolbar->selectBoxDescr = true; $toolbar->setTranslationSelector(createNameValueArrayEx("variations", "NAME", "VARIATION_ID", "VARIATION_ID <>" . variation()), translation()); if (!$isArticle) { $toolbar->setVariationSelector(populateVariations($clnid, variation()), variation()); } $clusterPanel->add($toolbar); } // PANELS // Edit-Content Panel. // include needed sources includePGNISources(); //Plugin Sources. $clid = getClusterFromNode($clnid, $variation); if ($view == $pos_clusterPanel) { syncCluster($clid); } $clusterPanel->add(new Hidden("view", $view));
/** * Returns the values for a channel-category dropdown box. */ function getChannelDropDownValues() { global $db; $chcat = array(); $channels = createNameValueArrayEx("channels", "NAME", "CHID", "1 ORDER BY NAME ASC"); if (!is_array($channels)) { $channels = array(); } foreach ($channels as $channel) { $categories = createNameValueArrayEx("channel_categories", "NAME", "CH_CAT_ID", "CHID = " . $channel[1] . " ORDER BY NAME"); if (count($categories) > 0) { foreach ($categories as $category) { $chcat[] = array($channel[0] . " - " . $category[0], $category[1]); } } } return $chcat; }
* 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 N/X; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **********************************************************************/ require_once "../../config.inc.php"; require_once "ingredient_editor.php"; require_once "tag_selector.php"; $auth = new auth("ADMINISTRATOR"); $page = new Page("Edit Recipe"); $form = new stdEDForm($lang->get("edrecipe", "Edit Recipe")); $cond = $form->setPK("pgn_recipes", "ID"); $form->addHeaderLink(crHeaderLink($lang->get("back"), "plugin/recipe/overview.php?sid=" . $sid)); $form->add(new TextInput($lang->get("name", "NAME"), "pgn_recipes", "NAME", $cond, "type:text,size:64,width:200", "MANDATORY")); if ($page_action == "UPDATE") { $values = createNameValueArrayEx("pgn_recipes_tags", "TAG", "TAG_ID", "1", "ORDER BY TAG ASC"); $form->add(new TagEditor("Tags", "pgn_recipes_tag_relation", "REC_ID", $oid, "TAG_ID", $values)); } $form->add(new SubTitle("st", $lang->get("ingredients", "Ingredients"), 2)); $form->add(new IngredientEditor("pgn_recipes", $cond)); $form->add(new SubTitle("st", $lang->get("preparation", "Preparation"), 2)); $form->add(new TextInput($lang->get("preparation", "Preparation"), "pgn_recipes", "PREPARATION", $cond, "type:textarea,size:6,width:300", "")); $form->add(new TextInput($lang->get("description", "Description"), "pgn_recipes", "DESCRIPTION", $cond, "type:textarea,size:6,width:300", "")); $deleteHandler = new ActionHandler("DELETE"); $deleteHandler->addDbAction("DELETE FROM pgn_recipes WHERE ID={$oid} "); $deleteHandler->addDbAction("DELETE FROM pgn_recipes_tag_relation WHERE REC_ID={$oid} "); $form->registerActionHandler($deleteHandler); $page->add($form); $page->draw();
$pclusters = parentClusters($clusters, 0); $clusters = array_merge($pclusters, $clusters); $clusters = array_unique($clusters); for ($j = 0; $j < count($clusters); $j++) { $spids = createDBCArray("sitepage", "SPID", "CLNID = " . $clusters[$j]); for ($k = 0; $k < count($spids); $k++) { $iname = getDBCell("sitepage_names", "NAME", "VARIATION_ID=1 AND SPID = " . $spids[$k]); $menu = getDBCell("sitepage", "MENU_ID", "SPID = " . $spids[$k]); $linktext = backTrail($menu); $spm = getDBCell("sitepage", "SPM_ID", "SPID = " . $spids[$k]); $spmtype = getDBCell("sitepage_master", "SPMTYPE_ID", "SPM_ID = " . $spm); if ($iname != "" && $spmtype != 1) { $linktext = $linktext . " > " . $iname; } $linkhref = $c["docroot"] . "modules/sitepages/sitepagebrowser.php?sid={$sid}&jump=go&oid=" . $spids[$k]; $link = "<a href=\"#\" onClick=\"window.opener.document.location.href='" . $linkhref . "';return false;\">{$linktext}</a>"; $form->add(new Label("lbl", $link, "standardlight", 2)); } } // process channels $ids = createNameValueArrayEx("channel_articles", "TITLE", "CHID", "ARTICLE_ID={$oid}"); for ($i = 0; $i < count($ids); $i++) { $title = $lang->get("channel", "Channel") . " " . getDBCell("channels", "NAME", "CHID=" . $ids[$i][1]) . " > " . $ids[$i][0]; $link = '<a href="#" onClick="window.opener.document.location.href=\'' . $c["docroot"] . "modules/channels/edit.php?sid=" . $sid . '&go=update&oid=' . $oid . '&setch=' . $ids[$i][1] . '\';return false;">' . $title . '</a>'; $form->add(new Label("lbl", $link, "standardlight", 2)); } echo $errors; $go = "UPDATE"; $page->add($form); $page->draw(); $db->close();