示例#1
0
}
if (isset($params['item_id'])) {
    if (substr($params['item_id'], 0, 4) == "http") {
        $params['item_id'] = pathinfo($params['item_id'], PATHINFO_FILENAME);
    }
}
if (isset($params['title_id'])) {
    if (substr($params['title_id'], 0, 4) == "http") {
        $params['title_id'] = pathinfo($params['title_id'], PATHINFO_FILENAME);
    }
}
// print_r($params);// exit;
require_once "../lib/Functions.php";
require_once "../controllers/projects.php";
require_once "../controllers/bhl.php";
$ctrler = new bhl_controller($params);
?>
<script type="text/javascript">
$(window).load(function () { $("#loadOverlay").css("display","none"); });
</script>
<?php 
if (!$ctrler->user_is_logged_in_wiki()) {
    return;
}
//start assignment ------------------------------------------
if (isset($params['assign'])) {
    $ctrler->make_working_proj($params['wiki_title']);
}
// http://editors.eol.localhost/LiteratureEditor/Custom/bhl_access/index.php?wiki_title=Completed_Projects:Planet_of_the_Apes&search_type=move24harvest&wiki_status={Completed}&articles=
if ($val = @$params['search_type']) {
    if ($val == "move24harvest") {
示例#2
0
 function update_articles_when_project_moves($params)
 {
     /*
     [project] => Active_Projects:Planet_of_the_Apes
     [wiki_status] => {Active}
     [articles] => ForHarvesting:16194361_dbd860482d762327211c39ba89f3e58a; other1; other2
     */
     $articles = explode(";", $params['articles']);
     $articles = array_map("trim", $articles);
     $articles = array_filter($articles);
     echo "<pre>";
     print_r($articles);
     echo "</pre>";
     foreach ($articles as $article) {
         $info = bhl_controller::get_wiki_text($article);
         if ($wiki_text = $info['content']) {
             if ($p = bhl_controller::get_void_part($wiki_text)) {
                 // echo "<pre>"; print_r($p); echo "</pre>";
                 if ($projects = $p['projects']) {
                     //start replacing the project's name saved in article with the new moved project name
                     if ($params['wiki_status'] == "{Active}") {
                         $replace = str_replace("Active_Projects:", "Completed_Projects:", $params['project']);
                     } elseif ($params['wiki_status'] == "{Completed}") {
                         $replace = str_replace("Completed_Projects:", "Active_Projects:", $params['project']);
                     }
                     $p['wiki_title'] = $article;
                     //kind a new, BUT needed since I was not concerned before its value that's saved in the wiki
                     $p['projects'] = $replace;
                     $p['new_project'] = "";
                     $p['remove_project'] = "";
                     // echo "<pre>"; print_r($p); echo "</pre>"; print("<br>ditox<br>");
                     bhl_controller::move2wiki($p, false);
                     //saving article
                     // exit("<br>-elix-");
                 }
             }
         } else {
             bhl_controller::display_message(array('type' => "error", 'msg' => "Article doesn't exist anymore."));
             exit("<br>-no wiki text 222 [{$article}]-");
             return false;
         }
     }
 }