function viewSearch() { global $mainframe, $mosConfig_absolute_path, $mosConfig_lang, $my; global $Itemid, $database, $_MAMBOTS; $gid = $my->gid; // Adds parameter handling if ($Itemid > 0) { $menu =& new mosMenu($database); $menu->load($Itemid); $params =& new mosParameters($menu->params); $params->def('page_title', 1); $params->def('pageclass_sfx', ''); $params->def('header', $menu->name, T_('Search')); $params->def('back_button', $mainframe->getCfg('back_button')); } else { $params =& new mosParameters(''); $params->def('page_title', 1); $params->def('pageclass_sfx', ''); $params->def('header', T_('Search')); $params->def('back_button', $mainframe->getCfg('back_button')); } // html output search_html::openhtml($params); $searchword = mosGetParam($_REQUEST, 'searchword', ''); $searchword = $database->getEscaped(trim($searchword)); $search_ignore = array(); @(include "{$mosConfig_absolute_path}/language/{$mosConfig_lang}.ignore.php"); $orders = array(); $orders[] = mosHTML::makeOption('newest', T_('Newest first')); $orders[] = mosHTML::makeOption('oldest', T_('Oldest first')); $orders[] = mosHTML::makeOption('popular', T_('Most popular')); $orders[] = mosHTML::makeOption('alpha', T_('Alphabetical')); $orders[] = mosHTML::makeOption('category', T_('Section/Category')); $ordering = mosGetParam($_REQUEST, 'ordering', 'newest'); if (!in_array($ordering, array('newest', 'oldest', 'popular', 'alpha', 'category'))) { $ordering = 'newest'; } $lists = array(); $lists['ordering'] = mosHTML::selectList($orders, 'ordering', 'class="inputbox"', 'value', 'text', $ordering); $searchphrase = mosGetParam($_REQUEST, 'searchphrase', 'any'); if (!in_array($searchphrase, array('any', 'all', 'exact'))) { $searchphrase = 'any'; } $searchphrases = array(); $phrase = new stdClass(); $phrase->value = 'any'; $phrase->text = T_('Any words'); $searchphrases[] = $phrase; $phrase = new stdClass(); $phrase->value = 'all'; $phrase->text = T_('All words'); $searchphrases[] = $phrase; $phrase = new stdClass(); $phrase->value = 'exact'; $phrase->text = T_('Exact phrase'); $searchphrases[] = $phrase; $lists['searchphrase'] = mosHTML::radioList($searchphrases, 'searchphrase', '', $searchphrase); // html output search_html::searchbox(htmlspecialchars($searchword), $lists, $params); if (!$searchword) { if (count($_POST)) { // html output // no matches found search_html::message(T_('No results were found'), $params); } } else { foreach ($search_ignore as $ignore_word) { $searchword = preg_replace("/(^|\\W){$ignore_word}(\$|\\W)/i", '$1$2', $searchword); } $searchword = trim($searchword); if (!$searchword) { search_html::message(T_('One or more common words were ignored in the search'), $params); } } if ($searchword) { // html output search_html::searchintro(htmlspecialchars($searchword), $params); mosLogSearch($searchword); $phrase = mosGetParam($_REQUEST, 'searchphrase', ''); if (!in_array($phrase, array('any', 'all', 'exact'))) { $phrase = 'any'; } $ordering = mosGetParam($_REQUEST, 'ordering', ''); if (!in_array($ordering, array('newest', 'oldest', 'popular', 'alpha', 'category'))) { $ordering = 'newest'; } $_MAMBOTS->loadBotGroup('search'); $results = $_MAMBOTS->trigger('onSearch', array($searchword, $phrase, $ordering)); $rows = array(); foreach ($results as $result) { if ($result) { $rows = array_merge($rows, $result); } } $totalRows = count($rows); for ($i = 0; $i < $totalRows; $i++) { $row =& $rows[$i]->text; if ($phrase == 'exact') { $searchwords = array($searchword); $needle = $searchword; } else { $searchwords = explode(' ', $searchword); $needle = $searchwords[0]; } $row = mosPrepareSearchContent($row, 200, $needle); foreach ($searchwords as $hlword) { $row = preg_replace('/' . preg_quote($hlword, '/') . '/i', "<span class=\"highlight\">\\0</span>", $row); } if (!eregi('^http', $rows[$i]->href)) { // determines Itemid for Content items if (strstr($rows[$i]->href, 'view')) { // tests to see if itemid has already been included - this occurs for typed content items if (!strstr($rows[$i]->href, 'Itemid')) { $temp = explode('id=', $rows[$i]->href); $rows[$i]->href = $rows[$i]->href . '&Itemid=' . $mainframe->getItemid($temp[1]); } } } } $mainframe->setPageTitle(T_('Search')); if ($totalRows) { // html output search_html::display($rows, $params); } else { // html output search_html::displaynoresult(); } // html output search_html::conclusion($totalRows, htmlspecialchars($searchword)); } // displays back button echo '<br />'; mosHTML::BackButton($params, 0); }
/** * Writes a yes/no radio list * @param string The value of the HTML name attribute * @param string Additional HTML attributes for the <select> tag * @param mixed The key that is selected * @returns string HTML for the radio list */ function yesnoRadioList($tag_name, $tag_attribs, $selected, $yes = false, $no = false) { $arr = array(mosHTML::makeOption('0', $no ? $no : T_('No')), mosHTML::makeOption('1', $yes ? $yes : T_('Yes'))); return mosHTML::radioList($arr, $tag_name, $tag_attribs, $selected); }
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 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 viewSearch() { global $mainframe, $mosConfig_absolute_path, $mosConfig_lang, $my; global $Itemid, $database, $_MAMBOTS; global $mosConfig_list_limit; $restriction = 0; // try to find search component's Itemid // Only search if we don't have a valid Itemid (e.g. from module) if (!intval($Itemid) || intval($Itemid) == 99999999) { $query = "SELECT id" . "\n FROM #__menu" . "\n WHERE type = 'components'" . "\n AND published = 1" . "\n AND link = 'index.php?option=com_search'"; $database->setQuery($query); $_Itemid = $database->loadResult(); if ($_Itemid != "") { $Itemid = $_Itemid; } } $gid = $my->gid; // Adds parameter handling if ($Itemid > 0 && $Itemid != 99999999) { $menu = $mainframe->get('menu'); $params = new mosParameters($menu->params); $params->def('page_title', 1); $params->def('pageclass_sfx', ''); $params->def('header', $menu->name); $params->def('back_button', $mainframe->getCfg('back_button')); } else { $params = new mosParameters(''); $params->def('page_title', 1); $params->def('pageclass_sfx', ''); $params->def('header', _SEARCH_TITLE); $params->def('back_button', $mainframe->getCfg('back_button')); } // html output search_html::openhtml($params); $searchphrase = mosGetParam($_REQUEST, 'searchphrase', 'any'); $searchphrase = preg_replace('/[^a-z]/', '', strtolower($searchphrase)); $searchword = strval(mosGetParam($_REQUEST, 'searchword', '')); $searchword = trim(stripslashes($searchword)); // limit searchword to 20 characters if (strlen($searchword) > 20) { $searchword = substr($searchword, 0, 19); $restriction = 1; } // searchword must contain a minimum of 3 characters if ($searchword && strlen($searchword) < 3) { $searchword = ''; $restriction = 1; } if ($searchphrase != 'exact') { $aterms = explode(' ', strtolower($searchword)); $search_ignore = array(); // filter out search terms that are too small foreach ($aterms as $aterm) { if (strlen($aterm) < 3) { $search_ignore[] = $aterm; } } $pruned = array_diff($aterms, $search_ignore); $pruned = array_unique($pruned); $searchword = implode(' ', $pruned); if (trim($searchword) == '') { $restriction = 1; } } @(include "{$mosConfig_absolute_path}/language/{$mosConfig_lang}.ignore.php"); $orders = array(); $orders[] = mosHTML::makeOption('newest', _SEARCH_NEWEST); $orders[] = mosHTML::makeOption('oldest', _SEARCH_OLDEST); $orders[] = mosHTML::makeOption('popular', _SEARCH_POPULAR); $orders[] = mosHTML::makeOption('alpha', _SEARCH_ALPHABETICAL); $orders[] = mosHTML::makeOption('category', _SEARCH_CATEGORY); $ordering = mosGetParam($_REQUEST, 'ordering', 'newest'); $ordering = preg_replace('/[^a-z]/', '', strtolower($ordering)); $lists = array(); $lists['ordering'] = mosHTML::selectList($orders, 'ordering', 'id="search_ordering" class="inputbox"', 'value', 'text', $ordering); $searchphrases = array(); $phrase = new stdClass(); $phrase->value = 'any'; $phrase->text = _SEARCH_ANYWORDS; $searchphrases[] = $phrase; $phrase = new stdClass(); $phrase->value = 'all'; $phrase->text = _SEARCH_ALLWORDS; $searchphrases[] = $phrase; $phrase = new stdClass(); $phrase->value = 'exact'; $phrase->text = _SEARCH_PHRASE; $searchphrases[] = $phrase; $lists['searchphrase'] = mosHTML::radioList($searchphrases, 'searchphrase', '', $searchphrase); // html output search_html::searchbox(htmlspecialchars($searchword), $lists, $params); if (!$searchword) { if (count($_POST)) { // html output // no matches found search_html::message(_NOKEYWORD, $params); } else { if ($restriction) { // html output search_html::message(_SEARCH_MESSAGE, $params); } } } else { if (in_array($searchword, $search_ignore)) { // html output search_html::message(_IGNOREKEYWORD, $params); } else { // html output if ($restriction) { // html output search_html::message(_SEARCH_MESSAGE, $params); } $searchword_clean = htmlspecialchars($searchword); search_html::searchintro($searchword_clean, $params); mosLogSearch($searchword); $_MAMBOTS->loadBotGroup('search'); $results = $_MAMBOTS->trigger('onSearch', array($database->getEscaped($searchword, true), $searchphrase, $ordering)); $totalRows = 0; $rows = array(); for ($i = 0, $n = count($results); $i < $n; $i++) { $rows = array_merge((array) $rows, (array) $results[$i]); } $totalRows = count($rows); for ($i = 0; $i < $totalRows; $i++) { $text =& $rows[$i]->text; if ($searchphrase == 'exact') { $searchwords = array($searchword); $needle = $searchword; } else { $searchwords = explode(' ', $searchword); $needle = $searchwords[0]; } $text = mosPrepareSearchContent($text, 200, $needle); foreach ($searchwords as $k => $hlword) { $searchwords[$k] = htmlspecialchars(stripslashes($hlword)); } $searchRegex = implode('|', $searchwords); $text = eregi_replace('(' . $searchRegex . ')', '<span class="highlight">\\0</span>', $text); if (strpos($rows[$i]->href, 'http') == false) { $url = parse_url($rows[$i]->href); parse_str(@$url['query'], $link); // determines Itemid for Content items where itemid has not been included if (isset($rows[$i]->type) && @$link['task'] == 'view' && isset($link['id']) && !isset($link['Itemid'])) { $itemid = ''; $_itemid = $mainframe->getItemid($link['id'], 0); if ($_itemid) { $itemid = '&Itemid=' . $_itemid; } $rows[$i]->href = $rows[$i]->href . $itemid; } } } $mainframe->setPageTitle(_SEARCH_TITLE); $total = $totalRows; $limit = intval(mosGetParam($_GET, 'limit', $mosConfig_list_limit)); $limit = $limit ? $limit : $mosConfig_list_limit; $limitstart = intval(mosGetParam($_GET, 'limitstart', 0)); // prepares searchword for proper display in url $searchword_clean = urlencode($searchword_clean); if ($n) { // html output require_once $GLOBALS['mosConfig_absolute_path'] . '/includes/pageNavigation.php'; $pageNav = new mosPageNav($total, $limitstart, $limit); search_html::display($rows, $params, $pageNav, $limitstart, $limit, $total, $totalRows, $searchword_clean); } else { // html output search_html::displaynoresult(); } // html output search_html::conclusion($searchword_clean, $pageNav); } } // displays back button echo '<br/>'; mosHTML::BackButton($params, 0); }
/** * @param string The name of the form element * @param string The value of the element * @param object The xml element for the parameter * @param string The control name * @return string The html for the element */ function _form_radio($name, $value, &$node, $control_name) { $options = array(); foreach ($node->childNodes as $option) { $val = $option->getAttribute('value'); $text = $option->gettext(); $options[] = mosHTML::makeOption($val, $text); } return mosHTML::radioList($options, '' . $control_name . '[' . $name . ']', '', $value); }
/** * @var string The name of the form element * @var string The value of the element * @var object The xml element for the parameter * @return string The html for the element */ function _form_radio($name, $value, &$node) { $options = array(); foreach ($node->childNodes as $option) { $val = $option->getAttribute('value'); $text = $option->gettext(); $options[] = mosHTML::makeOption($val, $text, true); } return mosHTML::radioList($options, "params[{$name}]", '', $value); }
/** * Writes a yes/no radio list * @param string The value of the HTML name attribute * @param string Additional HTML attributes for the <select> tag * @param mixed The key that is selected * @returns string HTML for the radio list */ function yesnoRadioList($tag_name, $tag_attribs, $selected, $yes = _CMN_YES, $no = _CMN_NO) { $arr = array(mosHTML::makeOption('0', $no), mosHTML::makeOption('1', $yes)); return mosHTML::radioList($arr, $tag_name, $tag_attribs, $selected); }
function showConfigEdit($GLOBALS) { if (ACA_CMSTYPE) { // joomla 15 $mailOpt[] = JHTML::_('select.option', 'mail', 'PHP mail function'); $mailOpt[] = JHTML::_('select.option', 'sendmail', 'Sendmail'); $mailOpt[] = JHTML::_('select.option', 'smtp', 'SMTP Server'); $logFormat[] = JHTML::_('select.option', '0', _ACA_DETAILED); $logFormat[] = JHTML::_('select.option', '1', _ACA_SIMPLE); $lists['mailermethod'] = JHTML::_('select.genericlist', $mailOpt, "config['emailmethod']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[ACA . 'emailmethod']); $lists['send_log_simple'] = JHTML::_('select.genericlist', $logFormat, "config['send_log_simple']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[ACA . 'send_log_simple']); $lists['save_log_simple'] = JHTML::_('select.genericlist', $logFormat, "config['save_log_simple']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[ACA . 'save_log_simple']); $lists['auth_required'] = JHTML::_('select.booleanlist', "config['smtp_auth_required']", 'class="inputbox"', $GLOBALS[ACA . 'smtp_auth_required']); $lists['allow_unregistered'] = JHTML::_('select.booleanlist', "config['allow_unregistered']", 'class="inputbox"', $GLOBALS[ACA . 'allow_unregistered']); $lists['require_confirmation'] = JHTML::_('select.booleanlist', "config['require_confirmation']", 'class="inputbox"', $GLOBALS[ACA . 'require_confirmation']); $lists['show_login'] = JHTML::_('select.booleanlist', "config['show_login']", 'class="inputbox"', $GLOBALS[ACA . 'show_login']); $lists['show_logout'] = JHTML::_('select.booleanlist', "config['show_logout']", 'class="inputbox"', $GLOBALS[ACA . 'show_logout']); $lists['confirm_html'] = JHTML::_('select.booleanlist', "config['confirm_html']", 'class="inputbox"', $GLOBALS[ACA . 'confirm_html']); $lists['time_zone'] = JHTML::_('select.booleanlist', "config['time_zone']", 'class="inputbox"', $GLOBALS[ACA . 'time_zone']); $lists['show_archive'] = JHTML::_('select.booleanlist', "config['show_archive']", 'class="inputbox"', $GLOBALS[ACA . 'show_archive']); $lists['enable_statistics'] = JHTML::_('select.booleanlist', "config['enable_statistics']", 'class="inputbox"', $GLOBALS[ACA . 'enable_statistics']); $lists['statistics_per_subscriber'] = JHTML::_('select.booleanlist', "config['statistics_per_subscriber']", 'class="inputbox"', $GLOBALS[ACA . 'statistics_per_subscriber']); $lists['wait_for_user'] = JHTML::_('select.booleanlist', "config['wait_for_user']", 'class="inputbox"', $GLOBALS[ACA . 'wait_for_user']); $lists['display_trace'] = JHTML::_('select.booleanlist', "config['display_trace']", 'class="inputbox"', $GLOBALS[ACA . 'display_trace']); $lists['send_data'] = JHTML::_('select.booleanlist', "config['send_data']", 'class="inputbox"', $GLOBALS[ACA . 'send_data']); $lists['send_auto_log'] = JHTML::_('select.booleanlist', "config['send_auto_log']", 'class="inputbox"', $GLOBALS[ACA . 'send_auto_log']); $lists['send_log'] = JHTML::_('select.booleanlist', "config['send_log']", 'class="inputbox"', $GLOBALS[ACA . 'send_log']); $lists['save_log'] = JHTML::_('select.booleanlist', "config['save_log']", 'class="inputbox"', $GLOBALS[ACA . 'save_log']); $lists['send_log_closed'] = JHTML::_('select.booleanlist', "config['send_log_closed']", 'class="inputbox"', $GLOBALS[ACA . 'send_log_closed']); $lists['clear_log'] = JHTML::_('select.booleanlist', "clear_log", 'class="inputbox"', 0); $lists['show_footer'] = JHTML::_('select.booleanlist', "config['show_footer']", 'class="inputbox"', $GLOBALS[ACA . 'show_footer']); $lists['show_jcalpro'] = JHTML::_('select.booleanlist', "config['show_jcalpro']", 'class="inputbox"', $GLOBALS[ACA . 'show_jcalpro']); $lists['show_signature'] = JHTML::_('select.booleanlist', "config['show_signature']", 'class="inputbox"', $GLOBALS[ACA . 'show_signature']); $lists['show_lists'] = JHTML::_('select.booleanlist', "config['show_lists']", 'class="inputbox"', $GLOBALS[ACA . 'show_lists']); $lists['embed_images'] = JHTML::_('select.booleanlist', "config['embed_images']", 'class="inputbox"', $GLOBALS[ACA . 'embed_images']); $lists['show_guide'] = JHTML::_('select.booleanlist', "config['show_guide']", 'class="inputbox"', $GLOBALS[ACA . 'show_guide']); $lists['show_author'] = JHTML::_('select.booleanlist', "config['show_author']", 'class="inputbox"', $GLOBALS[ACA . 'show_author']); $lists['show_tips'] = JHTML::_('select.booleanlist', "config['show_tips']", 'class="inputbox"', $GLOBALS[ACA . 'show_tips']); //$lists['update_notification'] = JHTML::_('select.booleanlist', "config['update_notification']" , 'class="inputbox"', $GLOBALS[ACA.'update_notification'] ); $lists['use_sef'] = JHTML::_('select.booleanlist', "config['use_sef']", 'class="inputbox"', $GLOBALS[ACA . 'use_sef']); $lists['listype1'] = JHTML::_('select.booleanlist', "config['listype1']", 'class="inputbox"', $GLOBALS[ACA . 'listype1']); $lists['listype2'] = JHTML::_('select.booleanlist', "config['listype2']", 'class="inputbox"', $GLOBALS[ACA . 'listype2']); $lists['listHTMLeditor'] = JHTML::_('select.booleanlist', "config['listHTMLeditor']", 'class="inputbox"', $GLOBALS[ACA . 'listHTMLeditor']); $lists['send_error'] = JHTML::_('select.booleanlist', "config['send_error']", 'class="inputbox"', $GLOBALS[ACA . 'send_error']); $lists['report_error'] = JHTML::_('select.booleanlist', "config['report_error']", 'class="inputbox"', $GLOBALS[ACA . 'report_error']); $lists['fullcheck'] = JHTML::_('select.booleanlist', "config['fullcheck']", 'class="inputbox"', $GLOBALS[ACA . 'fullcheck']); $lists['addEmailRedLink'] = JHTML::_('select.booleanlist', "config['addEmailRedLink']", 'class="inputbox"', $GLOBALS[ACA . 'addEmailRedLink']); $lists['disabletooltip'] = JHTML::_('select.booleanlist', "config['disabletooltip']", 'class="inputbox"', $GLOBALS[ACA . 'disabletooltip']); $lists['minisendmail'] = JHTML::_('select.booleanlist', "config['minisendmail']", 'class="inputbox"', $GLOBALS[ACA . 'minisendmail']); } else { //joomla 1x $mailOpt[] = mosHTML::makeOption('mail', 'PHP mail function'); $mailOpt[] = mosHTML::makeOption('sendmail', 'Sendmail'); $mailOpt[] = mosHTML::makeOption('smtp', 'SMTP Server'); $logFormat[] = mosHTML::makeOption('0', _ACA_DETAILED); $logFormat[] = mosHTML::makeOption('1', _ACA_SIMPLE); $lists['mailermethod'] = mosHTML::selectList($mailOpt, "config['emailmethod']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[ACA . 'emailmethod']); $lists['send_log_simple'] = mosHTML::selectList($logFormat, "config['send_log_simple']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[ACA . 'send_log_simple']); $lists['save_log_simple'] = mosHTML::selectList($logFormat, "config['save_log_simple']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[ACA . 'save_log_simple']); $lists['auth_required'] = mosHTML::yesnoRadioList("config['smtp_auth_required']", 'class="inputbox"', $GLOBALS[ACA . 'smtp_auth_required']); $lists['allow_unregistered'] = mosHTML::yesnoRadioList("config['allow_unregistered']", 'class="inputbox"', $GLOBALS[ACA . 'allow_unregistered']); $lists['require_confirmation'] = mosHTML::yesnoRadioList("config['require_confirmation']", 'class="inputbox"', $GLOBALS[ACA . 'require_confirmation']); $lists['show_login'] = mosHTML::yesnoRadioList("config['show_login']", 'class="inputbox"', $GLOBALS[ACA . 'show_login']); $lists['show_logout'] = mosHTML::yesnoRadioList("config['show_logout']", 'class="inputbox"', $GLOBALS[ACA . 'show_logout']); $lists['confirm_html'] = mosHTML::yesnoRadioList("config['confirm_html']", 'class="inputbox"', $GLOBALS[ACA . 'confirm_html']); $lists['time_zone'] = mosHTML::yesnoRadioList("config['time_zone']", 'class="inputbox"', $GLOBALS[ACA . 'time_zone']); $lists['show_archive'] = mosHTML::yesnoRadioList("config['show_archive']", 'class="inputbox"', $GLOBALS[ACA . 'show_archive']); $lists['enable_statistics'] = mosHTML::yesnoRadioList("config['enable_statistics']", 'class="inputbox"', $GLOBALS[ACA . 'enable_statistics']); $lists['statistics_per_subscriber'] = mosHTML::yesnoRadioList("config['statistics_per_subscriber']", 'class="inputbox"', $GLOBALS[ACA . 'statistics_per_subscriber']); $lists['wait_for_user'] = mosHTML::yesnoRadioList("config['wait_for_user']", 'class="inputbox"', $GLOBALS[ACA . 'wait_for_user']); $lists['display_trace'] = mosHTML::yesnoRadioList("config['display_trace']", 'class="inputbox"', $GLOBALS[ACA . 'display_trace']); $lists['send_data'] = mosHTML::yesnoRadioList("config['send_data']", 'class="inputbox"', $GLOBALS[ACA . 'send_data']); $lists['send_auto_log'] = mosHTML::yesnoRadioList("config['send_auto_log']", 'class="inputbox"', $GLOBALS[ACA . 'send_auto_log']); $lists['send_log'] = mosHTML::yesnoRadioList("config['send_log']", 'class="inputbox"', $GLOBALS[ACA . 'send_log']); $lists['save_log'] = mosHTML::yesnoRadioList("config['save_log']", 'class="inputbox"', $GLOBALS[ACA . 'save_log']); $lists['send_log_closed'] = mosHTML::yesnoRadioList("config['send_log_closed']", 'class="inputbox"', $GLOBALS[ACA . 'send_log_closed']); $lists['clear_log'] = mosHTML::yesnoRadioList("clear_log", 'class="inputbox"', 0); $lists['show_footer'] = mosHTML::yesnoRadioList("config['show_footer']", 'class="inputbox"', $GLOBALS[ACA . 'show_footer']); $lists['show_jcalpro'] = mosHTML::yesnoRadioList("config['show_jcalpro']", 'class="inputbox"', $GLOBALS[ACA . 'show_jcalpro']); $lists['show_signature'] = mosHTML::yesnoRadioList("config['show_signature']", 'class="inputbox"', $GLOBALS[ACA . 'show_signature']); $lists['show_lists'] = mosHTML::yesnoRadioList("config['show_lists']", 'class="inputbox"', $GLOBALS[ACA . 'show_lists']); $lists['embed_images'] = mosHTML::yesnoRadioList("config['embed_images']", 'class="inputbox"', $GLOBALS[ACA . 'embed_images']); $lists['show_guide'] = mosHTML::yesnoRadioList("config['show_guide']", 'class="inputbox"', $GLOBALS[ACA . 'show_guide']); $lists['show_author'] = mosHTML::yesnoRadioList("config['show_author']", 'class="inputbox"', $GLOBALS[ACA . 'show_author']); $lists['show_tips'] = mosHTML::yesnoRadioList("config['show_tips']", 'class="inputbox"', $GLOBALS[ACA . 'show_tips']); //$lists['update_notification'] = mosHTML::yesnoRadioList( "config['update_notification']" , 'class="inputbox"', $GLOBALS[ACA.'update_notification'] ); $lists['use_sef'] = mosHTML::yesnoRadioList("config['use_sef']", 'class="inputbox"', $GLOBALS[ACA . 'use_sef']); $lists['listype1'] = mosHTML::yesnoRadioList("config['listype1']", 'class="inputbox"', $GLOBALS[ACA . 'listype1']); $lists['listype2'] = mosHTML::yesnoRadioList("config['listype2']", 'class="inputbox"', $GLOBALS[ACA . 'listype2']); $lists['listHTMLeditor'] = mosHTML::yesnoRadioList("config['listHTMLeditor']", 'class="inputbox"', $GLOBALS[ACA . 'listHTMLeditor']); $lists['send_error'] = mosHTML::yesnoRadioList("config['send_error']", 'class="inputbox"', $GLOBALS[ACA . 'send_error']); $lists['report_error'] = mosHTML::yesnoRadioList("config['report_error']", 'class="inputbox"', $GLOBALS[ACA . 'report_error']); $lists['fullcheck'] = mosHTML::yesnoRadioList("config['fullcheck']", 'class="inputbox"', $GLOBALS[ACA . 'fullcheck']); $lists['addEmailRedLink'] = mosHTML::yesnoRadioList("config['addEmailRedLink']", 'class="inputbox"', $GLOBALS[ACA . 'addEmailRedLink']); $lists['disabletooltip'] = mosHTML::yesnoRadioList("config['disabletooltip']", 'class="inputbox"', $GLOBALS[ACA . 'disabletooltip']); $lists['minisendmail'] = mosHTML::yesnoRadioList("config['minisendmail']", 'class="inputbox"', $GLOBALS[ACA . 'minisendmail']); } //endif if (class_exists('aca_archive')) { if (ACA_CMSTYPE) { // joomla 15 $jour = array(); $jour[] = JHTML::_('select.option', '0', _FREQ_OPT_0); $jour[] = JHTML::_('select.option', '1', _FREQ_OPT_1); $jour[] = JHTML::_('select.option', '2', _FREQ_OPT_2); $jour[] = JHTML::_('select.option', '3', _FREQ_OPT_3); $jour[] = JHTML::_('select.option', '4', _FREQ_OPT_4); $jour[] = JHTML::_('select.option', '5', _FREQ_OPT_5); $jour[] = JHTML::_('select.option', '6', _FREQ_OPT_6); $dateType = array(); $dateType[] = JHTML::_('select.option', '1', _DATE_OPT_1); $dateType[] = JHTML::_('select.option', '2', _DATE_OPT_2); $lists['frequency'] = JHTML::_('select.genericlist', $jour, "config['frequency']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[ACA . 'frequency']); $lists['date_type'] = JHTML::_('select.genericlist', $dateType, "config['date_type']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[ACA . 'date_type']); } else { //joomla 1x $jour = array(); $jour[] = mosHTML::makeOption('0', _FREQ_OPT_0); $jour[] = mosHTML::makeOption('1', _FREQ_OPT_1); $jour[] = mosHTML::makeOption('2', _FREQ_OPT_2); $jour[] = mosHTML::makeOption('3', _FREQ_OPT_3); $jour[] = mosHTML::makeOption('4', _FREQ_OPT_4); $jour[] = mosHTML::makeOption('5', _FREQ_OPT_5); $jour[] = mosHTML::makeOption('6', _FREQ_OPT_6); $dateType = array(); $dateType[] = mosHTML::makeOption('1', _DATE_OPT_1); $dateType[] = mosHTML::makeOption('2', _DATE_OPT_2); $lists['frequency'] = mosHTML::selectList($jour, "config['frequency']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[ACA . 'frequency']); $lists['date_type'] = mosHTML::selectList($dateType, "config['date_type']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[ACA . 'date_type']); } //endif } if (ACA_CMSTYPE) { $mail_format[] = JHTML::_('select.option', '0', 'Text (8bit)'); $mail_format[] = JHTML::_('select.option', '1', 'MIME (base64)'); $lists['mail_format'] = JHTML::_('select.radiolist', $mail_format, "config['mail_format']", 'class="inputbox"', 'value', 'text', $GLOBALS[ACA . 'mail_format']); } else { $mail_format[] = mosHTML::makeOption('0', 'Text (8bit)'); $mail_format[] = mosHTML::makeOption('1', 'MIME (base64)'); $lists['mail_format'] = mosHTML::radioList($mail_format, "config['mail_format']", 'class="inputbox"', $GLOBALS[ACA . 'mail_format']); } //endif backHTML::formStart('configpanel', 0, ''); ?> <table style="width: 100%;" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td> <form action="index2.php" method="post" name="adminForm"> <?php if (ACA_CMSTYPE) { $config_tabs = new mosTabs15(1); } else { $config_tabs = new mosTabs(1); } //endif $config_tabs->startPane('acaConfig'); $config_tabs->startTab(_ACA_MAIL_CONFIG, 'mail'); configHTML::mailSettings($lists); $config_tabs->endTab(); $config_tabs->startTab(_ACA_SUBSCRIBER_CONFIG, 'subscribers'); configHTML::subcriberSettings($lists); $config_tabs->endTab(); if (class_exists('auto')) { $flag = auto::viewCron(); } else { $flag = false; } if ($flag) { $config_tabs->startTab(_ACA_SCHEDULER, 'scheduler'); configHTML::cronSettings($lists); $config_tabs->endTab(); } $config_tabs->startTab(_ACA_LOGGING_CONFIG, 'logging'); configHTML::logsSettings($lists); $config_tabs->endTab(); if ($GLOBALS[ACA . 'integration'] and ($GLOBALS[ACA . 'cb_integration'] or class_exists('aca_virtuemart') && $GLOBALS[ACA . 'virtuemart'])) { $config_tabs->startTab(_ACA_CONFIG_INTEGRATION, 'integration'); if ($GLOBALS[ACA . 'cb_integration']) { configHTML::cbSettings(); } if (class_exists('aca_virtuemart') && isset($GLOBALS[ACA . 'virtuemart']) && $GLOBALS[ACA . 'virtuemart']) { aca_virtuemart::tab(); } $config_tabs->endTab(); } if (class_exists('aca_archive')) { $config_tabs->startTab(_ACA_MENU_TAB_ARCHIVE, 'archive'); aca_archive::showArchive($lists); $config_tabs->endTab(); } $config_tabs->startTab(_ACA_MISC_CONFIG, 'misc'); configHTML::miscSettings($lists); $config_tabs->endTab(); if (class_exists('auto')) { $config_tabs->startTab(_ACA_LICENSE_CONFIG, 'licence'); auto::licenseSettings($lists); $config_tabs->endTab(); } $config_tabs->endPane(); ?> <input type="hidden" name="option" value="com_acajoom" /> <input type="hidden" name="act" value="configuration" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="task" value="" /> </form> </td></tr></tbody></table> <?php }
function prepList($listEdit) { $lists = array(); $jour = array(); if (ACA_CMSTYPE) { // joomla 15 $my =& JFactory::getUser(); $acl =& JFactory::getACL(); $gtree = $acl->get_group_children_tree(null, 'USERS', false); $jour[] = JHTML::_('select.option', '1800', 'Every 30 minutes'); $jour[] = JHTML::_('select.option', '3600', 'Every hour'); $jour[] = JHTML::_('select.option', '43200', 'Every 12 hours'); $jour[] = JHTML::_('select.option', '1', _ACA_AUTO_DAY_CH1); $jour[] = JHTML::_('select.option', '3', _ACA_AUTO_DAY_CH3); $jour[] = JHTML::_('select.option', '5', _ACA_AUTO_DAY_CH5); $jour[] = JHTML::_('select.option', '6', _ACA_AUTO_DAY_CH6); $jour[] = JHTML::_('select.option', '7', _ACA_AUTO_DAY_CH7); $jour[] = JHTML::_('select.option', '8', _ACA_AUTO_DAY_CH8); $jour[] = JHTML::_('select.option', '9', _ACA_AUTO_DAY_CH9); $auto_option[] = JHTML::_('select.option', '0', _ACA_AUTO_OPTION_NONE); $auto_option[] = JHTML::_('select.option', '1', _ACA_AUTO_OPTION_NEW); if ($listEdit->new_letter == 1) { $auto_option[] = JHTML::_('select.option', '2', _ACA_AUTO_OPTION_ALL); } $lists['delay_min'] = JHTML::_('select.genericlist', $jour, 'delay_min', 'class="inputbox" size="1"', 'value', 'text', $listEdit->delay_min); $lists['gid'] = JHTML::_('select.genericlist', $gtree, 'acc_id', 'size="10"', 'value', 'text', $listEdit->acc_id); $lists['edit_perms'] = JHTML::_('select.genericlist', $gtree, 'acc_level', 'size="10"', 'value', 'text', $listEdit->acc_level); $lists['auto_add'] = JHTML::_('select.genericlist', $auto_option, 'auto_add', 'class="inputbox"', 'value', 'text', $listEdit->auto_add); $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $listEdit->published); $lists['hidden'] = JHTML::_('select.booleanlist', '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'] = JHTML::_('select.booleanlist', 'html', 'class="inputbox"', $listEdit->html); $lists['unsubscribesend'] = JHTML::_('select.booleanlist', "unsubscribesend", 'class="inputbox"', $listEdit->unsubscribesend); $lists['footer'] = JHTML::_('select.booleanlist', "footer", 'class="inputbox"', $listEdit->footer); } else { //joomla 1x global $acl, $my; $gtree = $acl->get_group_children_tree(null, 'USERS', false); $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); $jour[] = mosHTML::makeOption('1800', 'Every 30 minutes'); $jour[] = mosHTML::makeOption('3600', 'Every hour'); $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['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); $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); } //endif $my_group = strtolower($acl->get_group_name($listEdit->acc_id, 'ARO')); return $lists; }
function end_element_param() { $type = mosGetParam($this->paramattrs, 'TYPE', ''); $name = mosGetParam($this->paramattrs, 'NAME', ''); $label = T_(mosGetParam($this->paramattrs, 'LABEL', $name)); $default = T_(mosGetParam($this->paramattrs, 'DEFAULT', '')); if ($description = mosGetParam($this->paramattrs, 'DESCRIPTION', '')) { $tooltip = mosToolTip(T_($description), $name); } else { $tooltip = ''; } if (is_object($this->mosParameter)) { $mp = $this->mosParameter; $value = $mp->get($name, $default); } else { $value = $default; } $this->html[] = '<tr>'; if ($label == '@spacer') { $label = '<hr />'; } elseif ($label) { $label .= ':'; } $this->html[] = '<td width="35%" align="right" valign="top">' . $label . '</td>'; $controlname = $this->name; switch ($type) { case 'text': $size = mosGetParam($this->paramattrs, 'SIZE', 0); $controlstring = '<input type="text" name="' . $this->name . '[' . $name . ']" value="' . $value . '" class="text_area" size="' . $size . '" />'; break; case 'list': $controlstring = mosHTML::selectList($this->options, $controlname . '[' . $name . ']', 'class="inputbox"', 'value', 'text', $value); break; case 'radio': $controlstring = mosHTML::radioList($this->options, $controlname . '[' . $name . ']', '', $value); break; case 'imagelist': $directory = new mosDirectory(mamboCore::get('mosConfig_absolute_path') . mosGetParam($this->paramattrs, 'DIRECTORY', '')); $files = $directory->listFiles('\\.png$|\\.gif$|\\.jpg$|\\.bmp$|\\.ico$'); $options = array(); foreach ($files as $file) { $options[] = mosHTML::makeOption($file, $file); } if (!isset($this->paramattrs['HIDE_NONE'])) { array_unshift($options, mosHTML::makeOption('-1', '- Do not use an image -')); } if (!isset($this->paramattrs['HIDE_DEFAULT'])) { array_unshift($options, mosHTML::makeOption('', '- Use Default image -')); } $controlstring = mosHTML::selectList($options, $controlname . '[' . $name . ']', 'class="inputbox"', 'value', 'text', $value); break; case 'textarea': $rows = mosGetParam($this->paramattrs, 'ROWS', 0); $cols = mosGetParam($this->paramattrs, 'COLS', 0); $value = str_replace('<br />', "\n", $value); $controlstring = "<textarea name='params[{$name}]' cols='{$cols}' rows='{$rows}' class='text_area'>{$value}</textarea>"; break; case 'spacer': $controlstring = $value ? $value : '<hr />'; break; case 'mos_section': $controlstring = $this->_form_mos_section($name, $value, $controlname); break; case 'mos_category': $controlstring = $this->_form_mos_category($name, $value, $controlname); break; case 'mos_menu': $controlstring = $this->_form_mos_menu($name, $value, $controlname); break; default: $controlstring = T_('Handler not defined for type') . '=' . $type; } // $this->html[] = "<td>$type</td>"; $this->html[] = "<td>{$controlstring}</td>"; $this->html[] = "<td width='10%' align='left' valign='top'>{$tooltip}</td>"; $this->html[] = '</tr>'; $this->options = array(); $this->paramattrs = array(); $this->paramcount++; }