Пример #1
0
 }
 if ($validinfo) {
     $the_blob->id = $htmlblob_id;
     $the_blob->use_wysiwyg = $use_wysiwyg;
     $the_blob->description = $description;
     $the_blob->name = $htmlblob;
     $the_blob->content = $content;
     $the_blob->owner = $owner_id;
     if (isset($_POST["additional_editors"])) {
         $the_blob->ClearAuthors();
         foreach ($_POST["additional_editors"] as $addt_user_id) {
             $the_blob->AddAuthor($addt_user_id);
         }
     }
     Events::SendEvent('Core', 'EditGlobalContentPre', array('global_content' => &$the_blob));
     $result = $the_blob->save();
     if ($result) {
         // put mention into the admin log
         audit($the_blob->id, 'Global Content Block: ' . $the_blob->name, 'Edited');
         #Clear cache
         $smarty = cmsms()->GetSmarty();
         $smarty->clear_all_cache();
         $smarty->clear_compiled_tpl();
         Events::SendEvent('Core', 'EditGlobalContentPost', array('global_content' => &$the_blob));
         if (!isset($_POST['apply'])) {
             redirect('listhtmlblobs.php' . $urlext);
             return;
         }
     } else {
         $error .= "<li>" . lang('errorinsertingblob') . "</li>";
     }
Пример #2
0
             $error .= '<li>' . lang('nofieldgiven', array(lang('content'))) . '</li>';
             $validinfo = false;
         }
     }
 }
 if ($validinfo) {
     $gCms = cmsms();
     $gcbops = $gCms->GetGlobalContentOperations();
     $blobobj = new GlobalContent();
     $blobobj->name = $htmlblob;
     $blobobj->content = $content;
     $blobobj->owner = $userid;
     $blobobj->use_wysiwyg = $use_wysiwyg;
     $blobobj->description = $description;
     Events::SendEvent('Core', 'AddGlobalContentPre', array('global_content' => &$blobobj));
     $result = $blobobj->save();
     if ($result) {
         if (isset($_POST["additional_editors"])) {
             foreach ($_POST["additional_editors"] as $addt_user_id) {
                 $blobobj->AddAuthor($addt_user_id);
             }
         }
         // put mention into the admin log
         audit($blobobj->id, 'Global Content Block: ' . $blobobj->name, 'Added');
         Events::SendEvent('Core', 'AddGlobalContentPost', array('global_content' => &$blobobj));
         redirect("listhtmlblobs.php" . $urlext);
         return;
     } else {
         $error .= "<li>" . lang('errorinsertingblob') . "</li>";
     }
 }