本文整理汇总了PHP中storage::set_info方法的典型用法代码示例。如果您正苦于以下问题:PHP storage::set_info方法的具体用法?PHP storage::set_info怎么用?PHP storage::set_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类storage
的用法示例。
在下文中一共展示了storage::set_info方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: storage
$pdf->WriteHTML($textos_wiki_html[$i]);
}
}
//name of the pdf file with the name of the first page
$pdf->Output($pagenamewiki[0] . '.pdf', 'D');
}
//----------- Here starts the execution------------------- //
$WS = new storage();
$id = optional_param('id', NULL, PARAM_INT);
$WS->gid = optional_param('gid', NULL, PARAM_INT);
$cid = optional_param('cid', NULL, PARAM_INT);
$WS->pagedata->version = optional_param('version', NULL, PARAM_INT);
$WS->page = optional_param('page', NULL, PARAM_CLEAN);
$WS->page = stripslashes($WS->page);
//WS class is initialized
$WS->set_info($id);
$WS->cm->id = $id;
require_login($cid);
global $COURSE;
//only for theachers and admins:
$context = get_context_instance(CONTEXT_MODULE, $WS->cm->id);
require_capability('mod/wiki:canexporttopdf', $context);
//check Moodle version(higher than 1.5)
if ($CFG->version < 2006050500) {
error("Error: Wiki to PDFs only for Moodle 1.6 version or higher.");
}
$fform = data_submitted();
$textwiki = get_record_sql('
SELECT wp.id, wp.content, wp.refs
FROM ' . $CFG->prefix . 'wiki_pages wp, ' . $CFG->prefix . 'course_modules cm, ' . $CFG->prefix . 'wiki w
WHERE cm.id = ' . $id . ' AND cm.course = w.course AND wp.dfwiki = ' . $WS->dfwiki->id . ' AND wp.dfwiki = w.id
示例2: wiki_param
/**
* gets/sets a wiki_param variable. Also can execute some special actions
* over a wiki_param (defined by $special param):
* 'unset' => unsets a wiki_param
* 'print' or 'print_object': do a print_object of a wiki_param
* 'isset' => will returns only true or false if a wiki_param is set
* 'set_info' => load main info into global structure
* 'all_ws' => (deprecated) returns all variables in a single object
*
* @param String $name: wiki_param name
* @param mixed $value=null: assign wiki_param value
* @param Stirng $special=false: some special actions
* @return mixed: wiki_param value or null if it's not set
*/
function wiki_param($name, $value = null, $special = false)
{
global $WS;
if (!isset($WS)) {
$WS = new storage();
$WS->recover_variables();
}
if ($special == 'set_info') {
$WS->set_info();
}
//this is a deprecated line and will be removed shortly
if ($special == 'all_ws') {
return $WS;
}
if (!$name) {
return null;
}
if ($value !== null) {
$WS->{$name} = $value;
}
//special actions
switch ($special) {
case 'isset':
return isset($WS->{$name});
break;
case 'unset':
if (isset($WS->{$name})) {
unset($WS->{$name});
}
break;
case 'print':
case 'print_object':
if (isset($WS->{$name})) {
print_object();
} else {
echo '$WS->' . $name . ' is not set!';
}
break;
}
if (!isset($WS->{$name})) {
return null;
}
return $WS->{$name};
}