Source for file linkform.class.php
Documentation is available at linkform.class.php
include_once (dirname(__FILE__ ). '/../../../inc/global.inc.php');
include_once (dirname(__FILE__ ). '/../be.inc.php');
include_once (dirname(__FILE__ ). '/../gradebook_functions.inc.php');
include_once (api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php');
require_once (api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.php');
* @author Bert Stepp� (made more generic)
* @package dokeos.gradebook
* Builds a form containing form items based on a given parameter
* @param int form_type 1=choose link
* @param obj cat_obj the category object
* @param string form name
function LinkForm($form_type, $category_object,$link_object, $form_name, $method = 'post', $action = null, $extra = null)
parent :: __construct($form_name, $method, $action);
if (isset ($category_object))
if (isset ($link_object))
if ($form_type == self :: TYPE_CREATE)
elseif ($form_type == self :: TYPE_MOVE)
$renderer->setElementTemplate('<span>{element}</span> ');
$select = $this->addElement('select','move_cat',null,null);
foreach ($this->link_object->get_target_categories() as $cat)
for ($i= 0;$i< $cat[2];$i++ )
$select->addoption($line. ' '. $cat[1],$cat[0]);
array('onchange' => 'document.create_link.submit()'));
$select->addoption('['. get_lang('ChooseLink'). ']', 0);
foreach ($linktypes as $linktype)
$link->set_course_code($cc);
elseif(!empty($_GET['course_code']))
// disable this element if the link works with a dropdownlist
// and if there are no links left
if (!$link->needs_name_and_description()
&& count($link->get_all_links()) == '0')
$select->addoption($link->get_type_name(), $linktype, 'disabled');
$select->addoption($link->get_type_name(), $linktype);
|