Esempio n. 1
0
 $item_status = $Blog->get_allowed_item_status();
 if (empty($item_status)) {
     $Messages->add(T_('Sorry, you have no permission to post into this blog.'), 'error');
     break;
 }
 //print_r($_POST);die();
 load_class('files/model/_filelist.class.php', 'FileList');
 $selected_Filelist = new Filelist($fm_FileRoot, false);
 $fm_selected = param("fm_selected", "array");
 //		print_r($fm_selected);
 foreach ($fm_selected as $l_source_path) {
     // echo '<br>'.$l_source_path;
     $selected_Filelist->add_by_subpath(urldecode($l_source_path), true);
 }
 // make sure we have loaded metas for all files in selection!
 $selected_Filelist->load_meta();
 // Ready to create post(s):
 load_class('items/model/_item.class.php', 'Item');
 $fileNum = 0;
 $cat_Array = param("category", "array");
 $title_Array = param("post_title", "array");
 while ($l_File =& $selected_Filelist->get_next()) {
     // Create a post:
     $edited_Item = new Item();
     $edited_Item->set('status', $item_status);
     // replacing category if selected at preview screen
     if (isset($cat_Array[$fileNum])) {
         // checking if selected "same as above" category option
         if ($cat_Array[$fileNum] != 'same') {
             // Use a selected category ID
             $edited_Item->set('main_cat_ID', $cat_Array[$fileNum]);