Skip to content

Commit

Permalink
portfolio/glossary NOBUG added some phpdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
Penny Leach committed Dec 14, 2009
1 parent b9be87b commit 56e20c3
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions mod/glossary/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,11 @@ public static function expected_callbackargs() {
'id' => true,
);
}

/**
* @global object
* load up all data required for this export.
*
* @return void
*/
public function load_data() {
global $DB;
Expand All @@ -190,28 +193,40 @@ public function load_data() {
$fs = get_file_storage();
$this->multifiles = $fs->get_area_files($context->id, 'glossary_attachment', $this->entry->id, "timemodified", false);
}

/**
* @return string
* how long might we expect this export to take
*
* @return constant one of PORTFOLIO_TIME_XX
*/
public function expected_time() {
return PORTFOLIO_TIME_LOW;
}

/**
* @return bool
* make sure that the current user is allowed to do this
*
* @return boolean
*/
public function check_permissions() {
$context = get_context_instance(CONTEXT_MODULE, $this->cm->id);
return has_capability('mod/glossary:exportentry', $context)
|| ($this->entry->userid == $this->user->id && has_capability('mod/glossary:exportownentry', $context));
}

/**
* return a nice name to be displayed about this export location
*
* @return string
*/
public static function display_name() {
return get_string('modulename', 'glossary');
}

/**
* @return object
* prepare the package ready to be passed off to the portfolio plugin
*
* @return void
*/
public function prepare_package() {
define('PORTFOLIO_INTERNAL', true);
Expand All @@ -226,7 +241,10 @@ public function prepare_package() {
}
return $this->exporter->write_new_file($content, clean_filename($this->entry->concept) . '.html', !empty($files));
}

/**
* return the sha1 of this content
*
* @return string
*/
public function get_sha1() {
Expand All @@ -236,6 +254,11 @@ public function get_sha1() {
return sha1(serialize($this->entry));
}

/**
* what formats this function *generally* supports
*
* @return array
*/
public static function base_supported_formats() {
return array(PORTFOLIO_FORMAT_RICHHTML);
}
Expand Down

0 comments on commit 56e20c3

Please sign in to comment.