GetGlobalContentOperations(); $validinfo = true; if ($htmlblob == ""){ $error .= "
  • ".lang('nofieldgiven', array(lang('name')))."
  • "; $validinfo = false; } else if ($gcbops->CheckExistingHtmlBlobName($htmlblob)){ $error .= "
  • ".lang('blobexists')."
  • "; $validinfo = false; } elseif(preg_match('<^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$>', $htmlblob) == 0) { $error .= "
  • ".lang('illegalcharacters',lang('name'))."
  • "; $validinfo = false; } else if($content == ""){ $error .= '
  • '.lang('nofieldgiven',array(lang('content'))).'
  • '; $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 .= "
  • ".lang('errorinsertingblob')."
  • "; } } } } include_once("header.php"); $gCms = cmsms(); $db = $gCms->GetDb(); // fill out additional users array $addt_users = ""; $groupops = $gCms->GetGroupOperations(); $groups = $groupops->LoadGroups(); foreach( $groups as $onegroup ) { if( $onegroup->id == 1 ) continue; $addt_users .= ""; } $query = "SELECT user_id, username FROM ".cms_db_prefix()."users WHERE user_id <> ? ORDER BY username"; $result = $db->Execute($query, array($userid)); if ($result && $result->RecordCount() > 0) { while($row = $result->FetchRow()) { if( $row['user_id'] == 1 ) continue; if( $row['user_id'] == $userid ) continue; $addt_users .= ""; } }else{ $addt_users .= ""; } if (!$access) { echo "

    ".lang('noaccessto', array(lang('addhtmlblob')))."

    "; } else { if ($error != "") { echo "
    "; } ?>
    ShowHeader('addhtmlblob'); ?>

    *:

    :

    />

    *:

    :

    :

     

    « '.lang('back').'

    '; include_once("footer.php"); # vim:ts=4 sw=4 noet ?>