Example #1
0
switch ($task) {
    case "edit":
        editCategory($option, $cid[0]);
        break;
    case "new":
        editCategory($option, 0);
        break;
    case "cancel":
        cancelCategory();
        break;
    case "save":
    case "apply":
        saveCategory();
        break;
    case "remove":
        removeCategories($option, $cid);
        break;
    case "publish":
        publishCategories("com_docman", $id, $cid, 1);
        break;
    case "unpublish":
        publishCategories("com_docman", $id, $cid, 0);
        break;
    case "orderup":
        orderCategory($cid[0], -1);
        break;
    case "orderdown":
        orderCategory($cid[0], 1);
        break;
    case "accesspublic":
        accessCategory($cid[0], 0);
Example #2
0
     moveCategorySave($cid, $section);
     break;
 case 'copyselect':
     copyCategorySelect($option, $cid, $section);
     break;
 case 'copysave':
     copyCategorySave($cid, $section);
     break;
 case 'go2menu':
 case 'go2menuitem':
 case 'save':
 case 'apply':
     saveCategory();
     break;
 case 'remove':
     removeCategories($section, $cid);
     break;
 case 'publish':
     publishCategories($section, $cid, 1);
     break;
 case 'unpublish':
     publishCategories($section, $cid, 0);
     break;
 case 'cancel':
     cancelCategory();
     break;
 case 'orderup':
     orderCategory($cid[0], -1);
     break;
 case 'orderdown':
     orderCategory($cid[0], 1);
Example #3
0
 if ($replace) {
     $addCategories = array($new);
     $removeCategories = array($old);
 }
 echo "\t[{$counter} of {$total}] Title:" . $name;
 $title = Title::newFromText($name, NS_FILE);
 if ($title instanceof Title && $title->exists()) {
     $article = Article::newFromID($title->getArticleID());
     $oldContent = $article->getContent();
     // set default value
     $msg = array();
     $content = $oldContent;
     $status = Status::newGood();
     //remove category
     if (!empty($removeCategories)) {
         $content = removeCategories($content, $removeCategories);
         $msg[] = 'Removed: ' . implode(', ', $removeCategories);
     }
     // add category
     if (!empty($addCategories)) {
         $content = addCategories($content, $addCategories);
         $msg[] = 'Added: ' . implode(', ', $addCategories);
     }
     // edit page
     if (strcmp($oldContent, $content) !== 0) {
         if (!$dryRun) {
             $status = $article->doEdit($content, 'Changing categories', EDIT_UPDATE | EDIT_SUPPRESS_RC | EDIT_FORCE_BOT, false, $botUser);
         }
     } else {
         $noChanges++;
         $status = null;