Minor - format code.

1.9.x
Julio Montoya 11 years ago
parent bda312566e
commit 47dde4f6b9
  1. 42
      main/gradebook/lib/be/linkfactory.class.php
  2. 2
      main/survey/create_new_survey.php

@ -30,7 +30,6 @@ require_once 'surveylink.class.php';
*/ */
class LinkFactory class LinkFactory
{ {
/** /**
* Retrieve links and return them as an array of extensions of AbstractLink. * Retrieve links and return them as an array of extensions of AbstractLink.
* @param $id link id * @param $id link id
@ -41,14 +40,16 @@ class LinkFactory
* @param $category_id parent category * @param $category_id parent category
* @param $visible visible * @param $visible visible
*/ */
public static function load ($id = null, $type = null, $ref_id = null, $user_id = null, $course_code = null, $category_id = null, $visible = null) { public static function load($id = null, $type = null, $ref_id = null, $user_id = null, $course_code = null, $category_id = null, $visible = null)
{
return AbstractLink::load($id, $type, $ref_id, $user_id, $course_code, $category_id, $visible); return AbstractLink::load($id, $type, $ref_id, $user_id, $course_code, $category_id, $visible);
} }
/** /**
* Get the link object referring to an evaluation * Get the link object referring to an evaluation
*/ */
public function get_evaluation_link ($eval_id) { public function get_evaluation_link ($eval_id)
{
$links = AbstractLink :: load(null, null, $eval_id); $links = AbstractLink :: load(null, null, $eval_id);
foreach ($links as $link) { foreach ($links as $link) {
if (is_a($link, 'EvalLink')) { if (is_a($link, 'EvalLink')) {
@ -63,15 +64,17 @@ class LinkFactory
* @param string $name_mask search string * @param string $name_mask search string
* @return array link objects matching the search criterium * @return array link objects matching the search criterium
*/ */
public function find_links ($name_mask,$selectcat) { public function find_links ($name_mask,$selectcat)
return AbstractLink::find_links($name_mask,$selectcat); {
return AbstractLink::find_links($name_mask, $selectcat);
} }
/** /**
* Static method to create specific link objects * Static method to create specific link objects
* @param $type link type * @param $type link type
*/ */
public static function create ($type) { public static function create ($type)
{
$type = intval($type); $type = intval($type);
switch ($type) { switch ($type) {
case LINK_EXERCISE: case LINK_EXERCISE:
@ -96,22 +99,25 @@ class LinkFactory
/** /**
* Return an array of all known link types * Return an array of all known link types
* @return array
*/ */
public static function get_all_types () { public static function get_all_types ()
{
//LINK_DROPBOX, //LINK_DROPBOX,
return array (LINK_EXERCISE, return array (
//LINK_DROPBOX, LINK_EXERCISE,
LINK_HOTPOTATOES, //LINK_DROPBOX,
LINK_STUDENTPUBLICATION, LINK_HOTPOTATOES,
LINK_LEARNPATH, LINK_STUDENTPUBLICATION,
LINK_FORUM_THREAD, LINK_LEARNPATH,
LINK_ATTENDANCE, LINK_FORUM_THREAD,
LINK_SURVEY LINK_ATTENDANCE,
); LINK_SURVEY
);
} }
public function delete() { public function delete()
{
} }
} }

@ -163,7 +163,7 @@ $form->addElement('checkbox', 'anonymous', null, get_lang('Anonymous'));
$form->addElement('html_editor', 'survey_introduction', get_lang('SurveyIntroduction'), null, array('ToolbarSet' => 'Survey', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false)); $form->addElement('html_editor', 'survey_introduction', get_lang('SurveyIntroduction'), null, array('ToolbarSet' => 'Survey', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false));
$form->addElement('html_editor', 'survey_thanks', get_lang('SurveyThanks'), null, array('ToolbarSet' => 'Survey', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false)); $form->addElement('html_editor', 'survey_thanks', get_lang('SurveyThanks'), null, array('ToolbarSet' => 'Survey', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false));
// Aditional Parameters // Additional Parameters
$form->addElement( $form->addElement(
'advanced_settings', 'advanced_settings',
'<a href="javascript: void(0);" onclick="javascript: advanced_parameters();"> '<a href="javascript: void(0);" onclick="javascript: advanced_parameters();">

Loading…
Cancel
Save