本文整理汇总了PHP中start_tag函数的典型用法代码示例。如果您正苦于以下问题:PHP start_tag函数的具体用法?PHP start_tag怎么用?PHP start_tag使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了start_tag函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: liveclassroom_backup_one_mod
function liveclassroom_backup_one_mod($bf, $preferences, $liveclassroom)
{
global $CFG;
if (is_numeric($liveclassroom)) {
$liveclassroom = get_record('liveclassroom', 'id', $liveclassroom);
}
$status = true;
$lcAction = new LCAction(null, $CFG->liveclassroom_servername, $CFG->liveclassroom_adminusername, $CFG->liveclassroom_adminpassword, null, $liveclassroom->course);
$roomPreview = $lcAction->getRoomPreview($liveclassroom->type);
//Start mod
fwrite($bf, start_tag("MOD", 3, true));
//Print liveclassroom data
fwrite($bf, full_tag("ID", 4, false, $liveclassroom->id));
fwrite($bf, full_tag("MODTYPE", 4, false, "liveclassroom"));
fwrite($bf, full_tag("COURSE", 4, false, $liveclassroom->course));
fwrite($bf, full_tag("NAME", 4, false, $liveclassroom->name));
if ($lcAction->isStudentAdmin($liveclassroom->course, $liveclassroom->course . '_S') == "true") {
fwrite($bf, full_tag("ISSTUDENTADMIN", 4, false, "true"));
} else {
fwrite($bf, full_tag("ISSTUDENTADMIN", 4, false, "false"));
}
fwrite($bf, full_tag("PREVIEW", 4, false, $roomPreview));
fwrite($bf, full_tag("TYPE", 4, false, $liveclassroom->type));
fwrite($bf, full_tag("SECTION", 4, false, $liveclassroom->section));
fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $liveclassroom->timemodified));
$status = fwrite($bf, end_tag("MOD", 3, true));
return $status;
}
示例2: backup_journal_entries
function backup_journal_entries($bf, $preferences, $journal)
{
global $CFG;
$status = true;
$journal_entries = get_records("journal_entries", "journal", $journal, "id");
//If there is entries
if ($journal_entries) {
//Write start tag
$status = fwrite($bf, start_tag("ENTRIES", 4, true));
//Iterate over each entry
foreach ($journal_entries as $jou_ent) {
//Start entry
$status = fwrite($bf, start_tag("ENTRY", 5, true));
//Print journal_entries contents
fwrite($bf, full_tag("ID", 6, false, $jou_ent->id));
fwrite($bf, full_tag("USERID", 6, false, $jou_ent->userid));
fwrite($bf, full_tag("MODIFIED", 6, false, $jou_ent->modified));
fwrite($bf, full_tag("TEXT", 6, false, $jou_ent->text));
fwrite($bf, full_tag("FORMAT", 6, false, $jou_ent->format));
fwrite($bf, full_tag("RATING", 6, false, $jou_ent->rating));
fwrite($bf, full_tag("ENTRYCOMMENT", 6, false, $jou_ent->entrycomment));
fwrite($bf, full_tag("TEACHER", 6, false, $jou_ent->teacher));
fwrite($bf, full_tag("TIMEMARKED", 6, false, $jou_ent->timemarked));
fwrite($bf, full_tag("MAILED", 6, false, $jou_ent->mailed));
//End entry
$status = fwrite($bf, end_tag("ENTRY", 5, true));
}
//Write end tag
$status = fwrite($bf, end_tag("ENTRIES", 4, true));
}
return $status;
}
示例3: backup_slideshow_captions
function backup_slideshow_captions($bf, $preferences, $slideshow)
{
global $CFG;
$status = true;
$slideshow_captions = get_records("slideshow_captions", "slideshow", $slideshow->instance);
//If there is captions
if ($slideshow_captions) {
//Write start tag
$status = fwrite($bf, start_tag("CAPTIONS", 4, true));
//Iterate over each caption
foreach ($slideshow_captions as $sli_cap) {
//Start caption
$status = fwrite($bf, start_tag("CAPTION", 5, true));
//Print caption contents
fwrite($bf, full_tag("ID", 6, false, $sli_cap->id));
fwrite($bf, full_tag("SLIDESHOW", 6, false, $sli_cap->slideshow));
fwrite($bf, full_tag("IMAGE", 6, false, $sli_cap->image));
fwrite($bf, full_tag("TITLE", 6, false, $sli_cap->title));
fwrite($bf, full_tag("CAPTION", 6, false, $sli_cap->caption));
//End submission
$status = fwrite($bf, end_tag("CAPTION", 5, true));
}
//Write end tag
$status = fwrite($bf, end_tag("CAPTIONS", 4, true));
}
return $status;
}
示例4: backup_chat_messages
function backup_chat_messages($bf, $preferences, $chat)
{
global $CFG;
$status = true;
$chat_messages = get_records("chat_messages", "chatid", $chat, "id");
//If there is messages
if ($chat_messages) {
//Write start tag
$status = fwrite($bf, start_tag("MESSAGES", 4, true));
//Iterate over each message
foreach ($chat_messages as $cha_mes) {
//Start message
$status = fwrite($bf, start_tag("MESSAGE", 5, true));
//Print message contents
fwrite($bf, full_tag("ID", 6, false, $cha_mes->id));
fwrite($bf, full_tag("USERID", 6, false, $cha_mes->userid));
fwrite($bf, full_tag("GROUPID", 6, false, $cha_mes->groupid));
fwrite($bf, full_tag("SYSTEM", 6, false, $cha_mes->system));
fwrite($bf, full_tag("MESSAGE_TEXT", 6, false, $cha_mes->message));
fwrite($bf, full_tag("TIMESTAMP", 6, false, $cha_mes->timestamp));
//End submission
$status = fwrite($bf, end_tag("MESSAGE", 5, true));
}
//Write end tag
$status = fwrite($bf, end_tag("MESSAGES", 4, true));
}
return $status;
}
示例5: wwassignment_backup_one_mod
function wwassignment_backup_one_mod($bf, $preferences, $wwassignment)
{
//error_log("wwassignment_backup_one_mod");
////error_log("preferences ".print_r($preferences,true));
global $CFG;
if (is_numeric($wwassignment)) {
$wwassignment = get_record('wwassignment', 'id', $wwassignment);
}
$status = true;
// function full_tag($tag,$level=0,$endline=true,$content,$attributes=null) {
// //Start mod
fwrite($bf, start_tag("MOD", 3, true));
//Print wwassignment data
fwrite($bf, full_tag("ID", 4, false, $wwassignment->id));
fwrite($bf, full_tag("MODTYPE", 4, false, "wwassignment"));
fwrite($bf, full_tag("NAME", 4, false, $wwassignment->name));
fwrite($bf, full_tag("DESCRIPTION", 4, false, $wwassignment->description));
fwrite($bf, full_tag("WEBWORK_SET", 4, false, $wwassignment->webwork_set));
fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $wwassignment->timemodified));
//if we've selected to backup users info, then execute backup_assignment_submisions and
//backup_assignment_files_instance
//End mod
$status = fwrite($bf, end_tag("MOD", 3, true));
//error_log("end wwassignment_one_backup_mod");
//error_log("preferences ".print_r($preferences,true));
return $status;
}
示例6: kaltura_backup_one_mod
function kaltura_backup_one_mod($bf, $preferences, $resource)
{
global $CFG;
if (is_numeric($resource)) {
$kaltura_entry = get_record('kaltura_entries', 'id', $resource);
} else {
$kaltura_entry = get_record('kaltura_entries', 'id', $resource->id);
}
$status = true;
//Start mod
fwrite($bf, start_tag("MOD", 3, true));
//Print assignment data
fwrite($bf, full_tag("ID", 4, false, $kaltura_entry->id));
fwrite($bf, full_tag("MODTYPE", 4, false, "kaltura"));
fwrite($bf, full_tag("ENTRY_ID", 4, false, $kaltura_entry->entry_id));
fwrite($bf, full_tag("DIMENSIONS", 4, false, $kaltura_entry->dimensions));
fwrite($bf, full_tag("SIZE", 4, false, $kaltura_entry->size));
fwrite($bf, full_tag("CUSTOM_WIDTH", 4, false, $kaltura_entry->custom_width));
fwrite($bf, full_tag("DESIGN", 4, false, $kaltura_entry->design));
fwrite($bf, full_tag("TITLE", 4, false, $kaltura_entry->title));
fwrite($bf, full_tag("CONTEXT", 4, false, $kaltura_entry->context));
fwrite($bf, full_tag("ENTRY_TYPE", 4, false, $kaltura_entry->entry_type));
fwrite($bf, full_tag("MEDIA_TYPE", 4, false, $kaltura_entry->media_type));
//End mod
$status = fwrite($bf, end_tag("MOD", 3, true));
return $status;
}
示例7: webscheme_backup_one_mod
function webscheme_backup_one_mod($bf, $preferences, $ws)
{
global $CFG;
if (is_numeric($ws)) {
$ws = get_record('webscheme', 'id', $ws);
}
$status = true;
//Start mod
fwrite($bf, start_tag("MOD", 3, true));
//Print webscheme data
fwrite($bf, full_tag("ID", 4, false, $ws->id));
fwrite($bf, full_tag("MODTYPE", 4, false, "webscheme"));
fwrite($bf, full_tag("NAME", 4, false, $ws->name));
fwrite($bf, full_tag("INTRO", 4, false, $ws->intro));
fwrite($bf, full_tag("INTROFORMAT", 4, false, $ws->introformat));
fwrite($bf, full_tag("TIMECREATED", 4, false, $ws->timecreated));
fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $ws->timemodified));
fwrite($bf, full_tag("WS_SETTINGS", 4, false, htmlentities($ws->ws_settings)));
fwrite($bf, full_tag("WS_EVENTS", 4, false, htmlentities($ws->ws_events)));
fwrite($bf, full_tag("WS_INITEXPR", 4, false, htmlentities($ws->ws_initexpr)));
fwrite($bf, full_tag("WS_LOADURLS", 4, false, htmlentities($ws->ws_loadurls)));
fwrite($bf, full_tag("WS_HTML", 4, false, htmlentities($ws->ws_html)));
//End mod
$status = fwrite($bf, end_tag("MOD", 3, true));
return $status;
}
示例8: resource_backup_one_mod
function resource_backup_one_mod($bf, $preferences, $resource)
{
global $CFG;
if (is_numeric($resource)) {
$resource = get_record('resource', 'id', $resource);
}
$status = true;
//Start mod
fwrite($bf, start_tag("MOD", 3, true));
//Print assignment data
fwrite($bf, full_tag("ID", 4, false, $resource->id));
fwrite($bf, full_tag("MODTYPE", 4, false, "resource"));
fwrite($bf, full_tag("NAME", 4, false, $resource->name));
fwrite($bf, full_tag("TYPE", 4, false, $resource->type));
fwrite($bf, full_tag("REFERENCE", 4, false, $resource->reference));
fwrite($bf, full_tag("SUMMARY", 4, false, $resource->summary));
fwrite($bf, full_tag("ALLTEXT", 4, false, $resource->alltext));
fwrite($bf, full_tag("POPUP", 4, false, $resource->popup));
fwrite($bf, full_tag("OPTIONS", 4, false, $resource->options));
fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $resource->timemodified));
//End mod
$status = fwrite($bf, end_tag("MOD", 3, true));
if ($status && ($resource->type == 'file' || $resource->type == 'directory' || $resource->type == 'ims')) {
// more should go here later!
// backup files for this resource.
$status = resource_backup_files($bf, $preferences, $resource);
}
return $status;
}
示例9: backup_book_chapters
function backup_book_chapters($bf, $preferences, $book)
{
global $CFG;
$status = true;
//Print book's chapters
if ($chapters = get_records('book_chapters', 'bookid', $book->id, 'id')) {
//Write start tag
$status = fwrite($bf, start_tag('CHAPTERS', 4, true));
foreach ($chapters as $ch) {
//Start chapter
fwrite($bf, start_tag('CHAPTER', 5, true));
//Print chapter data
fwrite($bf, full_tag('ID', 6, false, $ch->id));
fwrite($bf, full_tag('PAGENUM', 6, false, $ch->pagenum));
fwrite($bf, full_tag('SUBCHAPTER', 6, false, $ch->subchapter));
fwrite($bf, full_tag('TITLE', 6, false, $ch->title));
fwrite($bf, full_tag('CONTENT', 6, false, $ch->content));
fwrite($bf, full_tag('HIDDEN', 6, false, $ch->hidden));
fwrite($bf, full_tag('TIMECREATED', 6, false, $ch->timecreated));
fwrite($bf, full_tag('TIMEMODIFIED', 6, false, $ch->timemodified));
fwrite($bf, full_tag('IMPORTSRC', 6, false, $ch->importsrc));
//End chapter
$status = fwrite($bf, end_tag('CHAPTER', 5, true));
}
//Write end tag
$status = fwrite($bf, end_tag('CHAPTERS', 4, true));
}
return $status;
}
示例10: backup_map_locations
function backup_map_locations($bf, $preferences, $map)
{
global $CFG;
$status = true;
$map_locations = get_records("map_locations", "mapid", $map, "id");
//If there is locations
if ($map_locations) {
//Write start tag
$status = fwrite($bf, start_tag("LOCATIONS", 4, true));
//Iterate over each answer
foreach ($map_locations as $map_location) {
//Start answer
$status = fwrite($bf, start_tag("LOCATION", 5, true));
//Print location contents
fwrite($bf, full_tag("ID", 6, false, $map_location->id));
fwrite($bf, full_tag("USERID", 6, false, $map_location->userid));
fwrite($bf, full_tag("TITLE", 6, false, $map_location->title));
fwrite($bf, full_tag("SHOWCODE", 6, false, $map_location->showcode));
fwrite($bf, full_tag("LATITUDE", 6, false, $map_location->latitude));
fwrite($bf, full_tag("LONGITUDE", 6, false, $map_location->longitude));
fwrite($bf, full_tag("ADDRESS", 6, false, $map_location->address));
fwrite($bf, full_tag("CITY", 6, false, $map_location->city));
fwrite($bf, full_tag("STATE", 6, false, $map_location->state));
fwrite($bf, full_tag("COUNTRY", 6, false, $map_location->country));
fwrite($bf, full_tag("TEXT", 6, false, $map_location->text));
fwrite($bf, full_tag("TIMEMODIFIED", 6, false, $map_location->timemodified));
//End answer
$status = fwrite($bf, end_tag("LOCATION", 5, true));
}
//Write end tag
$status = fwrite($bf, end_tag("LOCATIONS", 4, true));
}
return $status;
}
示例11: backup_adobeconnect_meeting_groups
function backup_adobeconnect_meeting_groups($bf, $preferences, $adobeconnectid)
{
global $CFG;
// Set status to false because there must be at least one meeting instance
$status = false;
// Go through all of the meeting instances and backup each group's meeting
if ($meetgroups = get_records("adobeconnect_meeting_groups", 'instanceid', $adobeconnectid)) {
if ($meetgroups) {
//Write start tag
$status = fwrite($bf, start_tag("MEETINGGROUPS", 4, true));
//Iterate over each meeting instance
foreach ($meetgroups as $meetgroup) {
//Start of meeting group instance
$status = fwrite($bf, start_tag("MEETINGGROUP", 5, true));
fwrite($bf, full_tag("ID", 6, false, $meetgroup->id));
fwrite($bf, full_tag("INSTANCEID", 6, false, $meetgroup->instanceid));
fwrite($bf, full_tag("MEETINGSCOID", 6, false, $meetgroup->meetingscoid));
fwrite($bf, full_tag("GROUPID", 6, false, $meetgroup->groupid));
//End of meeting group instance
$status = fwrite($bf, end_tag("MEETINGGROUP", 5, true));
}
//Write end tag
$status = fwrite($bf, end_tag("MEETINGGROUPS", 4, true));
}
}
return $status;
}
示例12: tag_start
/**
* Writes an XML start tag and indents.
* @param string $tag Name of tag (traditionally upper-case)
* @param bool $endline If true (default), adds newline after start tag
* @throws Exception if there's an error writing
*/
public function tag_start($tag, $endline = false)
{
if (!fwrite($this->bf, start_tag($tag, $this->nestlevel, $endline))) {
throw new Exception('Failed to write backup data', EXN_LOCAL_BACKUPWRITE);
}
$this->stack[$this->nestlevel] = $tag;
$this->nestlevel++;
}
示例13: topcoll_backup_format_data
/**
* Format's backup routine
*
* @param handler $bf Backup file handler
* @param object $preferences Backup preferences
* @return boolean Success
**/
function topcoll_backup_format_data($bf, $preferences)
{
$status = true;
if ($layout = get_record('format_topcoll_layout', 'courseid', $preferences->backup_course)) {
$status = $status and fwrite($bf, start_tag('LAYOUT', 3, true));
$status = $status and fwrite($bf, full_tag('LAYOUTELEMENT', 4, false, $layout->layoutelement));
$status = $status and fwrite($bf, full_tag('LAYOUTSTRUCTURE', 4, false, $layout->layoutstructure));
$status = $status and fwrite($bf, end_tag('LAYOUT', 3, true));
}
return $status;
}
示例14: econsole_backup_one_mod
function econsole_backup_one_mod($bf, $preferences, $econsole)
{
global $CFG;
if (is_numeric($econsole)) {
$econsole = get_record('econsole', 'id', $econsole);
}
$status = true;
//Start mod
fwrite($bf, start_tag("MOD", 3, true));
//Print econsole data
fwrite($bf, full_tag("ID", 4, false, $econsole->id));
fwrite($bf, full_tag("MODTYPE", 4, false, "econsole"));
fwrite($bf, full_tag("NAME", 4, false, $econsole->name));
fwrite($bf, full_tag("CONTENT", 4, false, $econsole->content));
fwrite($bf, full_tag("UNITSTRING", 4, false, $econsole->unitstring));
fwrite($bf, full_tag("SHOWUNIT", 4, false, $econsole->showunit));
fwrite($bf, full_tag("LESSONSTRING", 4, false, $econsole->lessonstring));
fwrite($bf, full_tag("SHOWLESSON", 4, false, $econsole->showlesson));
fwrite($bf, full_tag("URL1NAME", 4, false, $econsole->url1name));
fwrite($bf, full_tag("URL1", 4, false, $econsole->url1));
fwrite($bf, full_tag("URL2NAME", 4, false, $econsole->url2name));
fwrite($bf, full_tag("URL2", 4, false, $econsole->url2));
fwrite($bf, full_tag("URL3NAME", 4, false, $econsole->url3name));
fwrite($bf, full_tag("URL3", 4, false, $econsole->url3));
fwrite($bf, full_tag("URL4NAME", 4, false, $econsole->url4name));
fwrite($bf, full_tag("URL4", 4, false, $econsole->url4));
fwrite($bf, full_tag("URL5NAME", 4, false, $econsole->url5name));
fwrite($bf, full_tag("URL5", 4, false, $econsole->url5));
fwrite($bf, full_tag("URL6NAME", 4, false, $econsole->url6name));
fwrite($bf, full_tag("URL6", 4, false, $econsole->url6));
fwrite($bf, full_tag("GLOSSARY", 4, false, $econsole->glossary));
fwrite($bf, full_tag("JOURNAL", 4, false, $econsole->journal));
fwrite($bf, full_tag("FORUM", 4, false, $econsole->forum));
fwrite($bf, full_tag("CHAT", 4, false, $econsole->chat));
fwrite($bf, full_tag("CHOICE", 4, false, $econsole->choice));
fwrite($bf, full_tag("QUIZ", 4, false, $econsole->quiz));
fwrite($bf, full_tag("ASSIGNMENT", 4, false, $econsole->assignment));
fwrite($bf, full_tag("WIKI", 4, false, $econsole->wiki));
fwrite($bf, full_tag("THEME", 4, false, $econsole->theme));
fwrite($bf, full_tag("IMAGEBARTOP", 4, false, $econsole->imagebartop));
fwrite($bf, full_tag("IMAGEBARBOTTOM", 4, false, $econsole->imagebarbottom));
fwrite($bf, full_tag("TIMECREATED", 4, false, $econsole->timecreated));
fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $econsole->timemodified));
//if we've selected to backup users info, then execute backup_econsole_messages
/*
if (backup_userdata_selected($preferences,'econsole',$econsole->id)) {
$status = backup_econsole_messages($bf,$preferences,$econsole->id);
}
*/
//End mod
$status = fwrite($bf, end_tag("MOD", 3, true));
return $status;
}
示例15: swf_backup_one_mod
function swf_backup_one_mod($bf, $preferences, $swf)
{
global $CFG;
if (is_numeric($swf)) {
$swf = get_record('swf', 'id', $swf);
}
$status = true;
//Start mod
fwrite($bf, start_tag("MOD", 3, true));
//Print swf data
fwrite($bf, full_tag("ID", 4, false, $swf->id));
//tags will not be UTF encoded as they are already in UTF format
fwrite($bf, full_tag("MODTYPE", 4, false, "swf"));
fwrite($bf, full_tag("COURSE", 4, false, $swf->course));
fwrite($bf, full_tag("NAME", 4, false, $swf->name));
fwrite($bf, full_tag("INTRO", 4, false, $swf->intro));
fwrite($bf, full_tag("INTROFORMAT", 4, false, $swf->introformat));
fwrite($bf, full_tag("SWFURL", 4, false, $swf->swfurl));
fwrite($bf, full_tag("WIDTH", 4, false, $swf->width));
fwrite($bf, full_tag("HEIGHT", 4, false, $swf->height));
fwrite($bf, full_tag("VERSION", 4, false, $swf->version));
fwrite($bf, full_tag("INTERACTION", 4, false, $swf->interaction));
fwrite($bf, full_tag("XMLURL", 4, false, $swf->xmlurl));
fwrite($bf, full_tag("APIKEY", 4, false, $swf->apikey));
fwrite($bf, full_tag("PLAY", 4, false, $swf->play));
fwrite($bf, full_tag("LOOPSWF", 4, false, $swf->loopswf));
fwrite($bf, full_tag("MENU", 4, false, $swf->menu));
fwrite($bf, full_tag("QUALITY", 4, false, $swf->quality));
fwrite($bf, full_tag("SCALE", 4, false, $swf->scale));
fwrite($bf, full_tag("SALIGN", 4, false, $swf->salign));
fwrite($bf, full_tag("WMODE", 4, false, $swf->wmode));
fwrite($bf, full_tag("BGCOLOR", 4, false, $swf->bgcolor));
fwrite($bf, full_tag("DEVICEFONT", 4, false, $swf->devicefont));
fwrite($bf, full_tag("SEAMLESSTABBING", 4, false, $swf->seamlesstabbing));
fwrite($bf, full_tag("ALLOWFULLSCREEN", 4, false, $swf->allowfullscreen));
fwrite($bf, full_tag("ALLOWSCRIPTACCESS", 4, false, $swf->allowscriptaccess));
fwrite($bf, full_tag("ALLOWNETWORKING", 4, false, $swf->allownetworking));
fwrite($bf, full_tag("ALIGN", 4, false, $swf->align));
fwrite($bf, full_tag("FLASHVAR1", 4, false, $swf->flashvar1));
fwrite($bf, full_tag("FLASHVAR2", 4, false, $swf->flashvar2));
fwrite($bf, full_tag("FLASHVAR3", 4, false, $swf->flashvar3));
fwrite($bf, full_tag("GRADING", 4, false, $swf->grading));
//End mod
$status = fwrite($bf, end_tag("MOD", 3, true));
if ($status && ($swf->type == 'file' || $swf->type == 'directory' || $swf->type == 'ims')) {
// more should go here later!
// backup files for this swf.
$status = swf_backup_files($bf, $preferences, $swf);
}
return $status;
}