public static function yesnoRadioList($tag_name, $tag_attribs, $selected, $yes = 'yes', $no = 'no', $id = false) { if (JCOMMENTS_JVERSION == '1.0') { return mosHTML::yesnoRadioList($tag_name, $tag_attribs, $selected, $yes, $no); } return JHTML::_('select.booleanlist', $tag_name, $tag_attribs, $selected, $yes, $no, $id); }
function ALF_editItem($id, $option) { global $JLMS_CONFIG; $db =& JFactory::getDbo(); $row = new JLMS_forum_item($db); $row->load($id); if (isset($row->id) && $row->id || !$id) { if (!$row->parent_forum) { $row->parent_forum = 0; } if (!$row->forum_access) { $row->forum_access = 0; } if (!$row->published) { $row->published = 0; } if (!$row->forum_level) { $row->forum_level = 0; } if (!$row->user_level) { $row->user_level = 0; } if (!$row->moderated) { $row->moderated = 0; } $parent_forums =& ALF_get_forums_list('id as value, forum_name as text, parent_forum'); for ($j = 1, $n = count($parent_forums); $j < $n; $j++) { if ($parent_forums[$j]->parent_forum) { $parent_forums[$j]->text = ' - ' . $parent_forums[$j]->text; } } array_unshift($parent_forums, mosHTML::makeOption('0', ' ')); $lists['parent_forums'] = mosHTML::selectList($parent_forums, 'parent_forum', 'class="text_area" style="width:266px" ', 'value', 'text', $row->parent_forum); $lists['custom_access'] = mosHTML::yesnoRadioList('forum_access', 'class="text_area" ', $row->forum_access); $lists['published'] = mosHTML::yesnoRadioList('published', 'class="text_area" ', $row->published); $lists['moderated'] = mosHTML::yesnoRadioList('moderated', 'class="text_area" ', $row->moderated); $query = "SELECT id as value, lms_usertype as text, roletype_id, IF(roletype_id = 4, 1, IF(roletype_id = 2, 2, 3)) as ordering FROM #__lms_usertypes WHERE roletype_id IN (2,4,5) ORDER BY ordering, lms_usertype"; $db->SetQuery($query); $roles = $db->LoadObjectList('value'); //TODO: check if this loadobjectlist('value') work in Joomla15 and Joomla16 $forum_types = array(); $forum_types[] = mosHTML::makeOption('0', 'Regular board'); $forum_types[] = mosHTML::makeOption('1', 'LearningPath specific board '); $forum_types[] = mosHTML::makeOption('2', 'Usergroup (course) specific board'); $forum_types[] = mosHTML::makeOption('3', 'Usergroup (system) specific board'); $forum_type = 0; if ($row->forum_level == 1) { $forum_type = 1; } elseif ($row->user_level == 1) { $forum_type = 2; } elseif ($row->user_level == 2) { $forum_type = 3; } $lists['forum_type'] = mosHTML::selectList($forum_types, 'forum_type', 'class="text_area" style="width:266px" ', 'value', 'text', $forum_type); ALF_html::editItem($row, $lists, $roles, $option); } else { mosRedirect("index.php?option={$option}&task=lms_forums"); } }
function editSubscriber($subscriber, $listings, $queues, $forms, $access = false, $frontEnd = false, $cb = false) { global $my, $mainframe; mosCommonHTML::loadOverlib(); $lists['receive_html'] = mosHTML::yesnoRadioList('receive_html', 'class="inputbox"', $subscriber->receive_html); $lists['confirmed'] = mosHTML::yesnoRadioList('confirmed', 'class="inputbox"', $subscriber->confirmed); $lists['blacklist'] = mosHTML::yesnoRadioList('blacklist', 'class="inputbox"', $subscriber->blacklist); $br = "\n\r"; $html = $forms['main']; $html .= '<div style="width:100%; align:left;">' . $br; $html .= '<fieldset class="acajoomcss" style="padding: 10px; text-align: left">' . $br; $html .= '<legend><strong>' . _ACA_SUB_INFO . '</strong></legend>' . $br; $html .= '<table cellpadding="0" cellspacing="0" align="center">' . $br; $text = str_replace('"', '"', $subscriber->name); if (function_exists('htmlspecialchars_decode')) { $text = htmlspecialchars_decode($text, ENT_NOQUOTES); } elseif (function_exists('html_entity_decode')) { $text = html_entity_decode($text, ENT_NOQUOTES); } if (!$cb) { $html .= acajoom::miseEnHTML(_ACA_INPUT_NAME, _ACA_INPUT_NAME_TIPS, '<input type="text" name="name" size="30" value="' . $text . '" class="inputbox" />'); $html .= acajoom::miseEnHTML(_ACA_INPUT_EMAIL, _ACA_INPUT_EMAIL_TIPS, '<input type="text" name="email" size="30" class="inputbox" value="' . $subscriber->email . ' " />'); } else { $html .= '<input type="hidden" name="cb_integration" value="1" />'; } $html .= acajoom::miseEnHTML(_ACA_RECEIVE_HTML, _ACA_RECEIVE_HTML_TIPS, $lists['receive_html']); if ($GLOBALS[ACA . 'time_zone'] == 1) { $html .= acajoom::miseEnHTML(_ACA_TIME_ZONE_ASK, _ACA_TIME_ZONE_ASK_TIPS, ' <input type="text" name="timezone" size="30" class="inputbox" value="' . $subscriber->timezone . '" />'); } else { $html .= '<input type="hidden" name="timezone" value="' . $subscriber->timezone . '" />'; } if ($access) { if ($subscriber->user_id == 0) { $html .= acajoom::miseEnHTML(_ACA_CONFIRMED, '', $lists['confirmed']); } else { if (!$cb or !$mainframe->isAdmin()) { $html .= '<input type="hidden" name="confirmed" value="' . $subscriber->confirmed . '" />'; } } $html .= acajoom::miseEnHTML(_ACA_BLACK_LIST, '', $lists['blacklist']); $html .= acajoom::miseEnHTML(_ACA_REGISTRATION_DATE, '', $subscriber->subscribe_date); $html .= acajoom::miseEnHTML(_ACA_USER_ID, '', $subscriber->user_id); } else { $html .= '<input type="hidden" name="confirmed" value="' . $subscriber->confirmed . '" />'; $html .= '<input type="hidden" name="blacklist" value="' . $subscriber->blacklist . '" />'; } $html .= '</table>'; $html .= '</fieldset></div>'; $html .= subscribersHTML::showSubscriberLists($subscriber, $listings, $queues, $frontEnd, $access); return $html; }
function edit($id) { global $my, $mainframe, $database, $option, $priTask, $subTask; global $WBG_CONFIG, $wbGalleryDB_cat; $row = new wbGalleryDB_cat($database); $row->load($id); if (!$row->id) { $row->published = 1; } $lists = array(); $catTree = $wbGalleryDB_cat->getCategoryTree(); $tList = array(mosHTML::makeOption('0', 'No Parent...', 'id', 'name')); $tList = array_merge($tList, $catTree); $lists['parent_id'] = mosHTML::selectList($tList, 'parent_id', '', 'id', 'name', (int) $row->parent_id); $lists['published'] = mosHTML::yesnoRadioList('published', '', (int) $row->published); $lists['access'] = mosAdminMenus::Access($row); wbGallery_cat_html::edit($row, $lists); }
function jlms_booking_edit($course_id, $option, &$rows, &$lists, $en_book) { global $Itemid, $my, $JLMS_DB, $JLMS_CONFIG; JLMS_TMPL::OpenMT(); $params = array('show_menu' => true); JLMS_TMPL::ShowHeader('conference', _JLMS_HEAD_CONF_STR, $params); JLMS_TMPL::OpenTS(); $row = $rows[0]; ?> <script type="text/javascript" language="javascript"> <!--//--><![CDATA[//><!-- function submitbutton(pressbutton) { var form = document.adminForm; if (pressbutton == 'period_cancel'){ form.mode.value = pressbutton; form.submit(); } else if (pressbutton == 'save_period'){ if(form.p_name.value == '') { alert("Specify name"); } else if(form.sel_option[1].checked) { var w_sel = 0; var m_sel = 0; var element = eval(document.adminForm['weekday[]']); for (var i=0; i<element.length; i++) { var o = element[i]; if(o.checked) w_sel = 1; } var element2 = eval(document.adminForm['monthday[]']); for (var i=0; i<element2.length; i++) { var o = element2[i]; if(o.checked) m_sel = 1; } if(m_sel && w_sel) { form.mode.value = pressbutton; form.submit(); } else { alert("Please Specify week day and month"); } } else { form.mode.value = pressbutton; form.submit(); } } } function getObj(name) { if (document.getElementById) { return document.getElementById(name); } else if (document.all) { return document.all[name]; } else if (document.layers) { return document.layers[name]; } } function Choose_option(opt) { if (opt) { getObj("sel_date").style.display = "block"; getObj("sel_period").style.display = "none"; } else { getObj("sel_period").style.display = "block"; getObj("sel_date").style.display = "none"; } } //--><!]]> </script> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td colspan="2"> </td> <td style="text-align:right;"><br /> <?php $toolbar = array(); $toolbar[] = array('btn_type' => 'save', 'btn_js' => "javascript:submitbutton('save_period');"); $toolbar[] = array('btn_type' => 'cancel', 'btn_js' => sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=conference&mode=booking&id={$course_id}")); echo JLMS_ShowToolbar($toolbar); ?> </td> </tr> </table> <?php JLMS_TMPL::CloseTS(); JLMS_TMPL::OpenTS(); ?> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="adminForm"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="sectiontableheader"> Main options </td> </tr> </table> <table cellpadding="2" cellspacing="0" border="0" width="100%"> <tr> <td width="170"> Name </td> <td> <input type="text" name="p_name" maxlenght="100" value="<?php echo $row->p_name; ?> " /> </td> </tr> <tr> <td width="170"> Professor </td> <td> <?php echo $lists['teacher_id']; ?> </td> </tr> <tr> <td> Description </td> <td> <textarea name="p_description" cols="40" rows="7"><?php echo $row->p_description; ?> </textarea> </td> </tr> </table> <table cellpadding="1" cellspacing="0" border="0" width="100%"> <tr> <td width="170"> Start Time </td> <td> <table> <tr> <td> <?php echo $lists['from_time']; ?> </td> <td> <?php echo $lists['from_minutes']; ?> </td> </tr> </table> </td> </tr> <tr> <td width="170"> End Time </td> <td> <table> <tr> <td> <?php echo $lists['to_time']; ?> </td> <td> <?php echo $lists['to_minutes']; ?> </td> </tr> </table> </td> </tr> </table> <table cellpadding="1" <?php if ($row->p_id) { echo 'style="display:none;"'; } ?> cellspacing="0" border="0" width="100%"> <tr> <td width="170"> Select Date </td> <td> <input type="radio" name="sel_option" checked value="0" onchange="Choose_option(1);" /> </td> </tr> <tr> <td> Select period </td> <td> <input type="radio" name="sel_option" value="1" onchange="Choose_option(0);" /> </td> </tr> </table> <table cellpadding="1" cellspacing="0" border="0" id="sel_date" width="100%"> <tr> <td width="170"> Choose Date </td> <td valign="middle" style="vertical-align:middle "> <?php echo JLMS_HTML::_('calendar.calendar', $row->cur_date, 'start', 'start'); ?> </td> </tr> </table> <table cellpadding="1" cellspacing="0" border="0" id="sel_period" style="display:none;" width="100%"> <tr> <td width="170"> Select days of week </td> <td valign="top"> <?php $weekday = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); for ($i = 0; $i < 7; $i++) { echo '<br /><input type="checkbox" name="weekday[]" value="' . $i . '" />' . $weekday[$i]; } ?> </td> </tr> <tr> <td width="170"> Select months </td> <td valign="top"> <?php for ($i = 0; $i < 7; $i++) { $month_num = date("m_Y", mktime(0, 0, 0, date("m") + $i, 1, date("Y"))); $month_text = date("F Y", mktime(0, 0, 0, date("m") + $i, 1, date("Y"))); echo '<br /><input type="checkbox" name="monthday[]" value="' . $month_num . '" />' . $month_text; } ?> </td> </tr> </table> <table cellpadding="1" cellspacing="0" border="0" width="100%"> <tr> <td width="170">Public</td> <td> <?php echo mosHTML::yesnoRadioList('c_public', 'class="inputbox" ', $row->public); ?> </td> </tr> </table> </table> <input type="hidden" name="task" value="conference" /> <input type="hidden" name="mode" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="p_id" value="<?php echo $row->p_id; ?> " /> <input type="hidden" name="id" value="<?php echo $course_id; ?> " /> <input type="hidden" name="state" value="0" /> </form> <?php JLMS_TMPL::CloseTS(); /*$controls = array(); $controls[] = array('href' => "javascript:submitbutton('period_cancel');", 'title' => _JLMS_CANCEL_ALT_TITLE, 'img' => 'cancel'); $controls[] = array('href' => "javascript:submitbutton('save_period');", 'title' => _JLMS_SAVE_ALT_TITLE, 'img' => 'save'); JLMS_TMPL::ShowControlsFooter($controls, sefRelToAbs("index.php?option=$option&Itemid=$Itemid&task=conference&mode=booking&id=$course_id")); */ JLMS_TMPL::CloseMT(); }
function editMailing($mailingEdit, $new, $listId, $forms, $show) { $lists = array(); $folders = array(); if (ACA_CMSTYPE) { $my =& JFactory::getUser(); $folders[] = JHTML::_('select.option', '/'); $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $mailingEdit->published); $lists['visible'] = JHTML::_('select.booleanlist', 'visible', 'class="inputbox"', $mailingEdit->visible); } else { global $my; $folders[] = mosHTML::makeOption('/'); $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $mailingEdit->published); $lists['visible'] = mosHTML::yesnoRadioList('visible', 'class="inputbox"', $mailingEdit->visible); } //endif $images = $mailingEdit->images; if (!isset($mailingEdit->list_id)) { $mailingEdit->list_id = $listId; } $pathA = ACA_JPATH_ROOT_NO_ADMIN . '/images/stories'; $pathL = ACA_JPATH_LIVE . '/images/stories'; $images = array(); if (ACA_CMSTYPE) { mailingsHTML::ReadImages($pathA, '/', $folders, $images); if (!isset($images['/'])) { $images['/'][] = JHTML::_('select.option', ''); } $javascript = "onchange=\"previewImage( 'imagefiles', 'view_imagefiles', '{$pathL}/' )\""; $lists['imagefiles'] = JHTML::_('select.genericlist', $images['/'], 'imagefiles', 'class="inputbox" size="10" multiple="multiple" ' . $javascript, 'value', 'text', null); $javascript = "onchange=\"changeDynaList( 'imagefiles', folderimages, document.adminForm.folders.options[document.adminForm.folders.selectedIndex].value, 0, 0); previewImage( 'imagefiles', 'view_imagefiles', '{$pathL}/' );\""; $lists['folders'] = JHTML::_('select.genericlist', $folders, 'folders', 'class="inputbox" size="1" ' . $javascript, 'value', 'text', '/'); $images2 = array(); foreach ($mailingEdit->images as $file) { $temp = explode('|', $file); if (strrchr($temp[0], '/')) { $filename = substr(strrchr($temp[0], '/'), 1); } else { $filename = $temp[0]; } $images2[] = JHTML::_('select.option', $file, $filename); } //$javascript = "onchange=\"previewImage( 'imagelist', 'view_imagelist', '$path/' ); showImageProps( '$path/' ); \" onfocus=\"previewImage( 'imagelist', 'view_imagelist', '$path/' )\""; $javascript = "onchange=\"previewImage( 'imagelist', 'view_imagelist', '{$pathL}/' ); showImageProps( '{$pathL}/' ); \""; $lists['imagelist'] = JHTML::_('select.genericlist', $images2, 'imagelist', 'class="inputbox" size="10" ' . $javascript, 'value', 'text'); $lists['_align'] = JHTML::_('list.positions', '_align'); $lists['_caption_align'] = JHTML::_('list.positions', '_caption_align'); } else { mosAdminMenus::ReadImages($pathA, '/', $folders, $images); $lists['folders'] = mosAdminMenus::GetImageFolders($folders, $pathL); $lists['imagefiles'] = mosAdminMenus::GetImages($images, $pathL); $lists['imagelist'] = mosAdminMenus::GetSavedImages($mailingEdit, $pathL); $lists['_align'] = mosAdminMenus::Positions('_align'); $lists['_caption_align'] = mosAdminMenus::Positions('_caption_align'); } //endif if (ACA_CMSTYPE) { // joomla 15 $pos[] = JHTML::_('select.option', 'bottom', _CMN_BOTTOM); $pos[] = JHTML::_('select.option', 'top', _CMN_TOP); $lists['_caption_position'] = JHTML::_('select.genericlist', $pos, '_caption_position', 'class="inputbox" size="1"', 'value', 'text'); } else { //joomla 1x $pos[] = mosHTML::makeOption('bottom', _CMN_BOTTOM); $pos[] = mosHTML::makeOption('top', _CMN_TOP); $lists['_caption_position'] = mosHTML::selectList($pos, '_caption_position', 'class="inputbox" size="1"', 'value', 'text'); } //endif backHTML::formStart('edit_mailing', $mailingEdit->html, $images); echo $forms['main']; if ($new and $mailingEdit->list_type == 7) { $mailingEdit->issue_nb = 0; } mailingsHTML::layout($mailingEdit, $lists, $show); ?> <input type="hidden" name="images" value="" /> <input type="hidden" name="html" value="<?php echo $mailingEdit->html; ?> " /> <input type="hidden" name="new_list" value="<?php echo $new; ?> " /> <input type="hidden" name="listid" value="<?php echo $listId; ?> " /> <input type="hidden" name="listype" value="<?php echo $mailingEdit->list_type; ?> " /> <input type="hidden" name="mailingid" value="<?php echo $mailingEdit->id; ?> " /> <input type="hidden" name="issue_nb" value="<?php echo $mailingEdit->issue_nb; ?> " /> <input type="hidden" name="userid" value="<?php echo $my->id; ?> " /> <?php }
/** * Compiles information to add or edit * @param integer The unique id of the record to edit (0 if new) */ function editWeblink($option, $id) { global $database, $my, $mosConfig_absolute_path; $lists = array(); $row = new mosWeblink($database); // load the row from the db table $row->load((int) $id); // fail if checked out not by 'me' if ($row->isCheckedOut($my->id)) { mosRedirect('index2.php?option=' . $option, 'The module $row->title is currently being edited by another administrator.'); } if ($id) { $row->checkout($my->id); } else { // initialise new record $row->published = 1; $row->approved = 1; $row->order = 0; $row->catid = intval(mosGetParam($_POST, 'catid', 0)); } // build the html select list for ordering $query = "SELECT ordering AS value, title AS text" . "\n FROM #__weblinks" . "\n WHERE catid = " . (int) $row->catid . "\n ORDER BY ordering"; $lists['ordering'] = mosAdminMenus::SpecificOrdering($row, $id, $query, 1); // build list of categories $lists['catid'] = mosAdminMenus::ComponentCategory('catid', $option, intval($row->catid)); // build the html select list $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published); $file = $mosConfig_absolute_path . '/administrator/components/com_weblinks/weblinks_item.xml'; $params = new mosParameters($row->params, $file, 'component'); HTML_weblinks::editWeblink($row, $lists, $params, $option); }
/** * Compiles information to add or edit a module * @param string The current GET/POST option * @param integer The unique id of the record to edit */ function editModule($option, $uid, $client) { global $database, $my, $mainframe; global $mosConfig_absolute_path; $lists = array(); $row = new mosModule($database); // load the row from the db table $row->load($uid); // fail if checked out not by 'me' if ($row->checked_out && $row->checked_out != $my->id) { echo "<script>alert('" . sprintf(T_('The module %s is currently being edited by another administrator'), $row->title) . "'); document.location.href='index2.php?option={$option}'</script>\n"; exit(0); } $row->title = htmlspecialchars(str_replace('&', '&', $row->title)); $row->content = htmlspecialchars(str_replace('&', '&', $row->content)); if ($uid) { $row->checkout($my->id); } // if a new record we must still prime the mosModule object with a default // position and the order; also add an extra item to the order list to // place the 'new' record in last position if desired if ($uid == 0) { $row->position = 'left'; $row->showtitle = true; //$row->ordering = $l; $row->published = 1; } if ($client == 'admin') { $where = "client_id='1'"; $lists['client_id'] = 1; $path = 'mod1_xml'; } else { $where = "client_id='0'"; $lists['client_id'] = 0; $path = 'mod0_xml'; } $query = "SELECT position, ordering, showtitle, title" . "\n FROM #__modules" . "\n WHERE " . $where . "\n ORDER BY ordering"; $database->setQuery($query); if (!($orders = $database->loadObjectList())) { echo $database->stderr(); return false; } $query = "SELECT position, description" . "\n FROM #__template_positions" . "\n WHERE position <> ''"; $database->setQuery($query); // hard code options for now $positions = $database->loadObjectList(); $orders2 = array(); $pos = array(); foreach ($positions as $position) { $orders2[$position->position] = array(); $pos[] = mosHTML::makeOption($position->position, $position->description); } $l = 0; $r = 0; for ($i = 0, $n = count($orders); $i < $n; $i++) { $ord = 0; if (array_key_exists($orders[$i]->position, $orders2)) { $ord = count(array_keys($orders2[$orders[$i]->position])) + 1; } $orders2[$orders[$i]->position][] = mosHTML::makeOption($ord, $ord . '::' . addslashes($orders[$i]->title)); } // build the html select list $pos_select = 'onchange="changeDynaList(\'ordering\',orders,document.adminForm.position.options[document.adminForm.position.selectedIndex].value, originalPos, originalOrder)"'; $active = $row->position ? $row->position : 'left'; $lists['position'] = mosHTML::selectList($pos, 'position', 'class="inputbox" size="1" ' . $pos_select, 'value', 'text', $active); // get selected pages for $lists['selections'] if ($uid) { $query = 'SELECT menuid AS value FROM #__modules_menu WHERE moduleid=' . $row->id; $database->setQuery($query); $lookup = $database->loadObjectList(); } else { $lookup = array(mosHTML::makeOption(0, 'All')); } if ($row->access == 99 || $row->client_id == 1 || $lists['client_id']) { $lists['access'] = T_('Administrator') . '<input type="hidden" name="access" value="99" />'; $lists['showtitle'] = T_('N/A') . ' <input type="hidden" name="showtitle" value="1" />'; $lists['selections'] = T_('N/A'); } else { if ($client == 'admin') { $lists['access'] = T_('N/A'); $lists['selections'] = T_('N/A'); } else { $lists['access'] = mosAdminMenus::Access($row); $lists['groups'] = mosAdminMenus::groupAccess($row); $lists['selections'] = mosAdminMenus::MenuLinks($lookup, 1, 1); } $lists['showtitle'] = mosHTML::yesnoRadioList('showtitle', 'class="inputbox"', $row->showtitle); } // build the html select list for published $lists['published'] = mosAdminMenus::Published($row); // xml file for module $xmlfile = $mainframe->getPath($path, $row->module); if ($xmlfile) { $xmlparser =& new mosXMLDescription($xmlfile); $row->description = $xmlparser->getDescription('module'); } else { $row->description = ''; } // get params definitions $params =& new mosAdminParameters($row->params, $xmlfile, 'module'); HTML_modules::editModule($row, $orders2, $lists, $params, $option); }
/** * @param option * @return builds admin configuration options */ function showConfig($option) { global $mosConfig_absolute_path, $database, $mosConfig_mailfrom; require $mosConfig_absolute_path . "/administrator/components/com_comment/config.comment.php"; ?> <script language="javascript" type="text/javascript"> function submitbutton(pressbutton) { var form = document.adminForm; if (pressbutton == 'cancel') { submitform( pressbutton ); return; } submitform( pressbutton ); } </script> <form action="index2.php" method="POST" name="adminForm"> <?php $gbtabs = new mosTabs(0); $gbtabs->startPane("_comment"); $gbtabs->startTab("General", "General-page"); ?> <table width="100%" border="0" cellpadding="4" cellspacing="2" class="adminForm"> <tr align="center" valign="middle"> <td align="left" valign="top"><strong><?php echo T_('Sections available'); ?> :</strong></td> <td align="left" valign="top"><select size="5" name="mcselections[]" class="inputbox" multiple="multiple"> <?php $seclistarray = explode(",", $allow_comments_in_sections); $database->setQuery("SELECT id,title FROM #__sections ORDER BY title ASC"); $dbsectionlist = $database->loadObjectList(); echo "<option value='0' "; if (in_array(0, $seclistarray)) { echo "selected"; } echo ">Static Content</option>"; foreach ($dbsectionlist as $slrow) { echo "<option value='{$slrow->id}' "; if (in_array($slrow->id, $seclistarray)) { echo "selected"; } echo ">{$slrow->title}</option>"; } ?> </select> </td> <td width="50%" align="left" valign="top">Choose which section(s) should use the comment system. Hold down [CTRL] to make multiple selections.</td> </tr> <tr align="center" valign="middle"> <td align="left" valign="top"><strong><?php echo T_('Autopublish Comments'); ?> :</strong></td> <td align="left" valign="top"> <?php echo mosHTML::yesnoRadioList('auto_publish_comments', 'class="inputbox"', $auto_publish_comments); ?> </td> <td align="left" valign="top"><?php echo T_('Automatically publish new comments'); ?> </td> </tr> <tr align="center" valign="middle"> <td align="left" valign="top"><strong><?php echo T_('Anonymous Comments'); ?> :</strong></td> <td align="left" valign="top"> <?php echo mosHTML::yesnoRadioList('allow_anonymous_entries', 'class="inputbox"', $allow_anonymous_entries); ?> </td> <td align="left" valign="top"><?php echo T_('Allow unregistered users to post comments'); ?> </td> </tr> <tr align="center" valign="middle"> <td align="left" valign="top"><strong><?php echo T_('Comments Per Page'); ?> :</strong></td> <td align="left" valign="top"> <?php $pp = array(mosHTML::makeOption(5, 5), mosHTML::makeOption(10, 10), mosHTML::makeOption(15, 15), mosHTML::makeOption(20, 20), mosHTML::makeOption(25, 25), mosHTML::makeOption(30, 30), mosHTML::makeOption(50, 50)); echo mosHTML::selectList($pp, 'comments_per_page', 'class="inputbox" size="1"', 'value', 'text', $comments_per_page); ?> </td> <td align="left" valign="top"><?php echo T_('When comments exceed the set level the page will automatically paginate'); ?> </td> </tr> </table> <?php $gbtabs->endTab(); $gbtabs->startTab("Notification", "Notification-page"); ?> <table width="100%" border="0" cellpadding="4" cellspacing="2" class="adminForm"> <tr align="center" valign="middle"> <td align="left" valign="top"><strong><?php echo T_('Notify Admin'); ?> :</strong></td> <td align="left" valign="top"> <?php echo mosHTML::yesnoRadioList('notify_new_entries', 'class="inputbox"', $notify_new_entries); ?> </td> <td align="left" valign="top" width="50%"><?php echo T_('Notify the administrator by email upon new comments'); ?> </td> </tr> <tr align="center" valign="middle"> <td align="left" valign="top"><strong><?php echo T_('Administrator Email'); ?> :</strong></td> <td align="left" valign="top"><?php echo $mosConfig_mailfrom; ?> </td> <td align="left" valign="top"><?php echo T_('set in Global Configuration / Mail'); ?> </td> </tr> </table> <?php $gbtabs->endTab(); $gbtabs->startTab("Admin", "Admin-page"); ?> <table width="100%" border="0" cellpadding="4" cellspacing="2" class="adminForm"> <tr align="center" valign="middle"> <td align="left" valign="top"><strong><?php echo T_('Comment Length'); ?> :</strong></td> <td align="left" valign="top"> <input name="admin_comments_length" type="text" size="5" value="<?php echo $admin_comments_length; ?> " /> </td> <td align="left" valign="top" width="50%"><?php echo T_('The length of comment to show in the admin screen before it is truncated.'); ?> </td> </tr> </table> <?php $gbtabs->endTab(); $gbtabs->endPane(); ?> <input type="hidden" name="option" value="<?php echo $option; ?> "> <input type="hidden" name="task" value=""> <input type="hidden" name="boxchecked" value="0"> </form> <?php }
/** * Compiles information to add or edit a category * @param string The name of the category section * @param integer The unique id of the category to edit (0 if new) * @param string The name of the current user */ function editCategory($uid = 0, $section = '') { global $database, $my, $adminLanguage; global $mosConfig_absolute_path, $mosConfig_live_site; $type = mosGetParam($_REQUEST, 'type', ''); $redirect = mosGetParam($_POST, 'section', ''); $row = new mosCategory($database); // load the row from the db table $row->load($uid); // fail if checked out not by 'me' if ($row->checked_out && $row->checked_out != $my->id) { mosRedirect('index2.php?option=categories§ion=' . $row->section, $adminLanguage->A_COMP_CATEG_MESSAGE . " " . $row->title . " " . $adminLanguage->A_COMP_CATEG_MESSAGE2); } if ($uid) { // existing record $row->checkout($my->id); // code for Link Menu if ($row->section > 0) { $query = "SELECT *" . "\n FROM #__menu" . "\n WHERE componentid = " . $row->id . "\n AND ( type = 'content_archive_category' OR type = 'content_blog_category' OR type = 'content_category' )"; $database->setQuery($query); $menus = $database->loadObjectList(); $count = count($menus); for ($i = 0; $i < $count; $i++) { switch ($menus[$i]->type) { case 'content_category': $menus[$i]->type = $adminLanguage->A_COMP_CATEG_TABLE; break; case 'content_blog_category': $menus[$i]->type = $adminLanguage->A_COMP_CATEG_BLOG; break; case 'content_archive_category': $menus[$i]->type = $adminLanguage->A_COMP_CATEG_BLOG_ARCHIVE; break; } } } else { $menus = array(); } } else { // new record $row->section = $section; $row->published = 1; $menus = NULL; } // make order list $order = array(); $database->setQuery("SELECT COUNT(*) FROM #__categories WHERE section='{$row->section}'"); $max = intval($database->loadResult()) + 1; for ($i = 1; $i < $max; $i++) { $order[] = mosHTML::makeOption($i); } // build the html select list for sections if ($section == 'content') { $query = "SELECT s.id AS value, s.title AS text" . "\n FROM #__sections AS s" . "\n ORDER BY s.ordering"; $database->setQuery($query); $sections = $database->loadObjectList(); $lists['section'] = mosHTML::selectList($sections, 'section', 'class="inputbox" size="1"', 'value', 'text'); } else { if ($type == 'other') { $section_name = 'N/A'; } else { $temp = new mosSection($database); $temp->load($row->section); $section_name = $temp->name; } $lists['section'] = '<input type="hidden" name="section" value="' . $row->section . '" />' . $section_name; } // build the html select list for category types $types[] = mosHTML::makeOption('', $adminLanguage->A_COMP_CATEG_SELECT_TYPE); $types[] = mosHTML::makeOption('content_category', $adminLanguage->A_COMP_CATEG_TABLE); $types[] = mosHTML::makeOption('content_blog_category', $adminLanguage->A_COMP_CATEG_BLOG); $types[] = mosHTML::makeOption('content_archive_category', $adminLanguage->A_COMP_CATEG_BLOG_ARCHIVE); $lists['link_type'] = mosHTML::selectList($types, 'link_type', 'class="inputbox" size="1"', 'value', 'text'); // build the html select list for ordering $query = "SELECT ordering AS value, title AS text" . "\n FROM #__categories" . "\n WHERE section = '{$row->section}'" . "\n ORDER BY ordering"; $lists['ordering'] = mosAdminMenus::SpecificOrdering($row, $uid, $query); // build the select list for the image positions $active = $row->image_position ? $row->image_position : 'left'; $lists['image_position'] = mosAdminMenus::Positions('image_position', $active, NULL, 0, 0); // Imagelist $lists['image'] = mosAdminMenus::Images('image', $row->image); // build the html select list for the group access $lists['access'] = mosAdminMenus::Access($row); // build the html radio buttons for published $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published); // build the html select list for menu selection $lists['menuselect'] = mosAdminMenus::MenuSelect(); categories_html::edit($row, $section, $lists, $redirect, $menus); }
/** * Creates a new or edits and existing user record * @param int The id of the user, 0 if a new entry * @param string The current GET/POST option */ function editNewsFeed($id, $option) { global $database, $my; $catid = intval(mosGetParam($_REQUEST, 'catid', 0)); $row = new mosNewsFeed($database); // load the row from the db table $row->load((int) $id); if ($id) { // do stuff for existing records $row->checkout($my->id); } else { // do stuff for new records $row->ordering = 0; $row->numarticles = 5; $row->cache_time = 3600; $row->published = 1; } // build the html select list for ordering $query = "SELECT a.ordering AS value, a.name AS text" . "\n FROM #__newsfeeds AS a" . "\n ORDER BY a.ordering"; $lists['ordering'] = mosAdminMenus::SpecificOrdering($row, $id, $query, 1); // build list of categories $lists['category'] = mosAdminMenus::ComponentCategory('catid', $option, intval($row->catid)); // build the html select list $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published); HTML_newsfeeds::editNewsFeed($row, $lists, $option); }
function showConfig($option) { global $mosConfig_absolute_path, $_DOCMAN; // disable the main menu to force user to use buttons $_REQUEST['hidemainmenu'] = 1; $std_inp = 'style="width: 125px" size="2"'; $std_opt = 'size="2"'; // Create the 'yes-no' radio options foreach (array('isDown', 'display_license', 'log', 'emailgroups', 'user_all', 'fname_lc', 'overwrite', 'security_anti_leech', 'trimwhitespace', 'process_bots', 'individual_perm', 'hide_remote') as $field) { $lists[$field] = mosHTML::yesnoRadioList($field, $std_opt, $_DOCMAN->getCfg($field, 0)); } $guest[] = mosHTML::makeOption(_DM_GRANT_NO, _DML_CFG_GUEST_NO); $guest[] = mosHTML::makeOption(_DM_GRANT_X, _DML_CFG_GUEST_X); $guest[] = mosHTML::makeOption(_DM_GRANT_RX, _DML_CFG_GUEST_RX); $lists['guest'] = mosHTML::selectList($guest, 'registered', '', 'value', 'text', $_DOCMAN->getCfg('registered', _DM_GRANT_RX)); $upload =& new dmHTML_UserSelect('user_upload', 1); $upload->addOption(_DML_CFG_USER_UPLOAD, _DM_PERMIT_NOOWNER); $upload->addGeneral(_DML_NO_USER_ACCESS, 'all'); $upload->addMamboGroups(); $upload->addDocmanGroups(); $upload->addUsers(); $upload->setSelectedValues(array($_DOCMAN->getCfg('user_upload', 0))); $lists['user_upload'] = $upload; $publish =& new dmHTML_UserSelect('user_publish', 1); $publish->addOption(_DML_CFG_USER_PUBLISH, _DM_PERMIT_NOOWNER); $publish->addGeneral(_DML_AUTO_PUBLISH, 'all'); $publish->addMamboGroups(); $publish->addDocmanGroups(); $publish->addUsers(); $publish->setSelectedValues(array($_DOCMAN->getCfg('user_publish', 0))); $lists['user_publish'] = $publish; $approve =& new dmHTML_UserSelect('user_approve', 1); $approve->addOption(_DML_CFG_USER_APPROVE, _DM_PERMIT_NOOWNER); $approve->addGeneral(_DML_AUTO_APPROVE, 'all'); $approve->addMamboGroups(); $approve->addDocmanGroups(); $approve->addUsers(); $approve->setSelectedValues(array($_DOCMAN->getCfg('user_approve', 0))); $lists['user_approve'] = $approve; $viewer =& new dmHTML_UserSelect('default_viewer', 1); $viewer->addOption(_DML_SELECT_USER, _DM_PERMIT_NOOWNER); $viewer->addGeneral(_DML_EVERYBODY); $viewer->addMamboGroups(); $viewer->addDocmanGroups(); $viewer->addUsers(); $viewer->setSelectedValues(array($_DOCMAN->getCfg('default_viewer', 0))); $lists['default_viewer'] = $viewer; $maintainer =& new dmHTML_UserSelect('default_editor', 1); $maintainer->addOption(_DML_SELECT_USER, _DM_PERMIT_NOOWNER); $maintainer->addGeneral(_DML_NO_USER_ACCESS); $maintainer->addMamboGroups(); $maintainer->addDocmanGroups(); $maintainer->addUsers(); $maintainer->setSelectedValues(array($_DOCMAN->getCfg('default_editor', 0))); $lists['default_maintainer'] = $maintainer; $author_can = array(); $author_can[] = mosHTML::makeOption(_DM_AUTHOR_NONE, _DML_CFG_AUTHOR_NONE); $author_can[] = mosHTML::makeOption(_DM_AUTHOR_CAN_READ, _DML_CFG_AUTHOR_READ); $author_can[] = mosHTML::makeOption(_DM_AUTHOR_CAN_EDIT, _DML_CFG_AUTHOR_BOTH); $lists['creator_can'] = mosHTML::selectList($author_can, 'author_can', '', 'value', 'text', $_DOCMAN->getCfg('author_can', _DM_AUTHOR_CAN_EDIT)); // Special compatibility mode /** REMOVED 1.4.0RC2 $specialcompat = array(); $specialcompat[] = mosHTML::makeOption(_DM_SPECIALCOMPAT_DM13, _DML_CFG_SPECIALCOMPAT_DM13); $specialcompat[] = mosHTML::makeOption(_DM_SPECIALCOMPAT_J10, _DML_CFG_SPECIALCOMPAT_J10); $lists['specialcompat'] = mosHTML::selectList($specialcompat, 'specialcompat', '', 'value', 'text', $_DOCMAN->getCfg('specialcompat', _DM_SPECIALCOMPAT_DM13)); */ // Blank handling for filenames $blanks[] = mosHTML::makeOption('0', _DML_CFG_ALLOWBLANKS); $blanks[] = mosHTML::makeOption('1', _DML_CFG_REJECT); $blanks[] = mosHTML::makeOption('2', _DML_CFG_CONVERTUNDER); $blanks[] = mosHTML::makeOption('3', _DML_CFG_CONVERTDASH); $blanks[] = mosHTML::makeOption('4', _DML_CFG_REMOVEBLANKS); $lists['fname_blank'] = mosHTML::selectList($blanks, 'fname_blank', '', 'value', 'text', $_DOCMAN->getCfg('fname_blank', 0)); // assemble icon sizes $size[] = mosHTML::makeOption('0', '16x16 pixel'); $size[] = mosHTML::makeOption('1', '32x32 pixel'); $lists['icon_size'] = mosHTML::selectList($size, 'icon_size', $std_inp, 'value', 'text', $_DOCMAN->getCfg('icon_size', 0)); // assemble icon themes /** REMOVED 1.4.0RC2 $docsFiles = DOCMAN_Compat::mosReadDirectory("$mosConfig_absolute_path/components/com_docman/themes/"); $docs = array(mosHTML::makeOption('', '')); foreach($docsFiles as $file) { if ($file <> "index.html") $docs[] = mosHTML::makeOption($file); } **/ // assemble displaying order $order[] = mosHTML::makeOption('name', _DML_NAME); $order[] = mosHTML::makeOption('date', _DML_DATE); $order[] = mosHTML::makeOption('hits', _DML_HITS); $lists['default_order'] = mosHTML::selectList($order, 'default_order', 'style="width: 125px"', 'value', 'text', $_DOCMAN->getCfg('default_order', 'name')); $order2[] = mosHTML::makeOption('ASC', _DML_ASCENDENT); $order2[] = mosHTML::makeOption('DESC', _DML_DESCENDENT); $lists['default_order2'] = mosHTML::selectList($order2, 'default_order2', 'style="width: 125px"', 'value', 'text', $_DOCMAN->getCfg('default_order2', 'DESC')); // Assemble the methods we allow $methods = array(); $methods[] = mosHTML::makeOption('http', _DML_OPTION_HTTP); $methods[] = mosHTML::makeOption('link', _DML_OPTION_LINK); $methods[] = mosHTML::makeOption('transfer', _DML_OPTION_XFER); $default_methods = $_DOCMAN->getCfg('methods', array('http')); // ugh ... all because they like arrays of classes.... $class_methods = array(); foreach ($default_methods as $a_method) { $class_methods[] = mosHTML::makeOption($a_method); } $lists['methods'] = mosHTML::selectList($methods, 'methods[]', 'size="3" multiple', 'value', 'text', $class_methods); HTML_DMConfig::configuration($lists); $_DOCMAN->saveConfig(); // Save any defaults we created... }
/** * Compiles information to add or edit a section * @param database A database connector object * @param string The name of the category section * @param integer The unique id of the category to edit (0 if new) * @param string The name of the current user */ function editSection($uid = 0, $scope = '', $option) { global $database, $my, $adminLanguage; global $mosConfig_absolute_path, $mosConfig_live_site; $row = new mosSection($database); // load the row from the db table $row->load($uid); // fail if checked out not by 'me' if ($row->checked_out && $row->checked_out != $my->id) { $msg = $adminLanguage->A_COMP_SECT_THE . " " . $row->title . " " . $adminLanguage->A_COMP_ANOTHER_ADMIN; mosRedirect('index2.php?option=' . $option . '&scope=' . $row->scope . '&mosmsg=' . $msg); } if ($uid) { $row->checkout($my->id); if ($row->id > 0) { $query = "SELECT *" . "\n FROM #__menu" . "\n WHERE componentid = " . $row->id . "\n AND ( type = 'content_archive_section' OR type = 'content_blog_section' OR type = 'content_section' )"; $database->setQuery($query); $menus = $database->loadObjectList(); $count = count($menus); for ($i = 0; $i < $count; $i++) { switch ($menus[$i]->type) { case 'content_section': $menus[$i]->type = 'Section Table'; break; case 'content_blog_section': $menus[$i]->type = 'Section Blog'; break; case 'content_archive_section': $menus[$i]->type = 'Section Blog Archive'; break; } } } else { $menus = array(); } } else { $row->scope = $scope; $row->published = 1; $menus = array(); } // build the html select list for section types $types[] = mosHTML::makeOption('', $adminLanguage->A_COMP_CATEG_SELECT_TYPE); $types[] = mosHTML::makeOption('content_section', $adminLanguage->A_COMP_SECT_LIST); $types[] = mosHTML::makeOption('content_blog_section', $adminLanguage->A_COMP_SECT_BLOG); $types[] = mosHTML::makeOption('content_archive_section', $adminLanguage->A_COMP_SECT_ARCHIVE_BLOG); $lists['link_type'] = mosHTML::selectList($types, 'link_type', 'class="inputbox" size="1"', 'value', 'text'); // build the html select list for ordering $query = "SELECT ordering AS value, title AS text" . "\n FROM #__sections" . "\n WHERE scope='{$row->scope}' ORDER BY ordering"; $lists['ordering'] = mosAdminMenus::SpecificOrdering($row, $uid, $query); // build the select list for the image positions $active = $row->image_position ? $row->image_position : 'left'; $lists['image_position'] = mosAdminMenus::Positions('image_position', $active, NULL, 0); // build the html select list for images $lists['image'] = mosAdminMenus::Images('image', $row->image); // build the html select list for the group access $lists['access'] = mosAdminMenus::Access($row); // build the html radio buttons for published $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published); // build the html select list for menu selection $lists['menuselect'] = mosAdminMenus::MenuSelect(); sections_html::edit($row, $option, $lists, $menus); }
function editUser($uid = '0', $option = 'users') { global $database, $my, $acl; $row = new mosUser($database); // load the row from the db table $row->load($uid); if ($uid) { $query = "SELECT * FROM #__contact_details WHERE user_id='" . $row->id . "'"; $database->setQuery($query); $contact = $database->loadObjectList(); } else { $contact = NULL; $row->block = 0; } // check to ensure only super admins can edit super admin info if ($my->gid < 25 && $row->gid == 25) { mosRedirect('index2.php?option=com_users', T_('You are not authorized to view this resource.')); } $my_group = strtolower($acl->get_group_name($row->gid, 'ARO')); if ($my_group == 'super administrator') { $lists['gid'] = '<input type="hidden" name="gid" value="' . $my->gid . '" /><strong>' . T_('Super Administrator') . '</strong>'; } else { if ($my->gid == 24 && $row->gid == 24) { $lists['gid'] = '<input type="hidden" name="gid" value="' . $my->gid . '" /><strong>' . T_('Administrator') . '</strong>'; } else { // ensure user can't add group higher than themselves $my_groups = $acl->get_object_groups('users', $my->id, 'ARO'); if (is_array($my_groups) && count($my_groups) > 0) { $ex_groups = $acl->get_group_children($my_groups[0], 'ARO', 'RECURSE'); if (!$ex_groups) { $ex_groups = array(); } } else { $ex_groups = array(); } $gtree = $acl->get_group_children_tree(null, 'USERS', false); // remove users 'above' me $i = 0; while ($i < count($gtree)) { if (in_array($gtree[$i]->value, $ex_groups)) { array_splice($gtree, $i, 1); } else { $i++; } } $lists['gid'] = mosHTML::selectList($gtree, 'gid', 'size="10"', 'value', 'text', $row->gid); } } // build the html select list $lists['block'] = mosHTML::yesnoRadioList('block', 'class="inputbox" size="1"', $row->block); // build the html select list $lists['sendEmail'] = mosHTML::yesnoRadioList('sendEmail', 'class="inputbox" size="1"', $row->sendEmail); HTML_users::edituser($row, $contact, $lists, $option, $uid); }
function JQ_editCategoryGQP($uid, $option, $page, $course_id) { global $JLMS_DB, $my; $menu = new mos_Joomla_LMS_GQPCategories($JLMS_DB); $menu->load((int) $uid); $menu->name = $menu->c_category; if (!isset($menu->lesson_type) || !$menu->lesson_type) { $menu->lesson_type = 1; } // build the html select list for paraent item $lists['parent'] = JLMS_quiz_admin_class::GQP_parent($menu->id, $menu->parent); $list = array(); $javascript = ''; // onchange="javascript:view_fields(this,0);"'; if ($menu->parent) { $disabled = 'disabled="disabled"'; } else { $disabled = ''; } $lists['restricted_category'] = mosHTML::yesnoRadioList('restricted', $disabled . 'class="inputbox" id="restricted_radio"' . $javascript, $menu->restricted); $query = "SELECT groups FROM #__lms_gqp_cats WHERE id = '" . $uid . "'"; $JLMS_DB->setQuery($query); $JLMS_DB->query(); $groups = $JLMS_DB->loadResult(); $groups = substr($groups, 1, strlen($groups) - 2); $groups_arr = explode('|', $groups); $query = "SELECT * FROM #__lms_usergroups WHERE course_id = 0"; $JLMS_DB->setQuery($query); $JLMS_DB->query(); $rows = $JLMS_DB->loadObjectList(); if ($menu->restricted && !$menu->parent) { $disabled = ''; } else { $disabled = 'disabled="disabled"'; } // assemble menu items to the array $select_list = '<select ' . $disabled . ' class="inputbox" style="width: 272px;" size="12" multiple="multiple" name="groups[]" id="restricted_groups">'; for ($i = 0; $i < count($rows); $i++) { $selected = ''; for ($j = 0; $j < count($groups_arr); $j++) { if ($groups_arr[$j] == $rows[$i]->id) { $selected = 'selected="selected"'; break; } } $select_list .= '<option value="' . $rows[$i]->id . '" ' . $selected . '>' . $rows[$i]->ug_name . '</option>'; } $select_list .= '</select>'; $lists['restricted_groups'] = $select_list; JLMS_quiz_admin_html_class::JQ_showeditCategoryGQP($menu, $lists, $rows, $option); }
function prepList($listEdit) { global $my, $acl; $lists = array(); $jour = array(); $jour[] = mosHTML::makeOption('1', _ACA_AUTO_DAY_CH1); $jour[] = mosHTML::makeOption('3', _ACA_AUTO_DAY_CH3); $jour[] = mosHTML::makeOption('5', _ACA_AUTO_DAY_CH5); $jour[] = mosHTML::makeOption('6', _ACA_AUTO_DAY_CH6); $jour[] = mosHTML::makeOption('7', _ACA_AUTO_DAY_CH7); $jour[] = mosHTML::makeOption('8', _ACA_AUTO_DAY_CH8); $jour[] = mosHTML::makeOption('9', _ACA_AUTO_DAY_CH9); $auto_option[] = mosHTML::makeOption('0', _ACA_AUTO_OPTION_NONE); $auto_option[] = mosHTML::makeOption('1', _ACA_AUTO_OPTION_NEW); if ($listEdit->new_letter == 1) { $auto_option[] = mosHTML::makeOption('2', _ACA_AUTO_OPTION_ALL); } $lists['delay_min'] = mosHTML::selectList($jour, 'delay_min', 'class="inputbox" size="1"', 'value', 'text', $listEdit->delay_min); $lists['auto_add'] = mosHTML::radioList($auto_option, 'auto_add', 'class="inputbox"', $listEdit->auto_add); $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $listEdit->published); $lists['hidden'] = mosHTML::yesnoRadioList('hidden', 'class="inputbox"', $listEdit->hidden); $lists_option = lisType::getListOption(); $lists['list_type'] = listsHTML::aca_radioList($lists_option, 'list_type', 'class="inputbox"', $listEdit->list_type); $lists['html_mailings'] = mosHTML::yesnoRadioList('html', 'class="inputbox"', $listEdit->html); $lists['unsubscribesend'] = mosHTML::yesnoRadioList("unsubscribesend", 'class="inputbox"', $listEdit->unsubscribesend); $lists['footer'] = mosHTML::yesnoRadioList("footer", 'class="inputbox"', $listEdit->footer); $my_group = strtolower($acl->get_group_name($listEdit->acc_id, 'ARO')); $gtree = $acl->get_group_children_tree(null, 'USERS', false); $lists['gid'] = mosHTML::selectList($gtree, 'acc_id', 'size="10"', 'value', 'text', $listEdit->acc_id); $lists['edit_perms'] = mosHTML::selectList($gtree, 'acc_level', 'size="10"', 'value', 'text', $listEdit->acc_level); return $lists; }
function edit() { global $my, $mainframe, $database, $option, $priTask, $subTask; global $WBG_CONFIG, $wbGalleryDB_cat, $wbGallery_admin; mosCommonHTML::loadOverlib(); ?> <form action="index2.php" method="post" name="adminForm" enctype="multipart/form-data"> <table class="adminheading"> <tr> <th class="config"> <font size="+1">wbGallery</font><br/> Manage Configuration Options<br/> <a href="<?php echo $mainframe->getCfg('live_site'); ?> /administrator/components/com_wbgallery/CHANGELOG.txt" target="_blank">[ View Change Log ]</a> in New Window </th> </tr> </table> <table width="100%" cellspacing="2" cellpadding="0"> <tr><td valign="top"> <table class="adminlist" width="100%" cellspacing="2" cellpadding="0"> <tr> <th class="title" colspan="2">Resized Images - Large Format</th> </tr> <tr> <td>Resize Large:</td> <td><?php echo mosHTML::yesnoRadioList('wbgconf[save_large]', '', $WBG_CONFIG->save_large); ?> <?php echo mosToolTip('Should we Save the a Large Resized Image?', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Large Image Path:</td> <td><input type="text" name="wbgconf[path_large]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->path_large; ?> " /> <?php echo mosToolTip('Path to Save a the Large Resized Images (with trailing slash)', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Large Width:</td> <td><input type="text" name="wbgconf[width_large]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->width_large; ?> " /> <?php echo mosToolTip('Maxiumum Width of the Large Resized Images', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Large Height:</td> <td><input type="text" name="wbgconf[height_large]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->height_large; ?> " /> <?php echo mosToolTip('Maxiumum Height of the Large Resized Images', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Large Image Quality:</td> <td><input type="text" name="wbgconf[quality_large]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->quality_large; ?> " /> <?php echo mosToolTip('This is the Image Quality to use for Large Resized Images', 'Configuration Tip'); ?> </td> </tr> <tr> <th class="title" colspan="2">Resized Images - Medium Format</th> </tr> <tr> <td>Resize Medium:</td> <td><?php echo mosHTML::yesnoRadioList('wbgconf[save_medium]', '', $WBG_CONFIG->save_medium); ?> <?php echo mosToolTip('Should we Save the a Medium Resized Image?', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Medium Image Path:</td> <td><input type="text" name="wbgconf[path_medium]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->path_medium; ?> " /> <?php echo mosToolTip('Path to Save a the Medium Resized Images (with trailing slash)', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Medium Width:</td> <td><input type="text" name="wbgconf[width_medium]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->width_medium; ?> " /> <?php echo mosToolTip('Maxiumum Width of the Medium Resized Images', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Medium Height:</td> <td><input type="text" name="wbgconf[height_medium]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->height_medium; ?> " /> <?php echo mosToolTip('Maxiumum Height of the Medium Resized Images', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Medium Image Quality:</td> <td><input type="text" name="wbgconf[quality_medium]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->quality_medium; ?> " /> <?php echo mosToolTip('This is the Image Quality to use for Medium Resized Images', 'Configuration Tip'); ?> </td> </tr> <tr> <th class="title" colspan="2">Resized Images - Thumbnail Format</th> </tr> <tr> <td>Resize Thumbnail:</td> <td><?php echo mosHTML::yesnoRadioList('wbgconf[save_thumb]', '', $WBG_CONFIG->save_thumb); ?> <?php echo mosToolTip('Should we Save the a Thumbnail Resized Image?', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Thumbnail Image Path:</td> <td><input type="text" name="wbgconf[path_thumb]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->path_thumb; ?> " /> <?php echo mosToolTip('Path to Save a the Thumbnail Resized Images (with trailing slash)', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Thumbnail Width:</td> <td><input type="text" name="wbgconf[width_thumb]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->width_thumb; ?> " /> <?php echo mosToolTip('Maxiumum Width of the Thumbnail Resized Images', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Thumbnail Height:</td> <td><input type="text" name="wbgconf[height_thumb]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->height_thumb; ?> " /> <?php echo mosToolTip('Maxiumum Height of the Thumbnail Resized Images', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Thumbnail Image Quality:</td> <td><input type="text" name="wbgconf[quality_thumb]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->quality_thumb; ?> " /> <?php echo mosToolTip('This is the Image Quality to use for Thumbnail Resized Images', 'Configuration Tip'); ?> </td> </tr> <tr> <th class="title" colspan="2">Resized Images - ThumbTack Format</th> </tr> <tr> <td>Resize ThumbTack:</td> <td><?php echo mosHTML::yesnoRadioList('wbgconf[save_tack]', '', $WBG_CONFIG->save_tack); ?> <?php echo mosToolTip('Should we Save the a ThumbTack Resized Image?', 'Configuration Tip'); ?> </td> </tr> <tr> <td>ThumbTack Image Path:</td> <td><input type="text" name="wbgconf[path_tack]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->path_tack; ?> " /> <?php echo mosToolTip('Path to Save a the ThumbTack Resized Images (with trailing slash)', 'Configuration Tip'); ?> </td> </tr> <tr> <td>ThumbTack Width:</td> <td><input type="text" name="wbgconf[width_tack]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->width_tack; ?> " /> <?php echo mosToolTip('Maxiumum Width of the ThumbTack Resized Images', 'Configuration Tip'); ?> </td> </tr> <tr> <td>ThumbTack Height:</td> <td><input type="text" name="wbgconf[height_tack]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->height_tack; ?> " /> <?php echo mosToolTip('Maxiumum Height of the ThumbTack Resized Images', 'Configuration Tip'); ?> </td> </tr> <tr> <td>ThumbTack Image Quality:</td> <td><input type="text" name="wbgconf[quality_tack]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->quality_tack; ?> " /> <?php echo mosToolTip('This is the Image Quality to use for ThumbTack Resized Images', 'Configuration Tip'); ?> </td> </tr> <tr> <th class="title" colspan="2">Original Images</th> </tr> <tr> <td width="200">Save Originals:</td> <td><?php echo mosHTML::yesnoRadioList('wbgconf[save_original]', '', $WBG_CONFIG->save_original); ?> <?php echo mosToolTip('Should we Save the Original Image?', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Images Path:</td> <td><input type="text" name="wbgconf[path_original]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->path_original; ?> " /> <?php echo mosToolTip('Path to Save a Copy of the Original Images', 'Configuration Tip'); ?> </td> </tr> <tr> <th class="title" colspan="2">Image Processing Options</th> </tr> <tr> <td>Manage Memory:</td> <td><?php echo mosHTML::yesnoRadioList('wbgconf[use_memManager]', '', $WBG_CONFIG->use_memManager); ?> <?php echo mosToolTip('Should we Attempt to Manage the Server Memory when Processing Images? This feature attempts to allocate additional memory from the server when the image resize process is taking place.', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Use Image Magik:</td> <td><?php echo mosHTML::yesnoRadioList('wbgconf[use_ImageMagik]', '', $WBG_CONFIG->use_ImageMagik); ?> <?php echo mosToolTip('Should we Attempt to use the Image Magik Library for Image Processing? This is a SHELL command that will need to be installed if not already.', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Path to Image Magik:</td> <td><input type="text" name="wbgconf[path_ImageMagik]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->path_ImageMagik; ?> " /> <?php echo mosToolTip('This is the PATH (with trailing slash) to the Image Magik script.', 'Configuration Tip'); ?> </td> </tr> <tr> <td>Image Magik Command:</td> <td><input type="text" name="wbgconf[file_ImageMagik]" class="text_area" size="30" value="<?php echo $WBG_CONFIG->file_ImageMagik; ?> " /> <?php echo mosToolTip('This is the SCRIPT FILENAME for the Image Magik script, located in the Image Magik Path.', 'Configuration Tip'); ?> </td> </tr> <tr> <th class="title" colspan="2">General Operation</th> </tr> <tr> <td>Show Copyright Footer:</td> <td><?php echo mosHTML::yesnoRadioList('wbgconf[show_copyright]', '', $WBG_CONFIG->show_copyright); ?> <?php echo mosToolTip('Will you Spread the Word and Keep the Copyright Footer Active?', 'Configuration Tip'); ?> </td> </tr> </table> </td><td valign="top"> <table class="adminlist" width="100%" cellspacing="2" cellpadding="0"> <tr> <th class="title" colspan="5">wbGallery Menu Items</th> </tr> <tr> <th>#</th> <th>Menu</th> <th>Type</th> <th>Title</th> <th>Itemid</th> </tr> <?php $database->setQuery("SELECT * FROM #__menu WHERE `link` LIKE '%{$option}%'"); $mRows = $database->loadObjectList(); $count = 1; foreach ($mRows as $mRow) { $menuLink = 'index2.php?option=com_menus&menutype=' . $mRow->menutype; $itemLink = 'index2.php?option=com_menus&menutype=' . $mRow->menutype . '&task=edit&id=' . $mRow->id . '&hidemainmenu=1'; $prevLink = $mainframe->getCfg('live_site') . '/' . $mRow->link; if ($mRow->type == 'components') { $prevLink .= '&Itemid=' . $mRow->id; } ?> <tr> <td><?php echo $count++; ?> </td> <td><a href="<?php echo $menuLink; ?> " target="_blank" alt="Manage Menu"><?php echo $mRow->menutype; ?> </a></td> <td><?php echo $mRow->type == 'components' ? 'Control' : 'Reference'; ?> </td> <td><a href="<?php echo $itemLink; ?> " target="_blank" alt="Edit Menu Item"><?php echo $mRow->name; ?> </a></td> <td><?php echo $mRow->id; ?> <a href="<?php echo $prevLink; ?> " target="_blank" alt="Preview">[ show ]</a></td> </tr> <?php } ?> </table> </td></tr> </table> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="hidemainmenu" value="0" /> </form> <?php }
function editCategory($section = '', $uid = 0) { global $database, $my, $acl; global $mosConfig_absolute_path, $mosConfig_live_site; $type = mosGetParam($_REQUEST, 'type', ''); $redirect = mosGetParam($_POST, 'section', ''); $row = new mainBooklibraryCategories($database); //for 1.6 // load the row from the db table $row->load($uid); // fail if checked out not by 'me' if ($row->checked_out && $row->checked_out != $my->id) { mosRedirect('index.php?option=com_booklibrary&task=categories', 'The category ' . $row->title . ' is currently being edited by another administrator'); } $is_new = false; if ($uid) { // existing record $row->checkout($my->id); // code for Link Menu } else { $is_new = true; // new record $row->section = $section; $row->published = 1; } // make order list $order = array(); $database->setQuery("SELECT COUNT(*) FROM #__booklibrary_main_categories WHERE section='{$row->section}'"); //for 1.6 $max = intval($database->loadResult()) + 1; for ($i = 1; $i < $max; $i++) { $order[] = mosHTML::makeOption($i); } // build the html select list for ordering $query = "SELECT ordering AS value, title AS text" . "\n FROM #__booklibrary_main_categories" . "\n WHERE section = '{$row->section}'" . "\n ORDER BY ordering"; $mosAdminMenus = new mosAdminMenus(); //$lists['ordering'] = mosAdminMenus::SpecificOrdering($row, $uid, $query); $lists['ordering'] = version_compare(JVERSION, '3.0', 'ge') ? NUll : $mosAdminMenus->SpecificOrdering($row, $uid, $query); // build the select list for the image positions $active = $row->image_position ? $row->image_position : 'left'; $lists['image_position'] = version_compare(JVERSION, '3.0', 'ge') ? NUll : $mosAdminMenus->Positions('image_position', $active, null, 0, 0); //$lists['image_position'] = mosAdminMenus::Positions('image_position', $active, null, 0, 0); // Imagelist $lists['image'] = HTML::imageList('image', $row->image); // build the html radio buttons for published $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published); // build the html select list for paraent item $options = array(); $options[] = mosHTML::makeOption('0', _BOOKLIBRARY_A_SELECT_TOP); //***********access category */ $gtree[] = mosHTML::makeOption('-2', 'Everyone'); $gtree = get_group_children_tree_bl(); $f = ""; $s = explode(',', $row->params); for ($i = 0; $i < count($s); $i++) { $f[] = mosHTML::makeOption($s[$i]); } $lists['category']['registrationlevel'] = mosHTML::selectList($gtree, 'category_registrationlevel[]', 'size="" multiple="multiple"', 'value', 'text', $f); //********end access category*/ //-------langarray------------- $retVal1 = mosBooklibraryOthers::getLanguageArray(); $lang = null; for ($i = 0, $n = count($retVal1); $i < $n; $i++) { $help = $retVal1[$i]; $lang[] = mosHTML::makeOption($help[0], $help[1]); } $lists['langlist'] = mosHTML::selectList($lang, 'language', 'class="inputbox" size="1"', 'value', 'text'); //----------------------------- $lists['parent'] = HTML::categoryParentList($row->id, "", $is_new, $options); $params2 = unserialize($row->params2); $alone = ''; $view = ''; if ($uid != 0) { if (isset($params2->alone_category) or isset($params2->view_book)) { $alone = $params2->alone_category; $view = $params2->view_book; } } $component_path = JPath::clean(JPATH_SITE . '/components/com_booklibrary/views/showCategory/tmpl'); $component_layouts = array(); $options = array(); if (is_dir($component_path) && ($component_layouts = JFolder::files($component_path, '^[^_]*\\.php$', false, true))) { $alone_category[] = JHtml::_('select.option', '', 'Use Global'); foreach ($component_layouts as $i => $file) { $select_file_name = pathinfo($file); $select_file_name = $select_file_name['filename']; $alone_category[] = JHtml::_('select.option', $select_file_name, $select_file_name); } } $component_path = JPath::clean(JPATH_SITE . '/components/com_booklibrary/views/view_book/tmpl'); $component_layouts = array(); $options = array(); if (is_dir($component_path) && ($component_layouts = JFolder::files($component_path, '^[^_]*\\.php$', false, true))) { $view_book[] = JHtml::_('select.option', '', 'Use Global'); foreach ($component_layouts as $i => $file) { $select_file_name = pathinfo($file); $select_file_name = $select_file_name['filename']; $view_book[] = JHtml::_('select.option', $select_file_name, $select_file_name); } } $lists['view_book'] = mosHTML::selectList($view_book, 'view_book', 'class="inputbox" size="1"', 'value', 'text', $view); HTML_Categories::edit($row, $section, $lists, $redirect); }
function fetchEditDocumentForm($uid, $filename = null, $catid = 0) { global $database, $mosConfig_absolute_path; global $_DOCMAN, $_DMUSER; $doc = new mosDMDocument($database); if ($uid) { $doc->load($uid); //Load the document //check user permissions $err = $_DMUSER->canPreformTask($doc, 'Edit'); if ($err) { _returnTo('cat_view', $err, $doc->catid); } } else { $doc->init_record(); //Initialise a document //check user permissions $err = $_DMUSER->canPreformTask($doc, 'Upload'); if ($err) { _returnTo('cat_view', $err, $doc->catid); } } //checkout the document $doc->checkout($_DMUSER->userid); // Set document filename if (!is_null($filename)) { $filename = DOCMAN_Utils::safeDecodeURL($filename); $doc->dmfilename = $filename; } // Set document url $prefix = substr($doc->dmfilename, 0, _DM_DOCUMENT_LINK_LNG); if (strcasecmp($prefix, _DM_DOCUMENT_LINK) == 0) { $doc->dmlink = substr($doc->dmfilename, _DM_DOCUMENT_LINK_LNG); $doc->dmfilename = _DM_DOCUMENT_LINK; } $lists = array(); // Set filename $lists['dmfilename'] = filesSelectList($doc); // Built category select list $options = array(mosHTML::makeOption('0', _DML_SELECT_CAT)); if ($uid) { $lists['catid'] = dmHTML::categoryList($doc->catid, "", $options); } else { $lists['catid'] = dmHTML::categoryList($catid, "", $options); } // Build select lists $lists['approved'] = mosHTML::yesnoRadioList('approved', 'class="inputbox"', $doc->approved); $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $doc->published); $lists['viewer'] = dmHTML::viewerList($doc, 'dmowner'); $lists['maintainer'] = dmHTML::maintainerList($doc, 'dmmantainedby'); $lists['licenses'] = licenseSelectList($doc); $lists['licenses_display'] = licenseDisplayList($doc); // Built image list $lists['dmthumbnail'] = dmHTML::imageList('dmthumbnail', $doc->dmthumbnail); $lists['dmthumbnail_preview'] = $doc->dmthumbnail; // Find lastupdate user $last = array(); if ($doc->dmlastupdateby > _DM_PERMIT_USER) { $database->setQuery("SELECT id, name " . "\n FROM #__users " . "\n WHERE id=" . (int) $doc->dmlastupdateby); $last = $database->loadObjectList(); } else { $last[0]->name = "Super Administrator"; } // Find createdby user $created = array(); if ($doc->dmsubmitedby > _DM_PERMIT_USER) { $database->setQuery("SELECT id, name " . "\n FROM #__users " . "\n WHERE id=" . (int) $doc->dmsubmitedby); $created = $database->loadObjectList(); } else { $created[0]->name = "Super Administrator"; } // update 'dmlastupdateon' $doc->dmlastupdateon = date("Y-m-d H:i:s"); // Params definitions $params = null; $params_path = $mosConfig_absolute_path . '/administrator/components/com_docman/docman.params.xml'; if (file_exists($params_path)) { $params =& new dmParameters($doc->attribs, $params_path, 'params'); } /* ------------------------------ * * MAMBOT - Setup All Mambots * * ------------------------------ */ $prebot = new DOCMAN_mambot('onBeforeEditDocument'); $prebot->setParm('document', $doc); $prebot->setParm('filename', $filename); $prebot->setParm('user', $_DMUSER); if (!$uid) { $prebot->copyParm('process', 'new document'); } else { $prebot->copyParm('process', 'edit document'); } $prebot->trigger(); if ($prebot->getError()) { _returnTo('cat_view', $prebot->getErrorMsg()); } return HTML_DMDocuments::editDocumentForm($doc, $lists, $last, $created, $params); }
function newLPath_SCORM(&$row, &$lists, $option, $course_id, $params, $lp_params) { global $Itemid, $_MAMBOTS, $JLMS_CONFIG; ?> <script language="javascript" type="text/javascript"> <!--//--><![CDATA[//><!-- var lpath_sel_type = 2; var scorm_upl_type = 1; <?php if (!$row->id) { ?> var tmp_nb_var = <?php echo $params->get('scorm_nav_bar', 0); ?> ; var tmp_sl_var = <?php echo $params->get('scorm_layout', 0); ?> ; var tmp_sc_gb = <?php echo $lp_params->get('show_in_gradebook', 1); ?> ; var tmp_sc_hid = <?php echo $lp_params->get('hide_in_list', 0); ?> ; <?php } else { ?> var tmp_nb_var = 0; var tmp_sl_var = 0; var tmp_sc_gb = 0; var tmp_sc_hid = 0; <?php } ?> var tmp_sc_pub = 0; function jlms_isChecked(formname,isitchecked){ if (isitchecked == true){ eval('document.'+formname+'.boxchecked.value++'); } else { eval('document.'+formname+'.boxchecked.value--'); } } function jlms_change_scorm_stages_view() { if (tmp_sl_var == 1) { $('scorm_stage_width_section').style.display = ''; } else { $('scorm_stage_width_section').style.display = 'none'; } } function submitbutton(pressbutton, jform_name) { var form = eval("document."+jform_name);//adminForm; lpath_sel_type = form.lpath_type.value; if (pressbutton == 'cancel_lpath') { form.task.value = 'cancel_lpath'; form.submit(); } else { if (pressbutton == 'lpath_add_prereq') { if (form.lpath_new_prereq.value && form.lpath_new_prereq.value != 0 && form.lpath_new_prereq.value != '0') { form.task.value = 'lpath_add_prereq'; form.submit(); } else { return; } } else if (pressbutton == 'lpath_del_prereq') { if (form.boxchecked.value && form.boxchecked.value != 0 && form.boxchecked.value != '0') { form.task.value = 'lpath_del_prereq'; form.submit(); } else { return; } } <?php if (!$row->id) { ?> if (scorm_upl_type == 1) { form.scorm_height.value = document.adminFormsc_media.scorm_height.value; for (var i=0; i < document.adminFormsc_media.is_time_related.length; i++) { if (document.adminFormsc_media.is_time_related[i].checked) { form.is_time_related.value = document.adminFormsc_media.is_time_related[i].value; } } form.days.value = document.adminFormsc_media.days.value; form.hours.value = document.adminFormsc_media.hours.value; form.mins.value = document.adminFormsc_media.mins.value; form['params[scorm_nav_bar]'].value = tmp_nb_var; form['params[scorm_layout]'].value = tmp_sl_var; form['lp_params[hide_in_list]'].value = tmp_sc_hid; form['lp_params[published]'].value = tmp_sc_pub; if (form.scorm_file.value == "") { alert( "<?php echo _JLMS_LPATH_CHOOSE_SCORM; ?> " ); } else { form.lpath_shortdescription.value = document.adminFormsc_media.lpath_shortdescription.value; form['lp_params[show_in_gradebook]'].value = tmp_sc_gb; form.submit(); } } else { document.adminFormsc_media.lpath_name.value = form.lpath_name.value; if (document.adminFormsc_media.scorm_ftp_file.value == "") { alert( "<?php echo _JLMS_LPATH_CHOOSE_SCORM; ?> " ); } else { document.adminFormsc_media.submit(); } } <?php } else { ?> if (form.lpath_name.value == "") { alert( "<?php echo _JLMS_LPATH_ENTER_NAME; ?> " ); } else { <?php if ($row->id && $row->item_id) { } else { ?> form.lpath_shortdescription.value = document.adminFormsc_media.lpath_shortdescription.value; <?php } ?> form.submit(); } <?php } ?> } } <?php if (!$row->id) { ?> function jlms_dis_forms(elem, type) { if (type == 1 || type == '1') { if (elem.checked) { scorm_upl_type = 1; elem.form.scorm_file.disabled = false; document.adminFormsc_media.scorm_ftp_file.disabled = true; } else { scorm_upl_type = 2; elem.form.scorm_file.disabled = true; document.adminFormsc_media.scorm_ftp_file.disabled = false; } } if (type == 2 || type == '2') { if (elem.checked) { scorm_upl_type = 2; elem.form.scorm_file.disabled = true; document.adminFormsc_media.scorm_ftp_file.disabled = false; } else { scorm_upl_type = 1; elem.form.scorm_file.disabled = false; document.adminFormsc_media.scorm_ftp_file.disabled = true; } } } <?php } elseif ($row->lp_type != 2) { ?> function jlms_dis_forms(elem, type) { if (type == 1 || type == '1') { if (elem.checked) { scorm_upl_type = 1; elem.form.scorm_file.disabled = false; document.adminFormsc.scorm_ftp_file.disabled = true; } else { scorm_upl_type = 2; elem.form.scorm_file.disabled = true; document.adminFormsc.scorm_ftp_file.disabled = false; } } if (type == 2 || type == '2') { if (elem.checked) { scorm_upl_type = 2; elem.form.scorm_file.disabled = true; document.adminFormsc.scorm_ftp_file.disabled = false; } else { scorm_upl_type = 1; elem.form.scorm_file.disabled = false; document.adminFormsc.scorm_ftp_file.disabled = true; } } } <?php } ?> //--><!]]> </script> <?php JLMS_TMPL::OpenMT(); $hparams = array(); JLMS_TMPL::ShowHeader($row->item_id ? 'scorm' : 'lpath', $row->id ? _JLMS_LPATH_EDIT_LPATH : _JLMS_LPATH_NEW_LPATH_FROM_SCORM, $hparams); JLMS_TMPL::OpenTS('', ' valign="top"'); ?> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="adminFormsc" enctype="multipart/form-data"> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_table_no_borders"> <tr> <td align="left" class="contentheading" valign="middle" style="vertical-align:middle "> </td> <td align="right" style="text-align:right "> <?php $toolbar = array(); $toolbar[] = array('btn_type' => 'save', 'btn_js' => "javascript:submitbutton('save_lpath', 'adminFormsc');"); $toolbar[] = array('btn_type' => 'cancel', 'btn_js' => "javascript:submitbutton('cancel_lpath', 'adminFormsc');"); echo JLMS_ShowToolbar($toolbar); ?> </td> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_item_properties"> <tr> <td width="30%"><?php echo _JLMS_ENTER_NAME; ?> <br /></td> <td> <input size="40" class="inputbox" type="text" name="lpath_name" value="<?php echo $row->lpath_name; ?> " /><br /> </td> </tr> <tr <?php if (!$JLMS_CONFIG->get('plugin_forum') || !$JLMS_CONFIG->get('plugin_lpath_forum')) { echo 'style="display:none;"'; } ?> > <td align="left" width="15%" valign="middle" style="vertical-align:middle "> <br /> <?php echo _JLMS_COURSES_ADD_FORUM; ?> </td> <td> <br /> <?php if ($params->get('course_forum_created')) { echo mosHTML::yesnoRadioList("lp_params[add_forum]", 'class="inputbox" ', $lp_params->get('add_forum', 0)); } else { echo _JLMS_CREATE_COURSE_FORUM_FIRST; } ?> </td> </tr> <?php if ($row->lp_type != 2) { ?> <tr> <td colspan="2"> <input id="scorm_upl_type_1" type="radio" name="scorm_upl_type" value="1" checked="checked" <?php if ($row->lp_type != 2) { ?> onchange="jlms_dis_forms(this,1);"<?php } ?> /> <label for="scorm_upl_type_1"><strong><?php echo _JLMS_LPATH_CHOOSE_LOCAL_FILE; ?> </strong></label></td> </tr> <tr> <td><?php echo _JLMS_CHOOSE_FILE; ?> </td> <td> <input size="40" class="inputbox" type="file" name="scorm_file" /> </td> </tr> <tr> <td colspan="2"><input id="scorm_upl_type_2" type="radio" name="scorm_upl_type" value="2" <?php if ($row->lp_type != 2) { ?> onchange="jlms_dis_forms(this,2);" <?php } ?> /> <label for="scorm_upl_type_2"><strong><?php echo _JLMS_LPATH_CHOOSE_FTP_FILE; ?> </strong></label></td> </tr> <?php if ($row->id) { ?> <tr> <td><?php echo _JLMS_CHOOSE_FILE; ?> </td> <td> <input size="40" class="inputbox" type="text" disabled="disabled" name="scorm_ftp_file" /> </td> </tr> <?php } ?> <?php } ?> <?php if ($row->id) { ?> <tr> <td align="left" valign="top" style="vertical-align:top "><br /><?php echo _JLMS_SHORT_DESCRIPTION; ?> </td> <td><br /><textarea class="inputbox" name="lpath_shortdescription" cols="50" rows="3"><?php echo $row->lpath_shortdescription; ?> </textarea></td> </tr> <tr> <td width="30%"><br /> <?php echo _JLMS_LPATH_STATUS_PUB; ?> : </td> <td><br /> <?php echo mosHTML::yesnoRadioList("published", 'class="inputbox" ', $row->published); ?> </td> </tr> <tr> <td><br /><?php echo _JLMS_LPATH_HIDE_RESOURCE; ?> <br /></td> <td><br /> <?php echo mosHTML::yesnoRadioList("lp_params[hide_in_list]", 'class="inputbox" onchange="if (this.checked) { tmp_sc_hid = this.value;}" ', $lp_params->get('hide_in_list', 0)); ?> <br /> </td> </tr> <tr> <td><br /><?php echo _JLMS_SHOW_IN_GRADEBOOK_OPTION; ?> <br /></td> <td><br /> <?php echo mosHTML::yesnoRadioList("lp_params[show_in_gradebook]", 'class="inputbox" onchange="if (this.checked) { tmp_sc_gb = this.value;}" ', $lp_params->get('show_in_gradebook', 1)); ?> <br /> </td> </tr> <tr id="scorm_stage_width_section"<?php if ($params->get('scorm_layout', 0) == 0) { echo ' style="display:none"'; } ?> > <td><br /><?php echo _JLMS_LP_SCORM_DISPLAY_WIDTH; ?> <br /></td> <td><br /> <input size="40" class="inputbox" type="text" name="scorm_width" value="<?php echo $row->scorm_width; ?> " /><br /> </td> </tr> <tr> <td><br /><?php echo _JLMS_LP_SCORM_DISPLAY_HEIGHT; ?> <br /></td> <td><br /> <input size="40" class="inputbox" type="text" name="scorm_height" value="<?php echo $row->scorm_height; ?> " /><br /> </td> </tr> <tr> <td><br /><?php echo _JLMS_LPATH_SCORM_NAV_BAR_OPTION; ?> </td> <td><br /> <select class="inputbox" size="1" name="params[scorm_nav_bar]" onchange="tmp_nb_var = this.value;"> <option<?php if ($params->get('scorm_nav_bar', 0) == 0) { echo ' selected="selected"'; } ?> value="0"><?php echo _JLMS_LP_SCORM_NAV_BAR_HIDE; ?> </option> <option<?php if ($params->get('scorm_nav_bar', 0) == 1) { echo ' selected="selected"'; } ?> value="1"><?php echo _JLMS_LP_SCORM_NAV_BAR_TOP; ?> </option> <option<?php if ($params->get('scorm_nav_bar', 0) == 2) { echo ' selected="selected"'; } ?> value="2"><?php echo _JLMS_LP_SCORM_NAV_BAR_LEFT; ?> </option> </select> </td> </tr> <tr> <td><br /><?php echo _JLMS_LP_SCORM_LAYOUT_TYPE; ?> </td> <td><br /> <select class="inputbox" size="1" name="params[scorm_layout]" onchange="tmp_sl_var = this.value;jlms_change_scorm_stages_view();"> <option<?php if ($params->get('scorm_layout', 0) == 0) { echo ' selected="selected"'; } ?> value="0"><?php echo _JLMS_LP_SCORM_LAYOUT_INLINE; ?> </option> <option<?php if ($params->get('scorm_layout', 0) == 1) { echo ' selected="selected"'; } ?> value="1"><?php echo _JLMS_LP_SCORM_LAYOUT_SBOX; ?> </option> </select> </td> </tr> <tr> <td width="30%" valign="top" style="vertical-align:top "><br /><?php echo _JLMS_IS_TIME_RELATED; ?> </td> <td><br /> <?php JLMS_HTML::_('showperiod.field', $row->is_time_related, $row->show_period, 'adminFormsc'); ?> </td> </tr> <tr> <td colspan="2"> <?php JLMS_course_lpath_html::editLpath_showPrereq($lists, 'adminFormsc', $row->id ? true : false); ?> </td> </tr> <?php } ?> </table> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " /> <input type="hidden" name="task" value="save_lpath" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="course_id" value="<?php echo $course_id; ?> " /> <input type="hidden" name="lpath_type" value="2" /> <input type="hidden" name="scorm_upl_type" value="1" /> <?php if (!$row->id) { ?> <input type="hidden" name="scorm_height" value="<?php echo $row->scorm_height; ?> " /> <input type="hidden" name="is_time_related" value="<?php echo $row->is_time_related; ?> " /> <input type="hidden" name="days" value="0" /> <input type="hidden" name="hours" value="0" /> <input type="hidden" name="mins" value="0" /> <input type="hidden" name="params[scorm_nav_bar]" value="<?php echo $params->get('scorm_nav_bar', 0); ?> " /> <input type="hidden" name="params[scorm_layout]" value="<?php echo $params->get('scorm_layout', 0); ?> " /> <input type="hidden" name="lp_params[show_in_gradebook]" value="<?php echo $lp_params->get('show_in_gradebook', 1); ?> " /> <input type="hidden" name="lp_params[hide_in_list]" value="<?php echo $lp_params->get('hide_in_list', 0); ?> " /> <input type="hidden" name="lp_params[published]" value="0" /> <input type="hidden" name="lpath_shortdescription" value="" /> <?php } ?> </form> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="adminFormsc_media"> <?php if (!$row->id) { ?> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_item_properties"> <tr> <td width="30%"><?php echo _JLMS_CHOOSE_FILE; ?> </td> <td> <input size="40" class="inputbox" type="text" disabled="disabled" name="scorm_ftp_file" /> </td> </tr> <tr> <td align="left" valign="top" style="vertical-align:top "><br /><?php echo _JLMS_SHORT_DESCRIPTION; ?> </td> <td><br /><textarea class="inputbox" name="lpath_shortdescription" cols="50" rows="3"><?php echo $row->lpath_shortdescription; ?> </textarea></td> </tr> <tr> <td width="30%"><br /> <?php echo _JLMS_LPATH_STATUS_PUB; ?> : </td> <td><br /> <?php echo mosHTML::yesnoRadioList("lp_params[published]", 'class="inputbox" onchange="if (this.checked) { tmp_sc_pub = this.value;}" ', $row->published); ?> </td> </tr> <tr> <td><br /><?php echo _JLMS_LPATH_HIDE_RESOURCE; ?> <br /></td> <td><br /> <?php echo mosHTML::yesnoRadioList("lp_params[hide_in_list]", 'class="inputbox" onchange="if (this.checked) { tmp_sc_hid = this.value;}" ', $lp_params->get('hide_in_list', 0)); ?> <br /> </td> </tr> <tr> <td><br /><?php echo _JLMS_SHOW_IN_GRADEBOOK_OPTION; ?> <br /></td> <td><br /> <?php echo mosHTML::yesnoRadioList("lp_params[show_in_gradebook]", 'class="inputbox" onchange="if (this.checked) { tmp_sc_gb = this.value;}" ', $lp_params->get('show_in_gradebook', 1)); ?> <br /> </td> </tr> <tr id="scorm_stage_width_section"<?php if ($params->get('scorm_layout', 0) == 0) { echo ' style="display:none"'; } ?> > <td><br /><?php echo _JLMS_LP_SCORM_DISPLAY_WIDTH; ?> <br /></td> <td><br /> <input size="40" class="inputbox" type="text" name="scorm_width" value="<?php echo $row->scorm_width; ?> " /><br /> </td> </tr> <tr> <td><br /><?php echo _JLMS_LP_SCORM_DISPLAY_HEIGHT; ?> <br /></td> <td><br /> <input size="40" class="inputbox" type="text" name="scorm_height" value="<?php echo $row->scorm_height; ?> " /><br /> </td> </tr> <tr> <td><br /><?php echo _JLMS_LPATH_SCORM_NAV_BAR_OPTION; ?> </td> <td><br /> <select class="inputbox" size="1" name="params[scorm_nav_bar]" onchange="tmp_nb_var = this.value;"> <option<?php if ($params->get('scorm_nav_bar', 0) == 0) { echo ' selected="selected"'; } ?> value="0"><?php echo _JLMS_LP_SCORM_NAV_BAR_HIDE; ?> </option> <option<?php if ($params->get('scorm_nav_bar', 0) == 1) { echo ' selected="selected"'; } ?> value="1"><?php echo _JLMS_LP_SCORM_NAV_BAR_TOP; ?> </option> <option<?php if ($params->get('scorm_nav_bar', 0) == 2) { echo ' selected="selected"'; } ?> value="2"><?php echo _JLMS_LP_SCORM_NAV_BAR_LEFT; ?> </option> </select> </td> </tr> <tr> <td><br /><?php echo _JLMS_LP_SCORM_LAYOUT_TYPE; ?> </td> <td><br /> <select class="inputbox" size="1" name="params[scorm_layout]" onchange="tmp_sl_var = this.value;jlms_change_scorm_stages_view();"> <option<?php if ($params->get('scorm_layout', 0) == 0) { echo ' selected="selected"'; } ?> value="0"><?php echo _JLMS_LP_SCORM_LAYOUT_INLINE; ?> </option> <option<?php if ($params->get('scorm_layout', 0) == 1) { echo ' selected="selected"'; } ?> value="1"><?php echo _JLMS_LP_SCORM_LAYOUT_SBOX; ?> </option> </select> </td> </tr> <tr> <td width="30%" valign="top" style="vertical-align:top "><br /><?php echo _JLMS_IS_TIME_RELATED; ?> </td> <td><br /> <?php JLMS_HTML::_('showperiod.field', $row->is_time_related, $row->show_period, 'adminFormsc_media'); ?> </td> </tr> <tr> <td colspan="2"> <?php JLMS_course_lpath_html::editLpath_showPrereq($lists, 'adminFormsc', $row->id ? true : false); ?> </td> </tr> </table> <?php } ?> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " /> <input type="hidden" name="task" value="save_lpath" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="published" value="0" /> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="course_id" value="<?php echo $course_id; ?> " /> <input type="hidden" name="lpath_type" value="2" /> <input type="hidden" name="lpath_name" value="<?php echo $row->lpath_name; ?> " /> <input type="hidden" name="scorm_upl_type" value="2" /> </form> <?php JLMS_TMPL::CloseTS(); JLMS_TMPL::CloseMT(); }
function showconfig($confightml, &$database, $option) { global $database, $mosConfig_absolute_path, $mosConfig_locale; $row = new mosConfig(); $row->bindGlobals(); // compile list of the languages $langs = array(); // menuitems appears never to be used - so commented out by Martin Brampton 15 Dec 2005 // $menuitems = array(); $language =& new mamboLanguage($mosConfig_locale); $files = $language->getLanguages(); foreach ($files as $file) { $langs[] = mosHTML::makeOption($file->name); } // sort list of languages sort($langs); reset($langs); // compile list of the editors $query = "SELECT id AS value, name AS text" . "\n FROM #__mambots" . "\n WHERE folder='editors' AND published >= 0" . "\n ORDER BY ordering, name"; $database->setQuery($query); $edits = $database->loadObjectList(); $query = "SELECT id" . "\n FROM #__mambots" . "\n WHERE folder='editors' AND published = 1" . "\n LIMIT 1"; $database->setQuery($query); $editor = $database->loadResult(); $lists = array(); // build the html select list $lists['editor'] = mosHTML::selectList($edits, 'editor', 'class="inputbox" size="1"', 'value', 'text', $editor); // build the html select list $lists['lang'] = mosHTML::selectList($langs, 'config_locale', 'class="inputbox" size="1"', 'value', 'text', $row->config_locale); // make a generic -24 - 24 list for ($i = -12; $i <= 12; $i++) { $timeoffset[] = mosHTML::makeOption($i, $i); } // menuitems appears not to be used anywhere - so commented out Martin Brampton 15 Dec 2005 // get list of menuitems // $query = "SELECT id AS value, name AS text FROM #__menu" // . "\n WHERE (type='content_section' OR type='components' OR type='content_typed')" // . "\n AND published=1" // . "\n AND access=0" // . "\n ORDER BY name" // ; // $database->setQuery( $query ); // $menuitems = array_merge( $menuitems, $database->loadObjectList() ); $show_hide = array(mosHTML::makeOption(1, T_('Hide')), mosHTML::makeOption(0, T_('Show'))); $show_hide_r = array(mosHTML::makeOption(0, T_('Hide')), mosHTML::makeOption(1, T_('Show'))); $list_length = array(mosHTML::makeOption(5, 5), mosHTML::makeOption(10, 10), mosHTML::makeOption(15, 15), mosHTML::makeOption(20, 20), mosHTML::makeOption(25, 25), mosHTML::makeOption(30, 30), mosHTML::makeOption(50, 50)); $errors = array(mosHTML::makeOption(-1, T_('System Default')), mosHTML::makeOption(0, T_('None')), mosHTML::makeOption(E_ERROR | E_WARNING | E_PARSE, T_('Simple')), mosHTML::makeOption(E_ALL, T_('Maximum'))); $register_globals = array(mosHTML::makeOption(1, T_('On')), mosHTML::makeOption(0, T_('Off'))); $locale_debug = array(mosHTML::makeOption(1, T_('On')), mosHTML::makeOption(0, T_('Off'))); $locale_use_gettext = array(mosHTML::makeOption(1, T_('Yes')), mosHTML::makeOption(0, T_('No'))); $mailer = array(mosHTML::makeOption('mail', T_('PHP mail function'), true), mosHTML::makeOption('sendmail', T_('Sendmail'), true), mosHTML::makeOption('smtp', T_('SMTP Server'), true)); // build the html select lists $lists['offline'] = mosHTML::yesnoRadioList('config_offline', 'class="inputbox"', $row->config_offline); $lists['auth'] = mosHTML::yesnoRadioList('config_auth', 'class="inputbox"', $row->config_auth); $lists['metaauthor'] = mosHTML::yesnoRadioList('config_metaauthor', 'class="inputbox"', $row->config_metaauthor); $lists['metatitle'] = mosHTML::yesnoRadioList('config_metatitle', 'class="inputbox"', $row->config_metatitle); $lists['useractivation'] = mosHTML::yesnoRadioList('config_useractivation', 'class="inputbox"', $row->config_useractivation); $lists['uniquemail'] = mosHTML::yesnoRadioList('config_uniquemail', 'class="inputbox"', $row->config_uniquemail); $lists['usecaptcha'] = mosHTML::yesnoRadioList('config_use_captcha', 'class="inputbox"', $row->config_use_captcha); $lists['allowuserregistration'] = mosHTML::yesnoRadioList('config_allowUserRegistration', 'class="inputbox"', $row->config_allowUserRegistration); $lists['debug'] = mosHTML::yesnoRadioList('config_debug', 'class="inputbox"', $row->config_debug); $lists['offset'] = mosHTML::selectList($timeoffset, 'config_offset', 'class="inputbox" size="1"', 'value', 'text', $row->config_offset); $lists['hideauthor'] = mosHTML::RadioList($show_hide, 'config_hideauthor', 'class="inputbox"', $row->config_hideauthor, 'value', 'text'); $lists['hidecreate'] = mosHTML::RadioList($show_hide, 'config_hidecreate', 'class="inputbox"', $row->config_hidecreate, 'value', 'text'); $lists['hidemodify'] = mosHTML::RadioList($show_hide, 'config_hidemodify', 'class="inputbox"', $row->config_hidemodify, 'value', 'text'); if (is_writable("{$mosConfig_absolute_path}/media/")) { $lists['hidepdf'] = mosHTML::RadioList($show_hide, 'config_hidepdf', 'class="inputbox"', $row->config_hidepdf, 'value', 'text'); } else { $lists['hidepdf'] = '<input type="hidden" name="config_hidepdf" value="1" /><strong>' . T_('Yes') . '</strong>'; } $lists['hideprint'] = mosHTML::RadioList($show_hide, 'config_hideprint', 'class="inputbox"', $row->config_hideprint, 'value', 'text'); $lists['hideemail'] = mosHTML::RadioList($show_hide, 'config_hideemail', 'class="inputbox"', $row->config_hideemail, 'value', 'text'); $lists['log_items'] = mosHTML::yesnoRadioList('config_enable_log_items', 'class="inputbox"', $row->config_enable_log_items); $lists['log_searches'] = mosHTML::yesnoRadioList('config_enable_log_searches', 'class="inputbox"', $row->config_enable_log_searches); $lists['enable_stats'] = mosHTML::yesnoRadioList('config_enable_stats', 'class="inputbox"', $row->config_enable_stats); $lists['sef'] = mosHTML::yesnoRadioList('config_sef', 'class="inputbox" onclick="javascript: if (document.adminForm.config_sef[1].checked) { alert(\'' . T_('Remember to rename htaccess.txt to .htaccess') . '\') }"', $row->config_sef); $lists['vote'] = mosHTML::RadioList($show_hide_r, 'config_vote', 'class="inputbox"', $row->config_vote, 'value', 'text'); $lists['gzip'] = mosHTML::yesnoRadioList('config_gzip', 'class="inputbox"', $row->config_gzip); $lists['multipage_toc'] = mosHTML::RadioList($show_hide_r, 'config_multipage_toc', 'class="inputbox"', $row->config_multipage_toc, 'value', 'text'); $lists['pagetitles'] = mosHTML::yesnoRadioList('config_pagetitles', 'class="inputbox"', $row->config_pagetitles); $lists['error_reporting'] = mosHTML::selectList($errors, 'config_error_reporting', 'class="inputbox" size="1"', 'value', 'text', $row->config_error_reporting); $lists['register_globals'] = mosHTML::RadioList($register_globals, 'config_register_globals', 'class="inputbox" size="1"', $row->config_register_globals, 'value', 'text'); $lists['locale_debug'] = mosHTML::RadioList($locale_debug, 'config_locale_debug', 'class="inputbox" size="1"', $row->config_locale_debug, 'value', 'text'); $disabled = extension_loaded('gettext') ? '' : 'disabled="disabled" '; $lists['locale_use_gettext'] = mosHTML::RadioList($locale_use_gettext, 'config_locale_use_gettext', $disabled . 'class="inputbox" size="1"', $row->config_locale_use_gettext, 'value', 'text'); $lists['link_titles'] = mosHTML::yesnoRadioList('config_link_titles', 'class="inputbox"', $row->config_link_titles); $lists['caching'] = mosHTML::yesnoRadioList('config_caching', 'class="inputbox"', $row->config_caching); $lists['mailer'] = mosHTML::selectList($mailer, 'config_mailer', 'class="inputbox" size="1"', 'value', 'text', $row->config_mailer); $lists['smtpauth'] = mosHTML::yesnoRadioList('config_smtpauth', 'class="inputbox"', $row->config_smtpauth); $lists['list_length'] = mosHTML::selectList($list_length, 'config_list_limit', 'class="inputbox" size="1"', 'value', 'text', $row->config_list_limit ? $row->config_list_limit : 50); $lists['back_button'] = mosHTML::RadioList($show_hide_r, 'config_back_button', 'class="inputbox"', $row->config_back_button, 'value', 'text'); $lists['item_navigation'] = mosHTML::RadioList($show_hide_r, 'config_item_navigation', 'class="inputbox"', $row->config_item_navigation, 'value', 'text'); $lists['ml_support'] = mosHTML::yesnoRadioList('config_ml_support', 'class="inputbox" onclick="javascript: if (document.adminForm.config_ml_support[1].checked) { alert(\'' . T_('Remember to install the MambelFish component.') . '\') }"', $row->config_ml_support); $lists['readmore'] = mosHTML::RadioList($show_hide_r, 'config_readmore', 'class="inputbox"', $row->config_readmore, 'value', 'text'); $lists['hits'] = mosHTML::RadioList($show_hide_r, 'config_hits', 'class="inputbox"', $row->config_hits, 'value', 'text'); $lists['icons'] = mosHTML::RadioList($show_hide_r, 'config_icons', 'class="inputbox"', $row->config_icons, 'value', 'text'); // $lists['favicon'] = mosHTML::RadioList( $show_hide_r, 'config_icons', 'class="inputbox"', $row->config_icons, 'value', 'text' ); $confightml->showconfig($row, $lists, $option); }
function showCourseSettings(&$teachers_menus, &$students_menus, $option, $id, &$fp_lists, $lists) { global $Itemid, $JLMS_CONFIG, $JLMS_SESSION; $lms_img_path = $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('lms_path_to_images', 'components/com_joomla_lms/lms_images'); // 01.03.2007 iz peremennoy $JLMS_LANGUAGE zagrugayutsa messagi menu dlya otobrageniya //TODO: (low) do not use JLMS_LANG variable here global $JLMS_LANGUAGE; ?> <script language="javascript" type="text/javascript"> <!--//--><![CDATA[//><!-- function submitbutton(pressbutton) { var form = document.adminForm; if (pressbutton == 'cancel_course') { form.task.value = pressbutton; form.submit(); } if (pressbutton == 'settings_save'){ form.task.value = pressbutton; form.submit(); } } function jlms_disable_form_element(){ var form = document.adminForm; elem1 = getObj("params[lpath_redirect]0").checked; elem2 = getObj("params[lpath_redirect]1").checked; elem3_1 = getObj("params[homework_view]0"); elem3_2 = getObj("params[homework_view]1"); elem4_1 = getObj("params[agenda_view]0"); elem4_2 = getObj("params[agenda_view]1"); elem5_1 = getObj("params[dropbox_view]0"); elem5_2 = getObj("params[dropbox_view]1"); elem6_1 = getObj("params[mailbox_view]0"); elem6_2 = getObj("params[mailbox_view]1"); elem7_1 = getObj("params[certificates_view]0"); elem7_2 = getObj("params[certificates_view]1"); elem8_1 = getObj("params[latest_forum_posts_view]0"); elem8_2 = getObj("params[latest_forum_posts_view]1"); elem_select = form["params[learn_path]"]; if (elem1 == true){ elem_select.disabled = true; <?php if ($JLMS_CONFIG->get('course_homework')) { ?> elem3_1.disabled = false; elem3_2.disabled = false; <?php } ?> elem4_1.disabled = false; elem4_2.disabled = false; elem5_1.disabled = false; elem5_2.disabled = false; elem6_1.disabled = false; elem6_2.disabled = false; elem7_1.disabled = false; elem7_2.disabled = false; elem8_1.disabled = false; elem8_2.disabled = false; }else{ elem_select.disabled = false; <?php if ($JLMS_CONFIG->get('course_homework')) { ?> elem3_1.disabled = true; elem3_2.disabled = true; <?php } ?> elem4_1.disabled = true; elem4_2.disabled = true; elem5_1.disabled = true; elem5_2.disabled = true; elem6_1.disabled = true; elem6_2.disabled = true; elem7_1.disabled = true; elem7_2.disabled = true; elem8_1.disabled = true; elem8_2.disabled = true; } } //--><!]]> </script> <?php JLMS_TMPL::OpenMT(); $params = array(); $params['show_menu'] = false; $toolbar = array(); $toolbar[] = array('btn_type' => 'save', 'btn_js' => "javascript:submitbutton('settings_save');"); $toolbar[] = array('btn_type' => 'back', 'btn_js' => "javascript:submitbutton('cancel_course');"); $params['toolbar'] = $toolbar; JLMS_TMPL::ShowHeader('course', _JLMS_COURSES_TITLE_SETTINGS_COURSE . ' [ ' . $JLMS_CONFIG->get('course_name') . ' ] ', $params); JLMS_TMPL::OpenTS(); ?> <form action="<?php echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}"); ?> " method="post" name="adminForm"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td align="left" colspan="2" class="sectiontableheader" style="height:30px"> <?php echo _JLMS_COURSE_TRACK_SET_TITLE; ?> </td> </tr> <tr class="sectiontableentry1"> <td width="50%"> <strong><?php echo _JLMS_COURSE_TRACK_TYPE_STR; ?> </strong> </td> <td align="left"> <?php echo $fp_lists['track_type']; ?> </td> </tr> <tr><td colspan="2"><br /></td></tr> <?php if ($JLMS_CONFIG->get('enable_conference_booking', false)) { ?> <tr> <td align="left" colspan="2" class="sectiontableheader" style="height:30px"> <?php echo 'Booking'; ?> </td> </tr> <tr class="sectiontableentry1"> <td width="50%"> <strong><?php echo 'Enable conference booking'; ?> </strong> </td> <td align="left"> <?php echo $fp_lists['conf_book']; ?> </td> </tr> <tr><td colspan="2"><br /></td></tr> <?php } ?> <tr> <td align="left" colspan="2" class="sectiontableheader" style="height:30px"> <?php echo _JLMS_COURSEHOME_TITLE; ?> </td> </tr> <tr class="sectiontableentry1"> <td width="50%"> <strong><?php echo _JLMS_COURSEHOME_LP_REDIRECT; ?> </strong> </td> <td align="left"> <?php echo $fp_lists['lpath_redirect']; ?> </td> </tr> <tr class="sectiontableentry2"> <td width="50%"> </td> <td align="left"> <?php echo $fp_lists['learn_path']; ?> </td> </tr> <tr class="sectiontableentry1"> <td> <strong><?php echo _JLMS_COURSES_SHOW_DESC_FOR_LEARNERS; ?> </strong> </td> <td> <?php echo $fp_lists['show_description']; ?> </td> </tr> <tr class="sectiontableentry2"> <td> <strong><?php echo _JLMS_COURSEHOME_HW_MODULE_VIEW; ?> </strong> <?php if (!$JLMS_CONFIG->get('course_homework')) { echo "*"; } ?> </td> <td> <?php echo $fp_lists['homework_view']; ?> </td> </tr> <tr class="sectiontableentry1"> <td> <strong><?php echo _JLMS_COURSEHOME_AG_MODULE_VIEW; ?> </strong> </td> <td> <?php echo $fp_lists['agenda_view']; ?> </td> </tr> <tr class="sectiontableentry2"> <td> <strong><?php echo _JLMS_COURSEHOME_DP_MODULE_VIEW; ?> </strong> </td> <td> <?php echo $fp_lists['dropbox_view']; ?> </td> </tr> <tr class="sectiontableentry1"> <td> <strong><?php echo _JLMS_COURSEHOME_MB_MODULE_VIEW; ?> </strong> </td> <td> <?php echo $fp_lists['mailbox_view']; ?> </td> </tr> <tr class="sectiontableentry2"> <td> <strong><?php echo _JLMS_COURSEHOME_CRT_MODULE_VIEW; ?> </strong> </td> <td> <?php echo $fp_lists['certificates_view']; ?> </td> </tr> <tr class="sectiontableentry1"> <td> <strong><?php echo _JLMS_COURSEHOME_LFP_MODULE_VIEW; ?> </strong> </td> <td> <?php echo $fp_lists['latest_forum_posts_view']; ?> </td> </tr> <?php if ($JLMS_CONFIG->get('flms_integration', 0)) { ?> <tr class="sectiontableentry2"> <td> <strong><?php define('_JLMS_COURSEHOME_SHOW_IN_REPORTS', "Show in reports"); echo _JLMS_COURSEHOME_SHOW_IN_REPORTS; ?> </strong> </td> <td> <?php echo $fp_lists['show_in_report']; ?> </td> </tr> <?php } ?> <tr> <td align="left" colspan="2" class="sectiontableheader" style="height:30px"> <?php echo _JLMS_COURSES_OTHER_SETTINGS; ?> </td> </tr> <?php //Course Properties Event// if (isset($lists['plugin_return']) && count($lists['plugin_return'])) { $fields = $lists['plugin_return']; $k = 1; foreach ($fields as $field) { ?> <tr class="sectiontableentry<?php echo $k; ?> "> <td> <strong><?php echo $field->name; ?> </strong> </td> <td> <?php echo $field->control; ?> </td> </tr> <?php $k = 3 - $k; } } //Course Properties Event// ?> <tr class="sectiontableentry1" <?php echo !$JLMS_CONFIG->get('max_attendees_change', 0) ? 'style="display:none"' : ''; ?> > <td width="50%"><?php echo _JLMS_COURSES_MAX_ATTENDEES; ?> </td> <td><?php echo $fp_lists['max_attendees']; ?> </td> </tr> <tr> <td width="50%" height="100%" valign="top" align="right" style="padding:2px;"><br /> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="contentpane"> <tr> <td class="contentheading" colspan="4" align="left" style="height:30px"><?php echo _JLMS_COURSES_MENU_TEACHERS; ?> </td> </tr> <tr> <td width="1%" align="center" class="sectiontableheader"> # </td> <td width="5%" align="center" class="sectiontableheader"> </td> <td align="left" class="sectiontableheader"> <?php echo _JLMS_COURSES_MENU_ITEM; ?> </td> <td align="left" class="sectiontableheader"> <?php echo _JLMS_COURSES_MENU_ENABLED; ?> </td> </tr> <?php $i = 1; $k = 1; $add_tracking = $JLMS_CONFIG->get('tracking_enable'); $add_quiz = $JLMS_CONFIG->get('plugin_quiz'); $add_chat = $JLMS_CONFIG->get('chat_enable') && $JLMS_CONFIG->get('course_chat'); $add_forum = $JLMS_CONFIG->get('plugin_forum') && $JLMS_CONFIG->get('course_forum'); $add_conference = $JLMS_CONFIG->get('conference_enable'); $add_hw = $JLMS_CONFIG->get('course_homework'); $add_attend = $JLMS_CONFIG->get('course_attendance'); foreach ($teachers_menus as $menu) { $disabled = 1; //global $glob_dis = ''; if ($menu->disabled) { $disabled = 0; } if ($menu->lang_var == '_JLMS_TOOLBAR_QUIZZES' && !$add_quiz) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } elseif ($menu->lang_var == '_JLMS_TOOLBAR_HOMEWORK' && !$add_hw) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } elseif ($menu->lang_var == '_JLMS_TOOLBAR_ATTEND' && !$add_attend) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } elseif ($menu->lang_var == '_JLMS_TOOLBAR_FORUM' && !$add_forum) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } elseif ($menu->lang_var == '_JLMS_TOOLBAR_CHAT' && !$add_chat) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } elseif ($menu->lang_var == '_JLMS_TOOLBAR_CONF' && !$add_conference) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } elseif ($menu->lang_var == '_JLMS_TOOLBAR_TRACK' && !$add_tracking) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } if (!$menu->published) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } $enabled = mosHTML::yesnoRadioList('enabled_' . $menu->user_access . "_" . $menu->id, "class='inputbox' " . $glob_dis, $disabled, _JLMS_COURSES_MENU_SHOW, _JLMS_COURSES_MENU_HIDE); ?> <tr class="<?php echo "sectiontableentry{$k}"; ?> "> <td align="center"><?php echo $i; ?> </td> <td style="height:25px" align="left"> <?php $menu_lang_var = $menu->lang_var && isset($JLMS_LANGUAGE[$menu->lang_var]) ? $JLMS_LANGUAGE[$menu->lang_var] : ''; if ($menu->lang_var && defined($menu->lang_var)) { if (constant($menu->lang_var)) { $menu_lang_var = constant($menu->lang_var); } } if ($menu->is_separator) { echo "---"; } else { echo "<img src='" . $lms_img_path . "/toolbar/" . $menu->image . "' alt='" . $menu_lang_var . "' width='16' height = '16' />"; } ?> </td> <td align="left" > <?php if ($menu->is_separator == 1) { echo _JLMS_SEPARATOR; } else { echo $menu_lang_var; if ($glob_dis) { echo " <sup style='font-size:10px;'>*</sup> "; } } $i++; ?> </td> <td align="left" nowrap='nowrap'> <?php echo $enabled; ?> </td> </tr> <?php $k = 3 - $k; } ?> </table> </td> <td width="50%" height="100%" valign="top" style="padding:2px;"><br /> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="contentpane"> <tr> <td class="contentheading" colspan="4" style="height:30px"><?php echo _JLMS_COURSES_MENU_STUDENTS; ?> </td> </tr> <tr> <td width="1%" class="sectiontableheader" align="center" style="text-align:center "> # </td> <td width="5%" class="sectiontableheader" align="center" > </td> <td align="left" class="sectiontableheader"> <?php echo _JLMS_COURSES_MENU_ITEM; ?> </td> <td align="left" class="sectiontableheader"> <?php echo _JLMS_COURSES_MENU_ENABLED; ?> </td> </tr> <?php $very_glob_dis = 0; $i = 1; $k = 1; foreach ($students_menus as $menu) { $disabled = 1; //global $glob_dis = ''; if ($menu->disabled) { $disabled = 0; } if ($menu->lang_var == '_JLMS_TOOLBAR_QUIZZES' && !$add_quiz) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } elseif ($menu->lang_var == '_JLMS_TOOLBAR_HOMEWORK' && !$add_hw) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } elseif ($menu->lang_var == '_JLMS_TOOLBAR_ATTEND' && !$add_attend) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } elseif ($menu->lang_var == '_JLMS_TOOLBAR_FORUM' && !$add_forum) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } elseif ($menu->lang_var == '_JLMS_TOOLBAR_CHAT' && !$add_chat) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } elseif ($menu->lang_var == '_JLMS_TOOLBAR_CONF' && !$add_conference) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } elseif ($menu->lang_var == '_JLMS_TOOLBAR_TRACK' && !$add_tracking) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } if (!$menu->published) { $glob_dis = 'disabled="disabled"'; $disabled = 0; } $enabled = mosHTML::yesnoRadioList('enabled_' . $menu->user_access . "_" . $menu->id, "class='inputbox' " . $glob_dis, $disabled, _JLMS_COURSES_MENU_SHOW, _JLMS_COURSES_MENU_HIDE); ?> <tr class="<?php echo "sectiontableentry{$k}"; ?> "> <td align="center"><?php echo $i; ?> </td> <td style='height:25px' align="left" > <?php $menu_lang_var = $menu->lang_var && isset($JLMS_LANGUAGE[$menu->lang_var]) ? $JLMS_LANGUAGE[$menu->lang_var] : ''; if ($menu->lang_var && defined($menu->lang_var)) { if (constant($menu->lang_var)) { $menu_lang_var = constant($menu->lang_var); } } if ($menu->is_separator) { echo "---"; } else { echo "<img src='" . $lms_img_path . "/toolbar/" . $menu->image . "' alt='" . $menu_lang_var . "' width='16' height = '16' />"; } echo "</td><td align='left'>"; if ($menu->is_separator == 1) { echo "Separator"; } else { echo $menu_lang_var; if ($glob_dis) { $very_glob_dis = 1; echo " <sup style='font-size:10px;'>*</sup> "; } } $i++; echo "</td>"; echo "<td align='left' nowrap='nowrap'>" . $enabled . "</td></tr>"; $k = 3 - $k; } ?> </table> </td> </tr> <?php if ($very_glob_dis) { ?> <tr> <td align="left" colspan="2"><hr />* <?php echo _JLMS_COURSES_MENU_INFO; ?> </td> </tr> <?php } ?> <?php if ($JLMS_CONFIG->get('show_course_spec_property', 1) == 1) { ?> <tr> <td colspan="2"><br /></td> </tr> <tr> <td colspan="2" class="sectiontableheader"> <?php echo _JLMS_COURSES_REG_QUESTIONS; ?> </td> </tr> <?php global $JLMS_DB; $rowc = new mos_Joomla_LMS_Course($JLMS_DB); $rowc->load($id); $lists['spec_reg'] = mosHTML::yesnoRadioList('spec_reg', 'class="inputbox" onchange="jlms_change_spec_reg_quest(this);" ', $rowc->spec_reg); ?> <tr class="sectiontableentry1"> <td><?php echo _JLMS_COURSES_SPEC_REG; ?> </td> <td><?php echo $lists['spec_reg']; ?> </td> </tr> <tr> <td colspan="2"><div id="SpecRegOptions" style="width:100%<?php echo $rowc->spec_reg ? '' : ';visibility:hidden;display:none;'; ?> "> <script language="javascript" type="text/javascript"> <!-- function jlms_change_spec_reg_quest(elem) { ttt = getObj('SpecRegOptions'); if (elem.checked) { if (elem.value == 1) { ttt.style.visibility = 'visible'; ttt.style.display = ''; } else { ttt.style.visibility = 'hidden'; ttt.style.display = 'none'; } } else { if (elem.value == 0) { ttt.style.visibility = 'hidden'; ttt.style.display = 'none'; } else { ttt.style.visibility = 'visible'; ttt.style.display = ''; } } } function ReAnalize_tbl_Rows( start_index, tbl_id ) { start_index = 1; var tbl_elem = getObj(tbl_id); if (tbl_elem.rows[start_index]) { var count = start_index; var row_k = 2 - start_index%2;//0; for (var i=start_index; i<tbl_elem.rows.length; i++) { tbl_elem.rows[i].cells[0].innerHTML = count; if (i > 1) { tbl_elem.rows[i].cells[6].innerHTML = '<a href="javascript: void(0);" onclick="javascript:Up_tbl_row(this); return false;" title="<?php echo _JLMS_MOVEUP; ?> "><img src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_uparrow.png" width="16" height="16" border="0" alt="<?php echo _JLMS_MOVEUP; ?> " /></a>'; } else { tbl_elem.rows[i].cells[6].innerHTML = ' '; } if (i < (tbl_elem.rows.length - 1)) { tbl_elem.rows[i].cells[7].innerHTML = '<a href="javascript: void(0);" onclick="javascript:Down_tbl_row(this); return false;" title="<?php echo _JLMS_MOVEDOWN; ?> "><img src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_downarrow.png" width="16" height="16" border="0" alt="<?php echo _JLMS_MOVEDOWN; ?> " /></a>';; } else { tbl_elem.rows[i].cells[7].innerHTML = ' '; } tbl_elem.rows[i].className = 'sectiontableentry'+row_k; count++; row_k = 3 - row_k; } } } function Delete_tbl_row(element) { var del_index = element.parentNode.parentNode.sectionRowIndex; var tbl_id = element.parentNode.parentNode.parentNode.parentNode.id; element.parentNode.parentNode.parentNode.deleteRow(del_index); ReAnalize_tbl_Rows(del_index - 1, tbl_id); } function Up_tbl_row(element) { if (element.parentNode.parentNode.sectionRowIndex > 1) { var sec_indx = element.parentNode.parentNode.sectionRowIndex; var table = element.parentNode.parentNode.parentNode; var tbl_id = table.parentNode.id; var cell1 = document.createElement("td"); cell1.align = 'center'; var row = table.insertRow(sec_indx - 1); row.appendChild(cell1); row.appendChild(element.parentNode.parentNode.cells[1]); row.appendChild(element.parentNode.parentNode.cells[1]); row.appendChild(element.parentNode.parentNode.cells[1]); row.appendChild(element.parentNode.parentNode.cells[1]); element.parentNode.parentNode.parentNode.deleteRow(element.parentNode.parentNode.sectionRowIndex); var cell3 = document.createElement("td"); var cell4 = document.createElement("td"); var cell5 = document.createElement("td"); var cell6 = document.createElement("td"); cell3.innerHTML = '<a href="javascript: void(0);" onclick="javascript:Delete_tbl_row(this); return false;" title="Delete"><img src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_cancel.png" width="16" height="16" border="0" alt="Delete" /></a>'; cell4.innerHTML = '<a href="javascript: void(0);" onclick="javascript:Up_tbl_row(this); return false;" title="<?php echo _JLMS_MOVEUP; ?> "><img src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_uparrow.png" width="16" height="16" border="0" alt="<?php echo _JLMS_MOVEUP; ?> " /></a>'; cell5.innerHTML = ' '; cell6.innerHTML = ' '; row.appendChild(cell3); row.appendChild(cell4); row.appendChild(cell5); row.appendChild(cell6); ReAnalize_tbl_Rows(sec_indx - 2, tbl_id); } } function Down_tbl_row(element) { if (element.parentNode.parentNode.sectionRowIndex < element.parentNode.parentNode.parentNode.rows.length - 1) { var sec_indx = element.parentNode.parentNode.sectionRowIndex; var table = element.parentNode.parentNode.parentNode; var tbl_id = table.parentNode.id; var cell1 = document.createElement("td"); cell1.align = 'center'; var row = table.insertRow(sec_indx + 2); row.appendChild(cell1); row.appendChild(element.parentNode.parentNode.cells[1]); row.appendChild(element.parentNode.parentNode.cells[1]); row.appendChild(element.parentNode.parentNode.cells[1]); row.appendChild(element.parentNode.parentNode.cells[1]); element.parentNode.parentNode.parentNode.deleteRow(element.parentNode.parentNode.sectionRowIndex); var cell3 = document.createElement("td"); var cell4 = document.createElement("td"); var cell5 = document.createElement("td"); var cell6 = document.createElement("td"); cell3.innerHTML = '<a href="javascript: void(0);" onclick="javascript:Delete_tbl_row(this); return false;" title="Delete"><img src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_cancel.png" width="16" height="16" border="0" alt="Delete" /></a>'; cell4.innerHTML = '<a href="javascript: void(0);" onclick="javascript:Up_tbl_row(this); return false;" title="<?php echo _JLMS_MOVEUP; ?> "><img src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_uparrow.png" width="16" height="16" border="0" alt="<?php echo _JLMS_MOVEUP; ?> " /></a>'; cell5.innerHTML = ' '; cell6.innerHTML = ' '; row.appendChild(cell3); row.appendChild(cell4); row.appendChild(cell5); row.appendChild(cell6); ReAnalize_tbl_Rows(sec_indx, tbl_id); } } function analyze_change_check(e) { if (!e) { e = window.event;} var cat2=e.target?e.target:e.srcElement; analyze_change_check2(cat2); } function analyze_change_check2(check_element) { var td_element = check_element.parentNode; var is_check = check_element.checked; if (td_element.hasChildNodes()) { var children = td_element.childNodes; for (var i = 0; i < children.length; i++) { if (children[i].nodeName.toLowerCase() == 'input') { var inp_type = children[i].type; if (inp_type.toLowerCase() == 'hidden') { children[i].value = is_check ? '1' : '0' } } } } } function Add_new_tbl_field(elem_field, check_opt_field, elem_def_field, tbl_id, field_name, field_name2, filed_name_da, field_name3, field_name4) { var new_element_txt = getObj(elem_field).value; var new_element_def_ans = getObj(elem_def_field).value; if (trim(new_element_txt) == '') { alert("Please enter text to the field.");return; } var is_check = getObj(check_opt_field).checked; getObj(elem_field).value = ''; getObj(elem_def_field).value = ''; var tbl_elem = getObj(tbl_id); var row = tbl_elem.insertRow(tbl_elem.rows.length); var cell1 = document.createElement("td"); var cell1a = document.createElement("td"); var cell2 = document.createElement("td"); var cell2a = document.createElement("td"); var cell2b = document.createElement("td"); var cell3 = document.createElement("td"); var cell4 = document.createElement("td"); var cell5 = document.createElement("td"); var cell6 = document.createElement("td"); var input_hidden = document.createElement("input"); input_hidden.type = "hidden"; input_hidden.name = field_name; input_hidden.value = '0'; var input_check = document.createElement("input"); input_check.type = "checkbox"; input_check.name = field_name3; input_check.value = '1'; input_check.checked = is_check; input_check.onchange=input_check.onclick = new Function('analyze_change_check2(this)'); var input_check_hid = document.createElement("input"); input_check_hid.type = "hidden"; input_check_hid.name = field_name4; input_check_hid.value = is_check?'1':'0'; var input_text = document.createElement("input"); input_text.type = "text"; input_text.size = 30; input_text.name = field_name2; input_text.value = new_element_txt; var input_text_da = document.createElement("input"); input_text_da.type = "text"; input_text_da.size = 20; input_text_da.name = filed_name_da; input_text_da.value = new_element_def_ans; cell1.align = 'center'; cell1.innerHTML = 0; cell1a.align = 'center'; cell1a.innerHTML = 0; cell2.appendChild(input_hidden); cell2.appendChild(input_text); cell2a.appendChild(input_check); cell2a.appendChild(input_check_hid); cell2b.appendChild(input_text_da); cell3.innerHTML = '<a href="javascript: void(0);" onclick="javascript:Delete_tbl_row(this); return false;" title="Delete"><img src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_cancel.png" width="16" height="16" border="0" alt="Delete" /></a>'; cell4.innerHTML = '<a href="javascript: void(0);" onclick="javascript:Up_tbl_row(this); return false;" title="<?php echo _JLMS_MOVEUP; ?> "><img src="<?php echo $JLMS_CONFIG->get('live_site'); ?> /components/com_joomla_lms/lms_images/toolbar/btn_uparrow.png" width="16" height="16" border="0" alt="<?php echo _JLMS_MOVEUP; ?> " /></a>'; cell5.innerHTML = ' '; cell6.innerHTML = ' '; row.appendChild(cell1); row.appendChild(cell1a); row.appendChild(cell2); row.appendChild(cell2a); row.appendChild(cell2b); row.appendChild(cell3); row.appendChild(cell4); row.appendChild(cell5); row.appendChild(cell6); ReAnalize_tbl_Rows(tbl_elem.rows.length - 2, tbl_id); } function jlms_changeSRegDefaultValue(element, form_suffix) { var form = element.form; var is_dis = element.checked; form['new_field_left_'+form_suffix].disabled = is_dis; form['new_field_optional_'+form_suffix].disabled = is_dis; form['add_new_field_'+form_suffix].disabled = is_dis; form['new_field_def_'+form_suffix].disabled = is_dis; var ca_Item = form['course_question_'+form_suffix+'[]']; if (ca_Item) { if (ca_Item.length) { var i; for (i = 0; i<ca_Item.length; i++) { ca_Item[i].disabled = is_dis; } } else { ca_Item.disabled = is_dis; } } var cb_Item = form['course_question_id_'+form_suffix+'[]']; if (cb_Item) { if (cb_Item.length) { var i; for (i = 0; i<cb_Item.length; i++) { cb_Item[i].disabled = is_dis; } } else { cb_Item.disabled = is_dis; } } var cc_Item = form['course_quest_optional_hid_'+form_suffix+'[]']; if (cc_Item) { if (cc_Item.length) { var i; for (i = 0; i<cc_Item.length; i++) { cc_Item[i].disabled = is_dis; } } else { cc_Item.disabled = is_dis; } } var cd_Item = form['course_quest_optional_'+form_suffix+'[]']; if (cd_Item) { if (cd_Item.length) { var i; for (i = 0; i<cd_Item.length; i++) { cd_Item[i].disabled = is_dis; } } else { cd_Item.disabled = is_dis; } } var ce_Item = form['course_quest_def_answer_'+form_suffix+'[]']; if (ce_Item) { if (ce_Item.length) { var i; for (i = 0; i<ce_Item.length; i++) { ce_Item[i].disabled = is_dis; } } else { ce_Item.disabled = is_dis; } } } //--> </script> <?php $JLMS_ACL =& JLMSFactory::getACL(); $lroles = $JLMS_ACL->GetSystemRoles(1); global $JLMS_DB; $row = null; $query = "SELECT * FROM #__lms_spec_reg_questions WHERE course_id = {$id} AND role_id = 0 ORDER BY ordering"; $JLMS_DB->SetQuery($query); $rows = $JLMS_DB->LoadObjectList(); $query = "SELECT * FROM #__lms_spec_reg_questions WHERE course_id = {$id} AND role_id <> 0 ORDER BY role_id, ordering"; $JLMS_DB->SetQuery($query); $rows_add = $JLMS_DB->LoadObjectList(); //if (count($lroles) > 1) { // temporary commented by DEN (13.April 2009) if (false) { $tabs = new JLMSTabs(0); echo $tabs->startPane("JLMS"); echo $tabs->startTab('Default', "jlmsroletab_0"); JLMS_course_html::JLMS_SpecQuestions_OneRole($rows); echo $tabs->endTab(); foreach ($lroles as $lrole) { echo $tabs->startTab($lrole->lms_usertype, "jlmsroletab_" . $lrole->id); $is_show = false; if (!empty($rows_add)) { $role_rows = array(); foreach ($rows_add as $rac) { if ($rac->role_id == $lrole->id) { $role_rows[] = $rac; } } if (!empty($role_rows)) { JLMS_course_html::JLMS_SpecQuestions_OneRole($role_rows, $lrole->id, false); $is_show = true; } } if (!$is_show) { JLMS_course_html::JLMS_SpecQuestions_OneRole($rows, $lrole->id, true); } echo $tabs->endTab(); } echo $tabs->endPane(); } else { JLMS_course_html::JLMS_SpecQuestions_OneRole($rows); } ?> </div> </td> </tr> <?php } /* end of 'if($JLMS_CONFIG->get('show_course_spec_property'.....*/ ?> </table> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="id" value="<?php echo $id; ?> " /> <input type="hidden" name="task" value="settings_save" /> <input type="hidden" name="is_inside" value="1" /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " /> </form> <?php JLMS_TMPL::CloseTS(); JLMS_TMPL::CloseMT(); }
function showconfig($confightml, &$database, $option) { global $database, $mosConfig_absolute_path, $adminLanguage; $row = new mosConfig(); $row->bindGlobals(); // compile list of the languages $langs = array(); $alangs = array(); $menuitems = array(); if ($handle = opendir("{$mosConfig_absolute_path}/language/")) { $i = 0; while (false !== ($file = readdir($handle))) { if (!strcasecmp(substr($file, -4), ".php") && $file != "." && $file != ".." && strcasecmp(substr($file, -11), ".ignore.php") && strcasecmp(substr($file, 0, 6), "admin_")) { $langs[] = mosHTML::makeOption(substr($file, 0, -4)); } if (!strcasecmp(substr($file, 0, 6), "admin_")) { $alangs[] = mosHTML::makeOption(substr(substr($file, 6), 0, -4)); } } } // sort list of languages sort($langs); reset($langs); sort($alangs); reset($alangs); // compile list of the editors $query = "SELECT id AS value, name AS text" . "\n FROM #__mambots" . "\n WHERE folder='editors' AND published >= 0" . "\n ORDER BY ordering, name"; $database->setQuery($query); $edits = $database->loadObjectList(); $query = "SELECT id" . "\n FROM #__mambots" . "\n WHERE folder='editors' AND published = 1" . "\n LIMIT 1"; $database->setQuery($query); $editor = $database->loadResult(); $lists = array(); // build the html select list $lists['editor'] = mosHTML::selectList($edits, 'editor', 'class="inputbox" size="1"', 'value', 'text', $editor); // build the html select list $lists['lang'] = mosHTML::selectList($langs, 'config_lang', 'class="inputbox" size="1"', 'value', 'text', $row->config_lang); //adminLanguage select language $lists['alang'] = mosHTML::selectList($alangs, 'config_alang', 'class="inputbox" size="1"', 'value', 'text', $row->config_alang); // make a generic -24 - 24 list for ($i = -24; $i <= 24; $i++) { $timeoffset[] = mosHTML::makeOption($i, $i); } // get list of menuitems $query = "SELECT id AS value, name AS text FROM #__menu" . "\n WHERE (type='content_section' OR type='components' OR type='content_typed')" . "\n AND published=1" . "\n AND access=0" . "\n ORDER BY name"; $database->setQuery($query); $menuitems = array_merge($menuitems, $database->loadObjectList()); $show_hide = array(mosHTML::makeOption(1, $adminLanguage->A_COMP_CONF_HIDE), mosHTML::makeOption(0, $adminLanguage->A_COMP_CONF_SHOW)); $show_hide_r = array(mosHTML::makeOption(0, $adminLanguage->A_COMP_CONF_HIDE), mosHTML::makeOption(1, $adminLanguage->A_COMP_CONF_SHOW)); $list_length = array(mosHTML::makeOption(5, 5), mosHTML::makeOption(10, 10), mosHTML::makeOption(15, 15), mosHTML::makeOption(20, 20), mosHTML::makeOption(25, 25), mosHTML::makeOption(30, 30), mosHTML::makeOption(50, 50)); $errors = array(mosHTML::makeOption(-1, $adminLanguage->A_COMP_CONF_DEFAULT), mosHTML::makeOption(0, $adminLanguage->A_COMP_NONE), mosHTML::makeOption(E_ERROR | E_WARNING | E_PARSE, $adminLanguage->A_COMP_CONF_SIMPLE), mosHTML::makeOption(E_ALL, $adminLanguage->A_COMP_CONF_MAX)); $mailer = array(mosHTML::makeOption('mail', $adminLanguage->A_COMP_CONF_MAIL_FC, true), mosHTML::makeOption('sendmail', $adminLanguage->A_COMP_CONF_SEND, true), mosHTML::makeOption('smtp', $adminLanguage->A_COMP_CONF_SMTP, true)); // build the html select lists $lists['offline'] = mosHTML::yesnoRadioList('config_offline', 'class="inputbox"', $row->config_offline); $lists['auth'] = mosHTML::yesnoRadioList('config_auth', 'class="inputbox"', $row->config_auth); $lists['metaauthor'] = mosHTML::yesnoRadioList('config_metaauthor', 'class="inputbox"', $row->config_metaauthor); $lists['metatitle'] = mosHTML::yesnoRadioList('config_metatitle', 'class="inputbox"', $row->config_metatitle); $lists['useractivation'] = mosHTML::yesnoRadioList('config_useractivation', 'class="inputbox"', $row->config_useractivation); $lists['uniquemail'] = mosHTML::yesnoRadioList('config_uniquemail', 'class="inputbox"', $row->config_uniquemail); $lists['allowuserregistration'] = mosHTML::yesnoRadioList('config_allowUserRegistration', 'class="inputbox"', $row->config_allowUserRegistration); $lists['debug'] = mosHTML::yesnoRadioList('config_debug', 'class="inputbox"', $row->config_debug); $lists['offset'] = mosHTML::selectList($timeoffset, 'config_offset', 'class="inputbox" size="1"', 'value', 'text', $row->config_offset); $lists['hideauthor'] = mosHTML::RadioList($show_hide, 'config_hideauthor', 'class="inputbox"', $row->config_hideauthor, 'value', 'text'); $lists['hidecreate'] = mosHTML::RadioList($show_hide, 'config_hidecreate', 'class="inputbox"', $row->config_hidecreate, 'value', 'text'); $lists['hidemodify'] = mosHTML::RadioList($show_hide, 'config_hidemodify', 'class="inputbox"', $row->config_hidemodify, 'value', 'text'); if (is_writable("{$mosConfig_absolute_path}/media/")) { $lists['hidepdf'] = mosHTML::RadioList($show_hide, 'config_hidepdf', 'class="inputbox"', $row->config_hidepdf, 'value', 'text'); } else { $lists['hidepdf'] = '<input type="hidden" name="config_hidepdf" value="1" /><strong>Yes</strong>'; } $lists['hideprint'] = mosHTML::RadioList($show_hide, 'config_hideprint', 'class="inputbox"', $row->config_hideprint, 'value', 'text'); $lists['hideemail'] = mosHTML::RadioList($show_hide, 'config_hideemail', 'class="inputbox"', $row->config_hideemail, 'value', 'text'); $lists['log_items'] = mosHTML::yesnoRadioList('config_enable_log_items', 'class="inputbox"', $row->config_enable_log_items); $lists['log_searches'] = mosHTML::yesnoRadioList('config_enable_log_searches', 'class="inputbox"', $row->config_enable_log_searches); $lists['enable_stats'] = mosHTML::yesnoRadioList('config_enable_stats', 'class="inputbox"', $row->config_enable_stats); $lists['sef'] = mosHTML::yesnoRadioList('config_sef', 'class="inputbox" onclick="javascript: if (document.adminForm.config_sef[1].checked) { alert(\'Remember to rename htaccess.txt to .htaccess\') }"', $row->config_sef); $lists['vote'] = mosHTML::RadioList($show_hide_r, 'config_vote', 'class="inputbox"', $row->config_vote, 'value', 'text'); $lists['gzip'] = mosHTML::yesnoRadioList('config_gzip', 'class="inputbox"', $row->config_gzip); $lists['multipage_toc'] = mosHTML::RadioList($show_hide_r, 'config_multipage_toc', 'class="inputbox"', $row->config_multipage_toc, 'value', 'text'); $lists['pagetitles'] = mosHTML::yesnoRadioList('config_pagetitles', 'class="inputbox"', $row->config_pagetitles); $lists['error_reporting'] = mosHTML::selectList($errors, 'config_error_reporting', 'class="inputbox" size="1"', 'value', 'text', $row->config_error_reporting); $lists['link_titles'] = mosHTML::yesnoRadioList('config_link_titles', 'class="inputbox"', $row->config_link_titles); $lists['caching'] = mosHTML::yesnoRadioList('config_caching', 'class="inputbox"', $row->config_caching); $lists['mailer'] = mosHTML::selectList($mailer, 'config_mailer', 'class="inputbox" size="1"', 'value', 'text', $row->config_mailer); $lists['smtpauth'] = mosHTML::yesnoRadioList('config_smtpauth', 'class="inputbox"', $row->config_smtpauth); $lists['list_length'] = mosHTML::selectList($list_length, 'config_list_limit', 'class="inputbox" size="1"', 'value', 'text', $row->config_list_limit ? $row->config_list_limit : 50); $lists['back_button'] = mosHTML::RadioList($show_hide_r, 'config_back_button', 'class="inputbox"', $row->config_back_button, 'value', 'text'); $lists['item_navigation'] = mosHTML::RadioList($show_hide_r, 'config_item_navigation', 'class="inputbox"', $row->config_item_navigation, 'value', 'text'); $lists['readmore'] = mosHTML::RadioList($show_hide_r, 'config_readmore', 'class="inputbox"', $row->config_readmore, 'value', 'text'); $lists['hits'] = mosHTML::RadioList($show_hide_r, 'config_hits', 'class="inputbox"', $row->config_hits, 'value', 'text'); $lists['icons'] = mosHTML::RadioList($show_hide_r, 'config_icons', 'class="inputbox"', $row->config_icons, 'value', 'text'); $confightml->showconfig($row, $lists, $option); }
function JLMS_editCertificate_OneRole(&$row, &$fonts, $pref = '', $default = false) { global $JLMS_DB, $JLMS_CONFIG; $parent_id = isset($row->id) ? intval($row->id) : 0; $parent_course = isset($row->course_id) ? intval($row->course_id) : 0; $query = "SELECT * FROM #__lms_certificates WHERE parent_id = {$parent_id} AND course_id = {$parent_course} AND crtf_type = '-2' ORDER BY crtf_align"; $JLMS_DB->SetQuery($query); $cmsgs_saved = $JLMS_DB->LoadObjectList(); $f = mosHTML::selectList($fonts, 'crtf_font' . ($pref ? '_' . $pref : ''), $default ? ' disabled="disabled"' : '', 'value', 'text', isset($row->crtf_font) ? $row->crtf_font : 'arial.ttf'); $f2 = mosHTML::selectList($fonts, 'new_txt_mes_font' . ($pref ? '_' . $pref : ''), ' style="width:180px"' . ($default ? ' disabled="disabled"' : ''), 'value', 'text'); if ($pref) { ?> <tr> <td valign="middle" style="vertical-align:middle" width="25%"><br /><?php echo _JLMS_CRTF_USE_DEFAULT; ?> </td> <td> <br /><input size="40" onchange="jlms_changeCrtfDefaultValue(this, '<?php echo $pref; ?> ')" class="inputbox" type="checkbox"<?php echo $default ? ' checked="checked"' : ''; ?> name="certificate_default<?php echo $pref ? '_' . $pref : ''; ?> " value="1" /> </td> </tr> <?php } ?> <tr> <td valign="middle" style="vertical-align:middle" width="25%"><br /><?php echo _JLMS_CHOOSE_FILE; ?> </td> <td> <br /><input size="40" class="inputbox" type="file"<?php echo $default ? ' disabled="disabled"' : ''; ?> name="userfile<?php echo $pref ? '_' . $pref : ''; ?> " /> <?php echo $row->file_id && !$default ? '<br />' . _JLMS_FILE_ATTACHED : '<br />' . _JLMS_FILE_NOT_ATTACHED; ?> </td> </tr> <tr> <td><br /><?php echo _JLMS_GB_CRT_TEXT; ?> </td> <td><br /> <textarea class="inputbox" name="crtf_text<?php echo $pref ? '_' . $pref : ''; ?> "<?php echo $default ? ' disabled="disabled"' : ''; ?> rows="6" cols="40"><?php echo $row->crtf_text; ?> </textarea> </td> </tr> <tr><td colspan="2"><div class="joomlalms_info_legend"><?php echo _JLMS_GB_CRTF_TEXT_NOTE; ?> </div></td></tr> <tr> <td valign="middle" style="vertical-align:middle"><br /><?php echo _JLMS_GB_CRT_TEXT_ALIGN; ?> </td> <td> <?php $list_a = array(); $list_a[] = mosHTML::makeOption('0', _JLMS_LEFT); $list_a[] = mosHTML::makeOption('1', _JLMS_CENTER); $list_a[] = mosHTML::makeOption('2', _JLMS_RIGHT); $rrr = mosHTML::radioList($list_a, 'crtf_align' . ($pref ? '_' . $pref : ''), $default ? ' disabled="disabled"' : '', $row->crtf_align); ?> <br /><?php echo $rrr; ?> </td> </tr> <tr> <td valign="middle" style="vertical-align:middle"><br /><?php echo _JLMS_GB_CRT_TEXT_SHADOW; ?> </td> <td><br /> <?php echo mosHTML::yesnoRadioList('crtf_shadow' . ($pref ? '_' . $pref : ''), $default ? ' disabled="disabled"' : '', $row->crtf_shadow); ?> </td> </tr> <tr> <td valign="middle" style="vertical-align:middle"><br /><?php echo _JLMS_GB_CRT_TEXT_X; ?> </td> <td> <br /><input size="40" class="inputbox" type="text"<?php echo $default ? ' disabled="disabled"' : ''; ?> name="text_x<?php echo $pref ? '_' . $pref : ''; ?> " value="<?php echo $row->text_x; ?> " /> </td> </tr> <tr> <td valign="middle" style="vertical-align:middle"><br /><?php echo _JLMS_GB_CRT_TEXT_Y; ?> </td> <td> <br /><input size="40" class="inputbox" type="text"<?php echo $default ? ' disabled="disabled"' : ''; ?> name="text_y<?php echo $pref ? '_' . $pref : ''; ?> " value="<?php echo $row->text_y; ?> " /> </td> </tr> <tr> <td valign="middle" style="vertical-align:middle"><br /><?php echo _JLMS_GB_CRT_TEXT_SIZE; ?> </td> <td> <br /><input size="40" class="inputbox" type="text"<?php echo $default ? ' disabled="disabled"' : ''; ?> name="text_size<?php echo $pref ? '_' . $pref : ''; ?> " value="<?php echo $row->text_size; ?> " /> <input type="hidden" name="certificate_types[]" value="<?php echo $pref; ?> " /> </td> </tr> <tr> <td valign="middle" style="vertical-align:middle"><br /><?php echo _JLMS_CRTF_FONT . ':'; ?> </td> <td> <br /><?php echo $f; ?> </td> </tr> <tr> <td colspan="2"><?php echo JLMSCSS::h2(_JLMS_CRTF_TEXT_FIELDS); ?> </td> </tr> <tr> <td colspan="2"> <?php echo '<table width="100%" cellpadding="0" cellspacing="0" id="certificate_custom_msgs' . ($pref ? '_' . $pref : '') . '" class="' . JLMSCSS::_('jlmslist') . '">'; echo '<tr>'; echo ' <' . JLMSCSS::tableheadertag() . ' width="20" class="' . JLMSCSS::_('sectiontableheader') . '" align="center">#</' . JLMSCSS::tableheadertag() . '>'; echo ' <' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="200">' . _JLMS_CRTF_SHORT_TEXT_FIELD . '</' . JLMSCSS::tableheadertag() . '>'; echo ' <' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="30" align="center">' . _JLMS_CRTF_SHORT_SHADOW . '</' . JLMSCSS::tableheadertag() . '>'; echo ' <' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="40" align="center">' . _JLMS_CRTF_SHORT_X . '</' . JLMSCSS::tableheadertag() . '>'; echo ' <' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="40" align="center">' . _JLMS_CRTF_SHORT_Y . '</' . JLMSCSS::tableheadertag() . '>'; echo ' <' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="40" align="center">' . _JLMS_CRTF_SHORT_HEIGHT . '</' . JLMSCSS::tableheadertag() . '>'; echo ' <' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '">' . _JLMS_CRTF_SHORT_FONT . '</' . JLMSCSS::tableheadertag() . '>'; echo '<' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="20"> </' . JLMSCSS::tableheadertag() . '>'; echo '<' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="20"> </' . JLMSCSS::tableheadertag() . '>'; echo '<' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" width="20"> </' . JLMSCSS::tableheadertag() . '>'; echo '</tr>'; $k = 1; $i = 1; foreach ($cmsgs_saved as $cmsg_s) { echo '<tr class="' . JLMSCSS::_('sectiontableentry' . $k) . '">'; echo '<td align="center">' . $i . '</td>'; echo '<td><input type="hidden" name="ctxt_mes_id' . ($pref ? '_' . $pref : '') . '[]" value="' . $cmsg_s->id . '" /><input type="text" size="24" name="ctxt_mes_text' . ($pref ? '_' . $pref : '') . '[]"' . ($default ? ' disabled="disabled"' : '') . ' value="' . $cmsg_s->crtf_text . '" /></td>'; echo '<td align="center">'; echo '<input type="hidden"' . ($default ? ' disabled="disabled"' : '') . ' name="ctxt_mes_shadow_hid' . ($pref ? '_' . $pref : '') . '[]" value="' . ($cmsg_s->crtf_shadow ? '1' : '0') . '" />'; echo '<input type="checkbox"' . ($default ? ' disabled="disabled"' : '') . ' onchange="analyze_change_check2(this)" name="ctxt_mes_shadow' . ($pref ? '_' . $pref : '') . '[]"' . ($cmsg_s->crtf_shadow ? ' checked="checked"' : '') . ' value="1" />'; echo '</td>'; echo '<td><input type="text" size="3" name="ctxt_mes_x' . ($pref ? '_' . $pref : '') . '[]"' . ($default ? ' disabled="disabled"' : '') . ' value="' . $cmsg_s->text_x . '" /></td>'; echo '<td><input type="text" size="3" name="ctxt_mes_y' . ($pref ? '_' . $pref : '') . '[]"' . ($default ? ' disabled="disabled"' : '') . ' value="' . $cmsg_s->text_y . '" /></td>'; echo '<td><input type="text" size="3" name="ctxt_mes_h' . ($pref ? '_' . $pref : '') . '[]"' . ($default ? ' disabled="disabled"' : '') . ' value="' . $cmsg_s->text_size . '" /></td>'; $f3 = mosHTML::selectList($fonts, 'ctxt_mes_font' . ($pref ? '_' . $pref : '') . '[]', ' style="width:180px"' . ($default ? ' disabled="disabled"' : ''), 'value', 'text', isset($cmsg_s->crtf_font) ? $cmsg_s->crtf_font : 'arial.ttf'); echo '<td>' . $f3 . '</td>'; echo '<td><a class="jlms_img_link" href="javascript:void(0);" onclick="Delete_tbl_row(this); return false;" title="Delete"><img src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_cancel.png" width="16" height="16" border="0" alt="Delete" /></a></td>'; echo '<td>'; if ($i > 1) { echo '<a class="jlms_img_link" href="javascript:void(0);" onclick="Up_tbl_row(this); return false;" title="' . _JLMS_MOVEUP . '"><img src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_uparrow.png" width="16" height="16" border="0" alt="' . _JLMS_MOVEUP . '" /></a>'; } else { echo ' '; } echo '</td>'; echo '<td>'; if ($i < count($cmsgs_saved)) { echo '<a class="jlms_img_link" href="javascript:void(0);" onclick="Down_tbl_row(this); return false;" title="' . _JLMS_MOVEDOWN . '"><img src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_downarrow.png" width="16" height="16" border="0" alt="' . _JLMS_MOVEDOWN . '" /></a>'; } else { echo ' '; } echo '</tr>'; $k = 3 - $k; $i++; } /*echo '</table>'; echo '<br />'; echo '<table width="100%" cellpadding="0" cellspacing="0">';*/ echo '<tr class="' . JLMSCSS::_('sectiontableentry' . $k) . '">'; echo '<td> </td>'; echo ' <td width="200"><br />'; echo ' <input id="new_txt_message' . ($pref ? '_' . $pref : '') . '" class="inputbox"' . ($default ? ' disabled="disabled"' : '') . ' size="24" type="text" name="new_txt_message' . ($pref ? '_' . $pref : '') . '" />'; echo '</td><td width="20" align="center"><br />'; echo ' <input id="new_txt_mes_shadow' . ($pref ? '_' . $pref : '') . '"' . ($default ? ' disabled="disabled"' : '') . ' type="checkbox" name="new_txt_mes_shadow' . ($pref ? '_' . $pref : '') . '" />'; echo '</td><td width="40"><br />'; echo ' <input id="new_txt_message_X' . ($pref ? '_' . $pref : '') . '" class="inputbox"' . ($default ? ' disabled="disabled"' : '') . ' size="3" type="text" name="new_txt_message_X' . ($pref ? '_' . $pref : '') . '" />'; echo '</td><td width="40"><br />'; echo ' <input id="new_txt_message_Y' . ($pref ? '_' . $pref : '') . '" class="inputbox"' . ($default ? ' disabled="disabled"' : '') . ' size="3" type="text" name="new_txt_message_Y' . ($pref ? '_' . $pref : '') . '" />'; echo '</td><td width="40"><br />'; echo ' <input id="new_txt_message_H' . ($pref ? '_' . $pref : '') . '" class="inputbox"' . ($default ? ' disabled="disabled"' : '') . ' size="3" type="text" name="new_txt_message_H' . ($pref ? '_' . $pref : '') . '" />'; echo '</td>'; echo '<td width="100"><br />'; echo $f2; echo '</td><td align="left" colspan="3"><br />'; echo ' <input class="inputbox" type="button"' . ($default ? ' disabled="disabled"' : '') . ' name="add_new_field' . ($pref ? '_' . $pref : '') . '" style="width:70px " value="' . _JLMS_GB_ADD_NEW_FIELD . '" onclick="javascript:Add_new_tbl_field(this,\'' . ($pref ? '_' . $pref : ''), '\');" />'; echo '</td>'; echo '</tr>'; echo '</table>'; ?> </td> </tr> <?php }
function JLMS_editDetails($option) { global $JLMS_DB, $my, $Itemid, $JLMS_CONFIG, $JLMS_SESSION; $course_id = $JLMS_CONFIG->get('course_id'); //$usertype = $JLMS_CONFIG->get('current_usertype', 0); $JLMS_ACL =& JLMSFactory::getACL(); if ($course_id && $JLMS_ACL->CheckPermissions('conference', 'manage')) { //if ( $course_id && ($usertype == 1)) { $cid = mosGetParam($_REQUEST, 'cid', 0); if (!is_array($cid)) { $cid = array(0); } $query = "SELECT * FROM `#__lms_conference_records` " . "\n WHERE id = " . $cid[0] . " AND course_id = " . $course_id . " "; $JLMS_DB->setQuery($query); $record = $JLMS_DB->loadObject(); if (is_object($record)) { $lists = array(); $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox" ', $record->published); JLMS_conference_html::JLMS_editRecordDetails($course_id, $option, $record, $lists); } else { JLMSRedirect(sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=conference&mode=archive&id={$course_id}")); } } else { $JLMS_SESSION->set('msg', _NOT_AUTH); JLMSRedirect(sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=conference&mode=archive&id={$course_id}")); } }
/** * Compiles information to add or edit a section * @param database A database connector object * @param string The name of the category section * @param integer The unique id of the category to edit (0 if new) * @param string The name of the current user */ function editSection($uid = 0, $scope = '', $option) { global $database, $my, $mainframe; $row = new mosSection($database); // load the row from the db table $row->load((int) $uid); // fail if checked out not by 'me' if ($row->isCheckedOut($my->id)) { $msg = 'The section ' . $row->title . ' is currently being edited by another administrator'; mosRedirect('index2.php?option=' . $option . '&scope=' . $row->scope . '&mosmsg=' . $msg); } $selected_folders = NULL; if ($uid) { $row->checkout($my->id); if ($row->id > 0) { $query = "SELECT *" . "\n FROM #__menu" . "\n WHERE componentid = " . (int) $row->id . "\n AND ( type = 'content_archive_section' OR type = 'content_blog_section' OR type = 'content_section' )"; $database->setQuery($query); $menus = $database->loadObjectList(); $count = count($menus); for ($i = 0; $i < $count; $i++) { switch ($menus[$i]->type) { case 'content_section': $menus[$i]->type = 'Section Table'; break; case 'content_blog_section': $menus[$i]->type = 'Section Blog'; break; case 'content_archive_section': $menus[$i]->type = 'Section Blog Archive'; break; } } } else { $menus = array(); } // handling for MOSImage directories if (trim($row->params)) { // get params definitions $params = new mosParameters($row->params, $mainframe->getPath('com_xml', 'com_sections'), 'component'); $temps = $params->get('imagefolders', ''); $temps = explode(',', $temps); foreach ($temps as $temp) { $selected_folders[] = mosHTML::makeOption($temp, $temp); } } else { $selected_folders[] = mosHTML::makeOption('*1*'); } } else { $row->scope = $scope; $row->published = 1; $menus = array(); // handling for MOSImage directories $selected_folders[] = mosHTML::makeOption('*1*'); } // build the html select list for section types $types[] = mosHTML::makeOption('', 'Select Type'); $types[] = mosHTML::makeOption('content_section', 'Section List'); $types[] = mosHTML::makeOption('content_blog_section', 'Section Blog'); $types[] = mosHTML::makeOption('content_archive_section', 'Section Archive Blog'); $lists['link_type'] = mosHTML::selectList($types, 'link_type', 'class="inputbox" size="1"', 'value', 'text'); // build the html select list for ordering $query = "SELECT ordering AS value, title AS text" . "\n FROM #__sections" . "\n WHERE scope=" . $database->Quote($row->scope) . " ORDER BY ordering"; $lists['ordering'] = mosAdminMenus::SpecificOrdering($row, $uid, $query); // build the select list for the image positions $active = $row->image_position ? $row->image_position : 'left'; $lists['image_position'] = mosAdminMenus::Positions('image_position', $active, NULL, 0); // build the html select list for images $lists['image'] = mosAdminMenus::Images('image', $row->image); // build the html select list for the group access $lists['access'] = mosAdminMenus::Access($row); // build the html radio buttons for published $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published); // build the html select list for menu selection $lists['menuselect'] = mosAdminMenus::MenuSelect(); // list of folders in images/stories/ $imgFiles = recursive_listdir(COM_IMAGE_BASE); $len = strlen(COM_IMAGE_BASE); // handling for MOSImage directories $folders[] = mosHTML::makeOption('*1*', 'All'); $folders[] = mosHTML::makeOption('*0*', 'None'); $folders[] = mosHTML::makeOption('*#*', '---------------------'); $folders[] = mosHTML::makeOption('/'); foreach ($imgFiles as $file) { $folders[] = mosHTML::makeOption(substr($file, $len)); } $lists['folders'] = mosHTML::selectList($folders, 'folders[]', 'class="inputbox" size="17" multiple="multiple"', 'value', 'text', $selected_folders); sections_html::edit($row, $option, $lists, $menus); }
/** * Compiles information to add or edit a module * @param string The current GET/POST option * @param integer The unique id of the record to edit */ function editModule($option, $uid, $client) { global $database, $my, $mainframe; global $mosConfig_absolute_path; $lists = array(); $row = new mosModule($database); // load the row from the db table $row->load((int) $uid); // fail if checked out not by 'me' if ($row->isCheckedOut($my->id)) { mosErrorAlert("The module " . $row->title . " is currently being edited by another administrator"); } $row->content = htmlspecialchars($row->content); if ($uid) { $row->checkout($my->id); } // if a new record we must still prime the mosModule object with a default // position and the order; also add an extra item to the order list to // place the 'new' record in last position if desired if ($uid == 0) { $row->position = 'left'; $row->showtitle = true; //$row->ordering = $l; $row->published = 1; } if ($client == 'admin') { $where = "client_id = 1"; $lists['client_id'] = 1; $path = 'mod1_xml'; } else { $where = "client_id = 0"; $lists['client_id'] = 0; $path = 'mod0_xml'; } $query = "SELECT position, ordering, showtitle, title" . "\n FROM #__modules" . "\n WHERE {$where}" . "\n ORDER BY ordering"; $database->setQuery($query); if (!($orders = $database->loadObjectList())) { echo $database->stderr(); return false; } $query = "SELECT position, description" . "\n FROM #__template_positions" . "\n WHERE position != ''" . "\n ORDER BY position"; $database->setQuery($query); // hard code options for now $positions = $database->loadObjectList(); $orders2 = array(); $pos = array(); foreach ($positions as $position) { $orders2[$position->position] = array(); $pos[] = mosHTML::makeOption($position->position, $position->description); } $l = 0; $r = 0; for ($i = 0, $n = count($orders); $i < $n; $i++) { $ord = 0; if (array_key_exists($orders[$i]->position, $orders2)) { $ord = count(array_keys($orders2[$orders[$i]->position])) + 1; } $orders2[$orders[$i]->position][] = mosHTML::makeOption($ord, $ord . '::' . addslashes($orders[$i]->title)); } // build the html select list $pos_select = 'onchange="changeDynaList(\'ordering\',orders,document.adminForm.position.options[document.adminForm.position.selectedIndex].value, originalPos, originalOrder)"'; $active = $row->position ? $row->position : 'left'; $lists['position'] = mosHTML::selectList($pos, 'position', 'class="inputbox" size="1" ' . $pos_select, 'value', 'text', $active); // get selected pages for $lists['selections'] if ($uid) { $query = "SELECT menuid AS value" . "\n FROM #__modules_menu" . "\n WHERE moduleid = " . (int) $row->id; $database->setQuery($query); $lookup = $database->loadObjectList(); } else { $lookup = array(mosHTML::makeOption(0, 'All')); } if ($row->access == 99 || $row->client_id == 1 || $lists['client_id']) { $lists['access'] = 'Administrator<input type="hidden" name="access" value="99" />'; $lists['showtitle'] = 'N/A <input type="hidden" name="showtitle" value="1" />'; $lists['selections'] = 'N/A'; } else { if ($client == 'admin') { $lists['access'] = 'N/A'; $lists['selections'] = 'N/A'; } else { $lists['access'] = mosAdminMenus::Access($row); $lists['selections'] = mosAdminMenus::MenuLinks($lookup, 1, 1); } $lists['showtitle'] = mosHTML::yesnoRadioList('showtitle', 'class="inputbox"', $row->showtitle); } // build the html select list for published $lists['published'] = mosAdminMenus::Published($row); $row->description = ''; // XML library require_once $mosConfig_absolute_path . '/includes/domit/xml_domit_lite_include.php'; // xml file for module $xmlfile = $mainframe->getPath($path, $row->module); $xmlDoc = new DOMIT_Lite_Document(); $xmlDoc->resolveErrors(true); if ($xmlDoc->loadXML($xmlfile, false, true)) { $root =& $xmlDoc->documentElement; if ($root->getTagName() == 'mosinstall' && $root->getAttribute('type') == 'module') { $element =& $root->getElementsByPath('description', 1); $row->description = $element ? trim($element->getText()) : ''; } } // get params definitions $params = new mosParameters($row->params, $xmlfile, 'module'); HTML_modules::editModule($row, $orders2, $lists, $params, $option); }
/** * Show the configuration edit form * @param string The URL option */ function showconfig($option) { global $database, $mosConfig_absolute_path, $mosConfig_editor; $row = new mosConfig(); $row->bindGlobals(); // compile list of the languages $langs = array(); $menuitems = array(); $lists = array(); // PRE-PROCESS SOME LISTS // -- Languages -- if ($handle = opendir($mosConfig_absolute_path . '/language/')) { $i = 0; while (false !== ($file = readdir($handle))) { if (!strcasecmp(substr($file, -4), ".php") && $file != "." && $file != ".." && strcasecmp(substr($file, -11), ".ignore.php")) { $langs[] = mosHTML::makeOption(substr($file, 0, -4)); } } } // sort list of languages sort($langs); reset($langs); // -- Editors -- // compile list of the editors $query = "SELECT element AS value, name AS text" . "\n FROM #__mambots" . "\n WHERE folder = 'editors'" . "\n AND published = 1" . "\n ORDER BY ordering, name"; $database->setQuery($query); $edits = $database->loadObjectList(); // -- Show/Hide -- $show_hide = array(mosHTML::makeOption(1, 'Ocultar'), mosHTML::makeOption(0, 'Exibir')); $show_hide_r = array(mosHTML::makeOption(0, 'Ocultar'), mosHTML::makeOption(1, 'Exibir')); // -- menu items -- $query = "SELECT id AS value, name AS text FROM #__menu" . "\n WHERE ( type='content_section' OR type='components' OR type='content_typed' )" . "\n AND published = 1" . "\n AND access = 0" . "\n ORDER BY name"; $database->setQuery($query); $menuitems = array_merge($menuitems, $database->loadObjectList()); // SITE SETTINGS $lists['offline'] = mosHTML::yesnoRadioList('config_offline', 'class="inputbox"', $row->config_offline); if (!$row->config_editor) { $row->config_editor = ''; } // build the html select list $lists['editor'] = mosHTML::selectList($edits, 'config_editor', 'class="inputbox" size="1"', 'value', 'text', $row->config_editor); $listLimit = array(mosHTML::makeOption(5, 5), mosHTML::makeOption(10, 10), mosHTML::makeOption(15, 15), mosHTML::makeOption(20, 20), mosHTML::makeOption(25, 25), mosHTML::makeOption(30, 30), mosHTML::makeOption(50, 50)); $lists['list_limit'] = mosHTML::selectList($listLimit, 'config_list_limit', 'class="inputbox" size="1"', 'value', 'text', $row->config_list_limit ? $row->config_list_limit : 50); $lists['frontend_login'] = mosHTML::yesnoRadioList('config_frontend_login', 'class="inputbox"', $row->config_frontend_login); // DEBUG $lists['debug'] = mosHTML::yesnoRadioList('config_debug', 'class="inputbox"', $row->config_debug); // DATABASE SETTINGS // SERVER SETTINGS $lists['gzip'] = mosHTML::yesnoRadioList('config_gzip', 'class="inputbox"', $row->config_gzip); $session = array(mosHTML::makeOption(0, 'Nivel 3 segurança - Padrão & Mais Alto'), mosHTML::makeOption(1, 'Nivel 2 segurança - Permite IPs com proxy'), mosHTML::makeOption(2, 'Nivel 1 segurança - Modo Compatível')); $lists['session_type'] = mosHTML::selectList($session, 'config_session_type', 'class="inputbox" size="1"', 'value', 'text', $row->config_session_type); $errors = array(mosHTML::makeOption(-1, 'Padrão do Sistema'), mosHTML::makeOption(0, 'Nenhum'), mosHTML::makeOption(E_ERROR | E_WARNING | E_PARSE, 'Simples'), mosHTML::makeOption(E_ALL, 'Máximo')); $lists['error_reporting'] = mosHTML::selectList($errors, 'config_error_reporting', 'class="inputbox" size="1"', 'value', 'text', $row->config_error_reporting); $lists['admin_expired'] = mosHTML::yesnoRadioList('config_admin_expired', 'class="inputbox"', $row->config_admin_expired); // LOCALE SETTINGS $lists['lang'] = mosHTML::selectList($langs, 'config_lang', 'class="inputbox" size="1"', 'value', 'text', $row->config_lang); $timeoffset = array(mosHTML::makeOption(-12, '(UTC -12:00) Linha Internacional de Mudança de data'), mosHTML::makeOption(-11, '(UTC -11:00) Ilhas Midway, Samoa'), mosHTML::makeOption(-10, '(UTC -10:00) Havai'), mosHTML::makeOption(-9.5, '(UTC -09:30) Taiohae, Ilhas Marquesas'), mosHTML::makeOption(-9, '(UTC -09:00) Alasca'), mosHTML::makeOption(-8, '(UTC -08:00) Hora do Pacífico (EUA & Canadá))'), mosHTML::makeOption(-7, '(UTC -07:00) Hora das Regiões Montanhosas (Hora do Pacífico (EUA & Canadá))'), mosHTML::makeOption(-6, '(UTC -06:00) Hora Central (EUA & Canadá), Cidade do México'), mosHTML::makeOption(-5, '(UTC -05:00) Hora do Leste (EUA & Canadá), Bogotá, Lima'), mosHTML::makeOption(-4, '(UTC -04:00) Hora do Atlântico (Canadá), Caracas, La Paz'), mosHTML::makeOption(-3.5, '(UTC -03:30) St. John, Newfoundland e Labrador'), mosHTML::makeOption(-3, '(UTC -03:00) Brasil, Buenos Aires, Georgetown'), mosHTML::makeOption(-2, '(UTC -02:00) Atlântico Central'), mosHTML::makeOption(-1, '(UTC -01:00 hour) Açores, Cabo Verde'), mosHTML::makeOption(0, '(UTC 00:00) Meridiano de Greenwich, Lisboa, Londres, Casablanca'), mosHTML::makeOption(1, '(UTC +01:00 hour) Amesterdão, Berlim, Bruxelas, Copenhaga, Madrid, Paris'), mosHTML::makeOption(2, '(UTC +02:00) Jerusalém, Kalininegrado, África do Sul'), mosHTML::makeOption(3, '(UTC +03:00) Bagdade, Riade, Moscovo, São Petersburgo'), mosHTML::makeOption(3.5, '(UTC +03:30) Teerão'), mosHTML::makeOption(4, '(UTC +04:00) Abu Dhabi, Muscat, Baku, Tbilisi'), mosHTML::makeOption(4.5, '(UTC +04:30) Cabul'), mosHTML::makeOption(5, '(UTC +05:00) Ekaterimburgo, Islamabad, Karachi, Tashkent'), mosHTML::makeOption(5.5, '(UTC +05:30) Bombaim, Calcutá, Madras, Nova Deli'), mosHTML::makeOption(5.75, '(UTC +05:45) Catmandu'), mosHTML::makeOption(6, '(UTC +06:00) Almaty, Dhaka, Colombo'), mosHTML::makeOption(6.5, '(UTC +06:30) Yagoon'), mosHTML::makeOption(7, '(UTC +07:00) Banguecoque, Hanói, Jacarta'), mosHTML::makeOption(8, '(UTC +08:00) Pequim, Perth, Singapura, Hong Kong'), mosHTML::makeOption(8.75, '(UTC +08:45) Austrália Ocidental'), mosHTML::makeOption(9, '(UTC +09:00) Tóquio, Seul, Osaka, Sapporo, Yakutsk'), mosHTML::makeOption(9.5, '(UTC +09:30) Adelaide, Darwin, Yakutsk'), mosHTML::makeOption(10, '(UTC +10:00) Leste Australiano, Guam, Vladivostoque'), mosHTML::makeOption(10.5, '(UTC +10:30) Ilha de Lord Howe (Australia)'), mosHTML::makeOption(11, '(UTC +11:00) Magadã, Ilhas de Salomão, Nova Caledónia'), mosHTML::makeOption(11.5, '(UTC +11:30) Ilha de Norfolk'), mosHTML::makeOption(12, '(UTC +12:00) Auckland, Wellington, Fiji, Kamchatka'), mosHTML::makeOption(12.75, '(UTC +12:45) Ilha de Chatham'), mosHTML::makeOption(13, '(UTC +13:00) Tonga'), mosHTML::makeOption(14, '(UTC +14:00) Kiribati')); $lists['offset'] = mosHTML::selectList($timeoffset, 'config_offset_user', 'class="inputbox" size="1"', 'value', 'text', $row->config_offset_user); // MAIL SETTINGS $mailer = array(mosHTML::makeOption('mail', 'Função mail do PHP'), mosHTML::makeOption('sendmail', 'Servidor Sendmail'), mosHTML::makeOption('smtp', 'Servidor SMTP')); $lists['mailer'] = mosHTML::selectList($mailer, 'config_mailer', 'class="inputbox" size="1"', 'value', 'text', $row->config_mailer); $lists['smtpauth'] = mosHTML::yesnoRadioList('config_smtpauth', 'class="inputbox"', $row->config_smtpauth); // CACHE SETTINGS $lists['caching'] = mosHTML::yesnoRadioList('config_caching', 'class="inputbox"', $row->config_caching); // USER SETTINGS $lists['allowUserRegistration'] = mosHTML::yesnoRadioList('config_allowUserRegistration', 'class="inputbox"', $row->config_allowUserRegistration); $lists['useractivation'] = mosHTML::yesnoRadioList('config_useractivation', 'class="inputbox"', $row->config_useractivation); $lists['uniquemail'] = mosHTML::yesnoRadioList('config_uniquemail', 'class="inputbox"', $row->config_uniquemail); $lists['shownoauth'] = mosHTML::yesnoRadioList('config_shownoauth', 'class="inputbox"', $row->config_shownoauth); $lists['frontend_userparams'] = mosHTML::yesnoRadioList('config_frontend_userparams', 'class="inputbox"', $row->config_frontend_userparams); // META SETTINGS $lists['MetaAuthor'] = mosHTML::yesnoRadioList('config_MetaAuthor', 'class="inputbox"', $row->config_MetaAuthor); $lists['MetaTitle'] = mosHTML::yesnoRadioList('config_MetaTitle', 'class="inputbox"', $row->config_MetaTitle); // STATISTICS SETTINGS $lists['log_searches'] = mosHTML::yesnoRadioList('config_enable_log_searches', 'class="inputbox"', $row->config_enable_log_searches); $lists['enable_stats'] = mosHTML::yesnoRadioList('config_enable_stats', 'class="inputbox"', $row->config_enable_stats); $lists['log_items'] = mosHTML::yesnoRadioList('config_enable_log_items', 'class="inputbox"', $row->config_enable_log_items); // SEO SETTINGS $lists['sef'] = mosHTML::yesnoRadioList('config_sef', 'class="inputbox" onclick="javascript: if (document.adminForm.config_sef[1].checked) { alert(\'Lembre-se de renomear o arquivo htaccess.txt para .htaccess\') }"', $row->config_sef); $lists['pagetitles'] = mosHTML::yesnoRadioList('config_pagetitles', 'class="inputbox"', $row->config_pagetitles); // CONTENT SETTINGS $lists['link_titles'] = mosHTML::yesnoRadioList('config_link_titles', 'class="inputbox"', $row->config_link_titles); $lists['readmore'] = mosHTML::RadioList($show_hide_r, 'config_readmore', 'class="inputbox"', $row->config_readmore, 'value', 'text'); $lists['vote'] = mosHTML::RadioList($show_hide_r, 'config_vote', 'class="inputbox"', $row->config_vote, 'value', 'text'); $lists['hideAuthor'] = mosHTML::RadioList($show_hide, 'config_hideAuthor', 'class="inputbox"', $row->config_hideAuthor, 'value', 'text'); $lists['hideCreateDate'] = mosHTML::RadioList($show_hide, 'config_hideCreateDate', 'class="inputbox"', $row->config_hideCreateDate, 'value', 'text'); $lists['hideModifyDate'] = mosHTML::RadioList($show_hide, 'config_hideModifyDate', 'class="inputbox"', $row->config_hideModifyDate, 'value', 'text'); $lists['hits'] = mosHTML::RadioList($show_hide_r, 'config_hits', 'class="inputbox"', $row->config_hits, 'value', 'text'); if (is_writable("{$mosConfig_absolute_path}/media/")) { $lists['hidePdf'] = mosHTML::RadioList($show_hide, 'config_hidePdf', 'class="inputbox"', $row->config_hidePdf, 'value', 'text'); } else { $lists['hidePdf'] = '<input type="hidden" name="config_hidePdf" value="1" /><strong>Ocultar</strong>'; } $lists['hidePrint'] = mosHTML::RadioList($show_hide, 'config_hidePrint', 'class="inputbox"', $row->config_hidePrint, 'value', 'text'); $lists['hideEmail'] = mosHTML::RadioList($show_hide, 'config_hideEmail', 'class="inputbox"', $row->config_hideEmail, 'value', 'text'); $lists['icons'] = mosHTML::RadioList($show_hide_r, 'config_icons', 'class="inputbox"', $row->config_icons, 'value', 'text'); $lists['back_button'] = mosHTML::RadioList($show_hide_r, 'config_back_button', 'class="inputbox"', $row->config_back_button, 'value', 'text'); $lists['item_navigation'] = mosHTML::RadioList($show_hide_r, 'config_item_navigation', 'class="inputbox"', $row->config_item_navigation, 'value', 'text'); $lists['multipage_toc'] = mosHTML::RadioList($show_hide_r, 'config_multipage_toc', 'class="inputbox"', $row->config_multipage_toc, 'value', 'text'); $itemid_compat = array(mosHTML::makeOption('11', 'Joomla! 1.0.11 and before'), mosHTML::makeOption('0', 'Joomla! 1.0.12 and after')); $lists['itemid_compat'] = mosHTML::selectList($itemid_compat, 'config_itemid_compat', 'class="inputbox" size="1"', 'value', 'text', $row->config_itemid_compat); // SHOW EDIT FORM HTML_config::showconfig($row, $lists, $option); }
/** * Compiles information to add or edit a module * @param string The current GET/POST option * @param integer The unique id of the record to edit */ function editMambot($option, $uid, $client) { global $database, $my, $mainframe, $adminLanguage; global $mosConfig_absolute_path; $lists = array(); $row = new mosMambot($database); // load the row from the db table $row->load($uid); // fail if checked out not by 'me' if ($row->checked_out && $row->checked_out != $my->id) { echo "<script>alert(\"" . $adminLanguage->A_COMP_CONTENT_MODULE . " " . $row->title . " " . $adminLanguage->A_COMP_MAMB_EDIT . "\"); document.location.href='index2.php?option={$option}'</script>\n"; exit(0); } if ($uid) { $row->checkout($my->id); } if ($client == 'admin') { $where = "client_id='1'"; } else { $where = "client_id='0'"; } if (!$uid) { $row->folder = ''; $row->ordering = 999; $row->published = 1; } // get list of groups if ($row->access == 99 || $row->client_id == 1) { $lists['access'] = 'Administrator<input type="hidden" name="access" value="99" />'; } else { // build the html select list for the group access $lists['access'] = mosAdminMenus::Access($row); } $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published); if ($uid) { if ($row->ordering > -10000 && $row->ordering < 10000) { // build the html select list for ordering $query = "SELECT ordering AS value, name AS text" . "\n FROM #__mambots" . "\n WHERE folder='{$row->folder}'" . "\n AND published > 0" . "\n AND {$where}" . "\n AND ordering > -10000" . "\n AND ordering < 10000" . "\n ORDER BY ordering"; $order = mosGetOrderingList($query); $lists['ordering'] = mosHTML::selectList($order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval($row->ordering)); } else { $lists['ordering'] = '<input type="hidden" name="ordering" value="' . $row->ordering . '" />This mambot cannot be reordered'; } $lists['folder'] = '<input type="hidden" name="folder" value="' . $row->folder . '" />' . $row->folder; } else { $lists['ordering'] = '<input type="hidden" name="ordering" value="' . $row->ordering . '" />New items default to the last place'; $folders = mosReadDirectory($mosConfig_absolute_path . '/mambots/'); $folders2 = array(); foreach ($folders as $folder) { if (is_dir($mosConfig_absolute_path . '/mambots/' . $folder)) { $folders2[] = mosHTML::makeOption($folder); } } $lists['folder'] = mosHTML::selectList($folders2, 'folder', 'class="inputbox" size="1"', 'value', 'text', null); } $row->description = ''; // XML library require_once $mosConfig_absolute_path . '/includes/domit/xml_domit_lite_include.php'; // xml file for module $xmlfile = $mosConfig_absolute_path . '/mambots/' . $row->folder . '/' . $row->element . '.xml'; $xmlDoc =& new DOMIT_Lite_Document(); $xmlDoc->resolveErrors(true); if ($xmlDoc->loadXML($xmlfile, false, true)) { $element =& $xmlDoc->documentElement; if ($element->getTagName() == 'mosinstall' && $element->getAttribute('type') == 'mambot') { $element =& $xmlDoc->getElementsByPath('description', 1); $row->description = $element ? trim($element->getText()) : ''; } } // get params definitions $params =& new mosParameters($row->params, $mainframe->getPath('bot_xml', $row->folder . '/' . $row->element), 'mambot'); HTML_modules::editMambot($row, $lists, $params, $option); }
function JLMS_editLink($id, $option) { global $my, $JLMS_DB, $Itemid, $JLMS_CONFIG; $JLMS_ACL =& JLMSFactory::getACL(); $course_id = $JLMS_CONFIG->get('course_id'); if ($course_id && $JLMS_ACL->CheckPermissions('links', 'manage')) { // && ( ($id && (JLMS_GetLinkCourse($id) == $course_id)) || !$id ) ) { $AND_ST = ""; if (false !== ($enroll_period = JLMS_getEnrolPeriod($my->id, $course_id))) { $AND_ST = " AND IF(is_time_related, (show_period < '" . $enroll_period . "' ), 1) "; } $row = new mos_Joomla_LMS_Link($JLMS_DB); $row->addCond($AND_ST); $row->load($id); if ($id) { if ($row->course_id != $course_id) { JLMSRedirect(sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=links&id={$course_id}")); } if ($JLMS_ACL->CheckPermissions('links', 'only_own_items') && $row->owner_id != $my->id) { JLMSRedirect(sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=links&id={$course_id}")); } elseif ($JLMS_ACL->CheckPermissions('links', 'only_own_role') && $JLMS_ACL->GetRole() != $JLMS_ACL->UserSystemRole($JLMS_DB, $row->owner_id)) { JLMSRedirect(sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=links&id={$course_id}")); } if ($row->params) { $params = new JLMSParameters($row->params); } else { $params = new JLMSParameters('display_width=0' . "\n" . 'display_height=0'); } //$row->checkout($my->id); } else { $row->published = 0; $params = new JLMSParameters('display_width=0' . "\n" . 'display_height=0'); } $lists = array(); $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox" ', $row->published); JLMS_course_links_html::showEditLink($row, $lists, $option, $course_id, $params); } else { JLMSRedirect(sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=links&id={$course_id}")); } }