$filtermenu = new StdMenu('Synchronize Languages'); include "menu.php"; $auth = new auth("SYNC_CLUSTERS"); $page = new page("Synchronize Clusters"); $go = value("go"); if ($go == "0") $go = "start"; $form = new CommitForm($lang->get("sync_clusters")); $form->addToTopText($lang->get("sync_lang_desc", "Creates an instance of each content in all languages defined.")); $maintenanceHandler = new ActionHandler("sync"); $maintenanceHandler->addFncAction("syncLanguages"); $form->addCheck("sync", $lang->get("sync_lang", 'Synchronize Languages')." ", $maintenanceHandler); $page->add($form); $page->addMenu($filtermenu); $page->draw(); $db->close(); function syncLanguages() { global $db, $auth; $variations = createDBCArray('variations', 'VARIATION_ID'); // enable languages in all templates $spms = createDBCArray('sitepage_master', 'SPM_ID', 'VERSION=0'); for ($i=0; $i<count($spms); $i++) { for ($j=0; $j<count($variations); $j++) { $check = getDBCell("sitepage_variations", "VARIATION_ID", "SPM_ID=".$spms[$i]." AND VARIATION_ID=".$variations[$j]);
* 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 "../../config.inc.php"; $auth = new auth("MAINTENANCE"); $page = new page("Rebuild Cache"); $go = value("go"); if ($go == "0") $go = "start"; $form = new CommitForm($lang->get("rb_cache", "Rebuild Cache")); $form->addToTopText($lang->get("mt_rb_cache_mes", "Rebuild Cache of all live pages")); $maintenanceHandler = new ActionHandler("generate"); $maintenanceHandler->addFncAction("rebuildRecipeCache"); $form->addCheck("generate", $lang->get("rb_cache", "Rebuild Cache"), $maintenanceHandler); $page->add($form); $page->draw(); $db->close(); function rebuildRecipeCache() { global $db; $recipes = createNameValueArrayEx("pgn_recipes", "NAME", "ID", "1"); } ?>
if ($view == $pos_clusterPanel && count($variations) > 0 && ($aclf->checkAccessToFunction("EDIT_CL_CONTENT"))) { require_once $c["path"] . "modules/common/panel_cluster.inc.php"; } else if ($view == $pos_objectProp && $aclf->checkAccessToFunction("CL_PROPS")) { $mynode = getVar("cluster"); $cond = "CLNID = $clnid"; $oname = new TextInput($lang->get("cl_name"), "cluster_node", "NAME", $cond, "type:text,width:200,size:32", "MANDATORY&UNIQUE"); $oname->setFilter("CLT_ID = $mynode"); $propPanel->add(new Hidden("view", $view)); $propPanel->add(new Hidden("processing", "yes")); $propPanel->add($oname); $propPanel->add(new SelectMultiple2Input($lang->get("variations"), "cluster_variations", "VARIATION_ID", $cond . " AND DELETED=0", "variations", "NAME", "VARIATION_ID", "DELETED=0")); $propPanel->add(new Hidden("action", "objectprop")); $propPanel->add(new FormButtons(true, true)); $handler = new ActionHandler("UPDATE"); $handler->addFncAction("syncClusterVariations"); $propPanel->registerActionHandler($handler); } else if ($view == $pos_metaPanel && ($aclf->checkAccessToFunction("ED_CL_META_DATA"))) { require_once $c["path"] . "modules/common/panel_meta.inc.php"; } // Build form if ($aclf->checkAccessToFunction("EDIT_CL_CONTENT")) $form->addPanel($clusterPanel); if ($aclf->checkAccessToFunction("ED_CL_META_DATA")) $form->addPanel($metaPanel); if ($aclf->checkAccessToFunction("CL_PROPS")) $form->addPanel($propPanel);
$form->add(new SelectMultiple2Input($lang->get("variations"), "content_variations", "VARIATION_ID", "1", "variations", "NAME", "VARIATION_ID", "DELETED=0")); $form->add(new SelectOneInput($lang->get("metatemplate"), "content", "MT_ID", "meta_templates", "NAME", "MT_ID", "INTERNAL=0 AND VERSION=0", "1", "type:dropdown", "MANDATORY")); $form->add(new TextInput($lang->get("description"), "content", "DESCRIPTION", $cond, "type:textarea, width:300,size:3", "")); $form->add(new TextInput($lang->get("keywords"), "content", "KEYWORDS", $cond, "type:textarea, width:300,size:3", "")); $form->add(new Hidden("action", "newobject")); $form->add(new NonDisplayedValueOnInsert("content", "CATEGORY_ID", $cond, $pnode, "NUMBER")); $form->add(new NonDisplayedValueOnInsert("content", "CREATED", $cond, "", "TIMESTAMP")); $form->add(new NonDisplayedValue("content", "LAST_MODIFIER", $cond, $auth->user, "TEXT")); $form->add(new NonDisplayedValue("content", "LAST_MOD_DATE", $cond, "", "TIMESTAMP")); $form->add(new NonDisplayedValueOnInsert("content", "DELETED", $cond, 0, "NUMBER")); $form->add(new Hidden("action", $lang->get("new_content"))); $form->forbidDelete(true); $form->forbidUpdate(true); $handler = new ActionHandler("INSERT"); $handler->addFncAction("syncVariations"); $form->registerActionHandler($handler); $page->add($form); // delete an object } else if ($action == "delobject" && $aclf->checkAccessToFunction("DELETE_OBJECT")) { if (!isset($go)) $go = "start"; $delhandler = new ActionHandler("deleteobject"); if (value("decision") == $lang->get("yes")) { $delhandler->addDBAction("UPDATE content SET DELETED = 1 WHERE CID = $oid"); $delhandler->addDBAction("UPDATE cluster_template_items SET FKID=0 WHERE FKID=$oid"); $delhandler->process("deleteobject");
<?php require "../../config.inc.php"; $filtermenu = new StdMenu('Export Translation File'); include "menu.php"; $auth = new auth("SYNC_CLUSTERS"); $page = new page("Export Translation File"); $go = value("go"); $export = ""; if ($go == "0") { $go = "start"; } $form = new CommitForm('Export Translation'); $form->addToTopText('Export Translation File as CSV'); $maintenanceHandler = new ActionHandler("export"); $maintenanceHandler->addFncAction("exportLanguages"); $form->addCheck("export", "Export ", $maintenanceHandler); $page->add($form); $page->addMenu($filtermenu); $page->draw(); $db->close(); if ($export != "") { echo '<textarea style="width:600px;height:300px;font-size:9px;">' . $export . '</textarea>'; } function exportLanguages() { global $export, $recordsets; $variations = createDBCArray("variations", "VARIATION_ID", '1', 'ORDER BY VARIATION_ID ASC'); $variations2 = createDBCArray("variations", "SHORTTEXT", '1', 'ORDER BY VARIATION_ID ASC'); $export = 'TYPE|KEY1|KEY2'; for ($i = 0; $i < count($variations2); $i++) {
require "menudef.inc.php"; $menu->tipp= $lang->get("help_synccl", "A feature used for synchronizing clusters after having modified/changed a cluster template."); $auth = new auth("SYNC_CLUSTERS"); $page = new page("Synchronize Clusters"); $go = value("go"); if ($go == "0") $go = "start"; $form = new CommitForm($lang->get("sync_clusters")); $form->addToTopText($lang->get("sync_clusters_descr", "Whe you are changing a cluster template, the clusters are not automatically synched. They are synched when you are working with them the next time. You can sync all of them here.")); $maintenanceHandler = new ActionHandler("sync"); $maintenanceHandler->addFncAction("syncClids"); $form->addCheck("sync", $lang->get("sync_clusters")." ", $maintenanceHandler); $page->add($form); $page->addMenu($menu); $page->draw(); $db->close(); function syncClids() { global $db, $form; $counter = 0; $sql = "SELECT cv.CLID FROM cluster_variations cv, cluster_node cn WHERE cv.DELETED=0 AND cv.CLNID=cn.CLNID AND cn.VERSION=0"; $query = new query($db, $sql); while ($query->getrow()) { syncCluster($query->field("CLID")); $counter++;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **********************************************************************/ require "../../config.inc.php"; $auth = new auth("MAINTENANCE"); $page = new page("Clear TempCache"); $go = value("go"); if ($go == "0") $go = "start"; $form = new CommitForm($lang->get("clear_cache", "Clear Cache")); $form->addToTopText($lang->get("mt_clear_cache", "Clear the temporory cache files.")); $maintenanceHandler = new ActionHandler("generate"); $maintenanceHandler->addFncAction("emptyTMPCache"); $form->addCheck("generate", $lang->get("clear_cache", "Clear Cache"), $maintenanceHandler); $page->add($form); $page->draw(); $db->close(); function emptyTMPCache() { global $c; $dir = $c["dyncachepath"]; $files = opendir($dir); while ($file = readdir ($files)) { if($file != "." && $file != "..") { unlink($dir.$file);
if ($action == "createarticle") { $go = "CREATE"; $page_action = "INSERT"; $form = new stdEDForm($lang->get("create_article", "Create new Article in channel") . " " . getDBCell("channels", "NAME", "CHID = " . $chid), ""); $cond = $form->setPK("channel_articles", "ARTICLE_ID"); $oname = new TextInput($lang->get("name"), "channel_articles", "TITLE", $cond, "type:text,width:300,size:64", "MANDATORY"); $form->add($oname); $form->add(new SelectOneInput($lang->get("template"), "channel_articles", "CLT_ID", "cluster_templates, channel_cluster_templates", "NAME", "channel_cluster_templates.CLT_ID AS CLT", "cluster_templates.CLT_ID = channel_cluster_templates.CLT_ID AND channel_cluster_templates.CHID = {$chid} ORDER BY POSITION ASC", $cond, "TYPE:DROPDOWN", "MANDATORY")); $form->add(new SelectOneInput($lang->get("category"), "channel_articles", "CH_CAT_ID", "channel_categories", "NAME", "CH_CAT_ID", "CHID = {$chid}", $cond, "type:dropdown", "MANDATORY")); $form->add(new PositionInput($lang->get("position", "Position"), "channel_articles", "POSITION", $cond, "CHID={$chid} AND VERSION=0", "size:4,width:50")); $form->add(new Hidden("action", "createarticle")); $form->add(new NonDisplayedValueOnInsert("channel_articles", "CHID", $cond, $chid, "NUMBER")); $form->add(new NonDisplayedValueOnInsert("channel_articles", "ARTICLE_DATE", $cond, "NOW()", "NUMBER")); $form->forbidDelete(true); $handler = new ActionHandler("INSERT"); $handler->addFncAction("createClusterNodeForArticle"); $form->registerActionHandler($handler); $page->add($form); $page->drawAndForward("modules/channels/edit.php?sid={$sid}&oid=<oid>&go=update"); } else { // Flag for configuration of cluster-panel... $clt = getDBCell("channel_articles", "CLT_ID", "ARTICLE_ID = {$oid}"); $isArticle = true; $page_action = "UPDATE"; $clid = syncArticleVariation($oid, $variation); syncCluster($clid); $view = initValue("view", doc() . "view", 1); $title = getDBCell("channel_articles", "TITLE", "ARTICLE_ID = {$clnid}"); $form = new PanelForm($lang->get("edit_article", "Edit Article") . " " . $title, "", 'articlesform'); $form->quickpanel = true; $form->backto = $c["docroot"] . "modules/channels/overview.php?sid={$sid}";
* (at your option) any later version. * * N/X 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 N/X; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **********************************************************************/ require "../../config.inc.php"; $auth = new auth("MAINTENANCE"); $page = new page("Rebuild Cache"); $go = value("go"); if ($go == "0") $go = "start"; $form = new CommitForm($lang->get("rb_cache", "Rebuild Cache")); $form->addToTopText($lang->get("mt_rb_cache_mes", "Rebuild Cache of all live pages")); $maintenanceHandler = new ActionHandler("generate"); $maintenanceHandler->addFncAction("flushOnAccessCache"); $form->addCheck("generate", $lang->get("rb_cache", "Rebuild Cache"), $maintenanceHandler); $page->add($form); $page->draw(); $db->close(); ?>
* 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 N/X; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **********************************************************************/ require "../../config.inc.php"; require "menudef.inc.php"; $auth = new auth("MAINTENANCE"); $page = new page("Generate DataTypes-Array"); $go = value("go"); if ($go == "0") $go = "start"; $form = new CommitForm($lang->get("mt_generate_dta", "Generate DataTypes")); $form->addToTopText($lang->get("mt_generate_dta_mes", "generates DataTypes")); $maintenanceHandler = new ActionHandler("generate"); $maintenanceHandler->addFncAction("writeDataTypeArray"); $form->addCheck("generate", $lang->get("mt_generate_dta", "Generate DataTypes"), $maintenanceHandler); $page->add($form); $page->addMenu($menu); $page->draw(); $db->close(); ?>
$type = getDBCell("sitepage_master", "SPMTYPE_ID", "SPM_ID = $spm"); if ($type == 2) { $form = new stdEDForm($lang->get("sp_newinstance"), ""); $form->add(new MultipagePosition($lang->get("pos_in_menu"), "sitepage", "POSITION", "SPID=0", 0, $mid)); $form->add(new Label("lbl", $lang->get("cr_content", "Create Content for this page?"), "standard")); $form->add(new Checkbox("createpage", "1", "standard", true)); $form->add(new Label("lbl", $lang->get("cl_name", "Cluster Name"), "standard", 1)); $form->add(new Input("cluster_name", $lang->get("insname", "<Cluster Name>"), "standard", 32)); $form->add(new ActionField("newinstance")); $form->forbidDelete(true); $form->forbidUpdate(true); $handler = new ActionHandler("INSERT"); $handler->addFncAction("createPage"); $form->registerActionHandler($handler); $page->add($form); } // if type==2 } else if ($action == $lang->get("delete") && $aclf->checkAccessToFunction("DELETE_SITEPAGE")) { if (!isset($go)) $go = "start"; $delhandler = new ActionHandler("deleteobject"); if ($go != $lang->get("Cancel")) { if (value("deleteobject") != "0") { $mid = getVar("mid"); $posi = getDBCell("sitepage", "POSITION", "SPID = $oid"); $delhandler->addDBAction("UPDATE sitepage SET POSITION = (POSITION-1) WHERE POSITION > $posi AND MENU_ID = $mid"); $delhandler->addDBAction("DELETE FROM sitepage WHERE SPID = $oid");
* 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 "../../config.inc.php"; $auth = new auth("ADMINISTRATOR"); $page = new page("Rebuild Cache"); $go = value("go"); if ($go == "0") $go = "start"; $form = new CommitForm($lang->get("mt_lw_site")); $form->addToTopText($lang->get("mt_lws_messages", "Do you really want to launch the whole website?")); $maintenanceHandler = new ActionHandler("generate"); $maintenanceHandler->addFncAction("launchWholeSite"); $chllaunchHandler = new ActionHandler("launchchannels"); $chllaunchHandler->addFncAction("launchAllChannels"); $form->addCheck("generate", $lang->get("mt_lw_site"), $maintenanceHandler); $form->addCheck("launchchannels", $lang->get("mt_lwc", "Launch all articles"), $chllaunchHandler); $page->add($form); $page->draw(); $db->close(); ?>