Ejemplo n.º 1
0
 /**
  * Generates default data object required for displaying annotations on the page.
  * The is called before populating with specific data to send to get_annotation_feedback() as
  * an easy way to add variables to get passed to get_annotation_feedback.
  *
  * int $limit              The number of comments to display (set to
  *                         0 for disabling pagination and showing all comments)
  * int $offset             The offset of comments used for pagination
  * int|string $showcomment Optionally show page with particular comment
  *                         on it or the last page. $offset will be ignored.
  *                         Specify either comment_id or 'last' respectively.
  *                         Set to null to use $offset for pagination.
  * int $annotation         The artefactid of the annotation.
  * int $view               Optional The view id that the annotation is linked to.
  * int $artefact           Optional artefact id that the annotation is linked to.
  * bool   $export          Determines if comments are fetched for html export purposes
  * bool   $onview          Optional - is viewing artefact annotations on view page so don't show edit buttons
  * string $sort            Optional - the sort order of the comments. Valid options are 'earliest' and 'latest'.
  * @return object $options Default annotations data object
  */
 public static function get_annotation_feedback_options()
 {
     $options = new stdClass();
     $options->limit = 10;
     $options->offset = 0;
     $options->showcomment = null;
     $options->annotation = '';
     // artefactid for annotation.
     $options->artefact = '';
     // artefactid that the annotation is linked to.
     $options->view = '';
     // viewid that the annotation is linked to.
     $options->block = '';
     // blockid that the annotation lives in.
     $options->export = false;
     $sortorder = get_user_institution_comment_sort_order();
     $options->sort = !empty($sortorder) ? $sortorder : 'earliest';
     return $options;
 }
Ejemplo n.º 2
0
Archivo: lib.php Proyecto: kienv/mahara
 /**
  * Generates default data object required for displaying comments on the page.
  * The is called before populating with specific data to send to get_comments() as
  * an easy way to add variables to get passed to get_comments.
  *
  * int $limit              The number of comments to display (set to
  *                         0 for disabling pagination and showing all comments)
  * int $offset             The offset of comments used for pagination
  * int|string $showcomment Optionally show page with particular comment
  *                         on it or the last page. $offset will be ignored.
  *                         Specify either comment_id or 'last' respectively.
  *                         Set to null to use $offset for pagination.
  * object $view            The view object
  * object $artefact        Optional artefact object
  * bool   $export          Determines if comments are fetched for html export purposes
  * bool   $onview          Optional - is viewing artefact comments on view page so don't show edit buttons
  * string $sort            Optional - the sort order of the comments. Valid options are 'earliest' and 'latest'.
  * @return object $options Default comments data object
  */
 public static function get_comment_options()
 {
     $options = new stdClass();
     $options->limit = 10;
     $options->offset = 0;
     $options->showcomment = null;
     $options->view = null;
     $options->artefact = null;
     $options->export = false;
     $options->onview = false;
     $sortorder = get_user_institution_comment_sort_order();
     $options->sort = !empty($sortorder) ? $sortorder : 'earliest';
     $options->threaded = null;
     return $options;
 }