Exemplo n.º 1
0
 /**
  * @todo document this
  */
 function action_skinieexport()
 {
     global $member, $DIR_LIBS;
     $member->isAdmin() or $this->disallow();
     // load skinie class
     include_once $DIR_LIBS . 'skinie.php';
     $aSkins = requestIntArray('skin');
     $aTemplates = requestIntArray('template');
     if (!is_array($aTemplates)) {
         $aTemplates = array();
     }
     if (!is_array($aSkins)) {
         $aSkins = array();
     }
     $skinList = array_keys($aSkins);
     $templateList = array_keys($aTemplates);
     $info = postVar('info');
     $exporter =& new SKINEXPORT();
     foreach ($skinList as $skinId) {
         $exporter->addSkin($skinId);
     }
     foreach ($templateList as $templateId) {
         $exporter->addTemplate($templateId);
     }
     $exporter->setInfo($info);
     $exporter->export();
 }
Exemplo n.º 2
0
function sb_batch()
{
    global $oPluginAdmin;
    $logids = requestIntArray(batch);
    $action = requestVar('batchaction');
    debug:
    print_r($logids);
    if ($logids) {
        foreach ($logids as $id) {
            switch ($action) {
                case 'tspam':
                case 'tham':
                    $ar = $oPluginAdmin->plugin->spambayes->nbs->getLogevent($id);
                    $docid = $oPluginAdmin->plugin->spambayes->nbs->nextdocid();
                    $cat = substr($action, 1);
                    $oPluginAdmin->plugin->spambayes->train($docid, $cat, $ar['content']);
                    echo 'train ' . $cat . ': ' . $id . '<br />';
                    break;
                case 'delete':
                    echo 'delete: ' . $id . '<br />';
                    $oPluginAdmin->plugin->spambayes->nbs->removeLogevent($id);
            }
        }
    }
    echo '--end of batch--';
}