GetGlobalContentOperations(); $userid = get_userid(); $adminaccess = check_permission($userid, 'Modify Global Content Blocks'); $isowner = $gcbops->CheckOwnership($htmlblob_id,$userid); $access = $adminaccess || $isowner || $gcbops->CheckAuthorship($htmlblob_id, $userid); if (isset($_POST["cancel"])) { redirect("listhtmlblobs.php".$urlext); return; } $the_blob = ''; if( $htmlblob_id > 0 ) { $the_blob = $gcbops->LoadHtmlBlobById($htmlblob_id); } else { $the_blob = new GlobalContent(); } $htmlblob = $the_blob->name; $oldhtmlblob = $the_blob->name; $owner_id = $the_blob->owner; $content = $the_blob->content; $use_wysiwyg = $the_blob->use_wysiwyg; $description = $the_blob->description; $ajax = false; $error = ""; if (isset($_POST['htmlblob'])) $htmlblob = trim($_POST['htmlblob']); if (isset($_POST['oldhtmlblob'])) $oldhtmlblob = trim($_POST['oldhtmlblob']); if (isset($_POST['content'])) $content = $_POST['content']; if (isset($_POST['use_wysiwyg']) ) $use_wysiwyg = (int)$_POST['use_wysiwyg']; if (isset($_POST['description']) ) $description = trim($_POST['description']); if (isset($_POST['owner_id'])) $owner_id = $_POST['owner_id']; if (isset($_POST['ajax']) && $_POST['ajax']) $ajax = true; $gcb_wysiwyg = (get_site_preference('nogcbwysiwyg','0') == '0') ? 1 : 0; if( $gcb_wysiwyg ) { $gcb_wysiwyg = get_preference($userid, 'gcb_wysiwyg', 1); } if ($access) { if (isset($_POST["submit2"]) || isset($_POST['apply']) || $ajax) { $validinfo = true; if ($htmlblob == "") { $error .= "