本文整理汇总了PHP中XoopsFormSelect::render方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsFormSelect::render方法的具体用法?PHP XoopsFormSelect::render怎么用?PHP XoopsFormSelect::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsFormSelect
的用法示例。
在下文中一共展示了XoopsFormSelect::render方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
function render()
{
$name = $this->getName();
$s = htmlspecialchars(isset($_REQUEST[$name . '_s']) ? $_REQUEST[$name . '_s'] : "");
$slab = htmlspecialchars($this->slab);
return "<table cellpadding='0'>\n<tr valign='top'>" . "<td align='center'>" . parent::render() . "<div id='{$name}_page'>" . $this->pagenav . "</div></td>" . "<td width='100%'> <input size='8' name='{$name}_s' id='{$name}_s' value='{$s}' onChange='setSelectUID(\"{$name}\",0);'/><input type='submit' value='{$slab}' onClick='setSelectUID(\"{$name}\", 0); return false;'/></td></tr>\n</table>";
}
示例2: smartobject_addto_edit
function smartobject_addto_edit($options)
{
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
$form = '';
$layout_select = new XoopsFormSelect(_MB_SOBJECT_BLOCKS_ADDTO_LAYOUT, 'options[]', $options[0]);
$layout_select->addOption(0, _MB_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION0);
$layout_select->addOption(1, _MB_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION1);
$layout_select->addOption(2, _MB_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION2);
$layout_select->addOption(3, _MB_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION3);
$form .= $layout_select->getCaption() . ' ' . $layout_select->render() . '<br />';
return $form;
}
示例3: XoopsFormSelectTime
function XoopsFormSelectTime($caption, $name, $value = 0, $format = "%y-%m-%d %h:%i")
{
$value = intval($value);
if (empty($value)) {
$time = time();
$this->year = formatTimestamp($time, 'Y');
$this->month = formatTimestamp($time, 'n');
$this->day = formatTimestamp($time, 'd');
$this->hour = formatTimestamp($time, 'H');
$this->min = formatTimestamp($time, 'i');
$this->sec = date('s', $time);
} else {
$this->year = formatTimestamp($value, 'Y');
$this->month = formatTimestamp($value, 'n');
$this->day = formatTimestamp($value, 'd');
$this->hour = formatTimestamp($value, 'H');
$this->min = formatTimestamp($value, 'i');
$this->sec = date('s', $value);
}
$this->XoopsFormElementTray($caption, '');
$thsy = date('Y');
$year_select = new XoopsFormSelect('', $name . '[year]', $this->year);
// $year_select ->addOptionArray(array($thsy-8=>$thsy-8, $thsy-7, $thsy-6, $thsy-5, $thsy-4, $thsy-3, $thsy-2, $thsy-1, $thsy, $thsy+1));
for ($y = 1970; $y < 2038; $y++) {
$year_select->addOption($y, $y);
}
// GIJ
$month_select = new XoopsFormSelect('', $name . '[month]', $this->month);
$month_select->addOptionArray(array(1 => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12));
$day_select = new XoopsFormSelect('', $name . '[day]', $this->day);
$day_select->addOptionArray(array(1 => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31));
$hour_select = new XoopsFormSelect('', $name . '[hour]', $this->hour);
$hour_select->addOptionArray(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23));
$sixty_option = array();
for ($i = 0; $i < 60; $i++) {
$sixty_option[] = $i;
}
$min_select = new XoopsFormSelect('', $name . '[min]', $this->min);
$min_select->addOptionArray($sixty_option);
$sec_select = new XoopsFormSelect('', $name . '[sec]', $this->sec);
$sec_select->addOptionArray($sixty_option);
$format = preg_replace('/%y/i', $year_select->render(), $format);
$format = preg_replace('/%m/i', $month_select->render(), $format);
$format = preg_replace('/%d/i', $day_select->render(), $format);
$format = preg_replace('/%h/i', $hour_select->render(), $format);
$format = preg_replace('/%i/i', $min_select->render(), $format);
$format = preg_replace('/%s/i', $sec_select->render(), $format);
$base_label = new XoopsFormLabel('', $format);
$this->addElement($base_label);
}
示例4: render
function render($ele_value, $caption, $markupName, $isDisabled, $element, $entry_id)
{
global $xoopsDB, $xoopsUser, $myts;
$renderer = new formulizeElementRenderer();
$form_handler = xoops_getmodulehandler('forms', 'formulize');
$id_form = $element->getVar('id_form');
if ($entry_id != "new") {
$owner = getEntryOwner($entry_id, $id_form);
} else {
$owner = $xoopsUser ? $xoopsUser->getVar('uid') : 0;
}
$formObject = $form_handler->get($id_form);
$isDisabled = false;
if (strstr(getCurrentURL(), "printview.php")) {
$isDisabled = true;
// disabled all elements if we're on the printable view
}
$ele_desc = $element->getVar('ele_desc', "f");
if (strstr($ele_value[2], "#*=:*")) {
// if we've got a link on our hands... -- jwe 7/29/04
// new process for handling links...May 10 2008...new datastructure for formulize 3.0
$boxproperties = explode("#*=:*", $ele_value[2]);
$sourceFid = $boxproperties[0];
$sourceHandle = $boxproperties[1];
$sourceEntryIds = explode(",", trim($boxproperties[2], ","));
// grab the user's groups and the module id
global $regcode;
if ($regcode) {
// if we're dealing with a registration code, determine group membership based on the code
$reggroupsq = q("SELECT reg_codes_groups FROM " . XOOPS_DB_PREFIX . "_reg_codes WHERE reg_codes_code=\"{$regcode}\"");
$groups = explode("&8(%\$", $reggroupsq[0]['reg_codes_groups']);
if ($groups[0] === "") {
unset($groups);
}
// if a code has no groups associated with it, then kill the null value that will be in position 0 in the groups array.
$groups[] = XOOPS_GROUP_USERS;
$groups[] = XOOPS_GROUP_ANONYMOUS;
} else {
$groups = $xoopsUser ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
}
$module_id = getFormulizeModId();
$pgroups = array();
// handle new linkscope option -- August 30 2006
$emptylist = false;
if ($ele_value[3]) {
$scopegroups = explode(",", $ele_value[3]);
if (!in_array("all", $scopegroups)) {
if ($ele_value[4]) {
// limit by user's groups
foreach ($groups as $gid) {
// want to loop so we can get rid of reg users group simply
if ($gid == XOOPS_GROUP_USERS) {
continue;
}
if (in_array($gid, $scopegroups)) {
$pgroups[] = $gid;
}
}
} else {
// just use scopegroups
$pgroups = $scopegroups;
}
if (count($pgroups) == 0) {
// specific scope was specified, and nothing found, so we should show nothing
$emptylist = true;
}
} else {
if ($ele_value[4]) {
// all groups selected, but limiting by user's groups is turned on
foreach ($groups as $gid) {
// want to loop so we can get rid of reg users group simply
if ($gid == XOOPS_GROUP_USERS) {
continue;
}
$pgroups[] = $gid;
}
} else {
// all groups should be used
unset($pgroups);
$allgroupsq = q("SELECT groupid FROM " . $xoopsDB->prefix("groups"));
// . " WHERE groupid != " . XOOPS_GROUP_USERS); // use all groups now, if all groups are picked, with no restrictions on membership or anything, then use all groups
foreach ($allgroupsq as $thisgid) {
$pgroups[] = $thisgid['groupid'];
}
}
}
}
// Note: OLD WAY: if no groups were found, then pguidq will be empty and so all entries will be shown, no restrictions
// NEW WAY: if a specific group(s) was specified, and no match with the current user was found, then we return an empty list
array_unique($pgroups);
// remove duplicate groups from the list
if ($ele_value[6] and count($pgroups) > 0) {
$pgroupsfilter = " (";
$start = true;
foreach ($pgroups as $thisPgroup) {
if (!$start) {
$pgroupsfilter .= " AND ";
}
$pgroupsfilter .= "EXISTS(SELECT 1 FROM " . $xoopsDB->prefix("formulize_entry_owner_groups") . " AS t2 WHERE t2.groupid={$thisPgroup} AND t2.fid={$sourceFid} AND t2.entry_id=t1.entry_id)";
$start = false;
//.........这里部分代码省略.........
示例5: constructElement
//.........这里部分代码省略.........
} else {
$linked_column_values[] = strip_tags(trim($rowlinkedvaluesq[$linked_column_index]));
}
}
}
$linkedElementOptions[$rowlinkedvaluesq[0]] = implode(" - ", $linked_column_values);
}
}
$cachedSourceValuesQ[$sourceValuesQ] = $linkedElementOptions;
/* ALTERED - 20100318 - freeform - jeff/julian - start */
if (!$isDisabled and $ele_value[8] == 1) {
// write the possible values to a cached file so we can look them up easily when we need them, don't want to actually send them to the browser, since it could be huge, but don't want to replicate all the logic that has already gathered the values for us, each time there's an ajax request
$cachedLinkedOptionsFileName = "formulize_linkedOptions_" . str_replace(".", "", microtime(true));
formulize_scandirAndClean(XOOPS_ROOT_PATH . "/cache/", "formulize_linkedOptions_");
$maxLength = 10;
$the_values = array();
asort($linkedElementOptions);
foreach ($linkedElementOptions as $id => $text) {
$the_values[$id] = trans($text);
$thisTextLength = strlen($text);
$maxLength = $thisTextLength > $maxLength ? $thisTextLength : $maxLength;
}
file_put_contents(XOOPS_ROOT_PATH . "/cache/{$cachedLinkedOptionsFileName}", "<?php\n\${$cachedLinkedOptionsFileName} = " . var_export($the_values, true) . ";\n");
$cachedSourceValuesAutocompleteFile[$sourceValuesQ] = $cachedLinkedOptionsFileName;
$cachedSourceValuesAutocompleteLength[$sourceValuesQ] = $maxLength;
}
}
if ($boxproperties[2]) {
$default_value = $boxproperties[2];
$default_value_user = $cachedSourceValuesQ[$sourceValuesQ][$boxproperties[2]];
}
// if we're rendering an autocomplete box
if (!$isDisabled and $ele_value[8] == 1) {
$renderedComboBox = $this->formulize_renderQuickSelect($form_ele_id, $cachedSourceValuesAutocompleteFile[$sourceValuesQ], $default_value, $default_value_user, $cachedSourceValuesAutocompleteLength[$sourceValuesQ]);
$form_ele = new xoopsFormLabel($ele_caption, $renderedComboBox);
$form_ele->setDescription(html_entity_decode($ele_desc, ENT_QUOTES));
} elseif ($isDisabled) {
$disabledOutputText[] = $default_value_user;
}
// only do this if we're rendering a normal element, that is not disabled
if (!$isDisabled and $ele_value[8] == 0) {
$form_ele->addOptionArray($cachedSourceValuesQ[$sourceValuesQ]);
}
// only do this if we're rendering a normal element (may be disabled)
if ($ele_value[8] == 0) {
foreach ($sourceEntryIds as $thisEntryId) {
if (!$isDisabled) {
$form_ele->setValue($thisEntryId);
} else {
$disabledName = $ele_value[1] ? $form_ele_id . "[]" : $form_ele_id;
$disabledHiddenValue[] = "<input type=hidden name=\"{$disabledName}\" value=\"{$thisEntryId}\">";
$disabledOutputText[] = $cachedSourceValuesQ[$sourceValuesQ][$thisEntryId];
// the text value of the option(s) that are currently selected
}
}
}
if ($isDisabled) {
$form_ele = new XoopsFormLabel($ele_caption, implode(", ", $disabledOutputText) . implode("\n", $disabledHiddenValue));
$form_ele->setDescription(html_entity_decode($ele_desc, ENT_QUOTES));
} elseif ($ele_value[8] == 0) {
// this is a hack because the size attribute is private and only has a getSize and not a setSize, setting the size can only be done through the constructor
$count = count($form_ele->getOptions());
$size = $ele_value[0];
$new_size = $count < $size ? $count : $size;
$form_ele->_size = $new_size;
}
示例6: getDataset
}
$ds = getDataset($iddataset);
$smarty->assign("iddataset", $iddataset);
$smarty->assign("datasetContext", $ds['context']);
$smarty->assign("dataset`Method", $ds['method']);
$smarty->assign("score", isset($_POST['score']) ? $_POST['score'] : 0.5);
$docs = getDocuments($iddataset);
$smarty->assign("documents", $docs);
$urlsinativas = new XoopsFormSelect("", "iurls", null, 20);
$urlsinativas->_class = "SelectList";
$urlsinativas->addOptionArray(pegaUrlsInativas($iddataset));
$smarty->assign("lstUrlsInativas", $urlsinativas->render());
$urlsativas = new XoopsFormSelect("", "aurls", null, 20);
$urlsativas->_class = "SelectList";
$urlsativas->addOptionArray(pegaUrlsAtivas($iddataset));
$smarty->assign("lstUrlsAtivas", $urlsativas->render());
$adicionarCoordenador = new XoopsFormButton("", "adicionarurl", ">", "submit");
$smarty->assign("adicionarurl", $adicionarCoordenador->render());
$removerCoordenador = new XoopsFormButton("", "removerurl", "<", "submit");
$smarty->assign("removerurl", $removerCoordenador->render());
$smarty->assign("display_conteudo", "modulo_dataset_urls");
finaliza_request();
break;
case "finalizar":
$iddataset = $_GET["iddataset"];
$sql = sprintf("UPDATE dataset set\r\n\t\t\t\t\t\t\t\tstatus = 'F', \r\n\t\t\t\t\t\t\t\tfinalization_datetime = now()\r\n\t\t\t\t\t\tWHERE id = %s ", $iddataset);
if ($db->query($sql)) {
$smarty->assign("mensagem", "Dataset finalized successfully.");
} else {
$smarty->assign("mensagem", "Error finalizing dataset.");
echo $sql . $db->error();
示例7: XoopsFormRadio
if ($xoopsModuleConfig['enable_karma'] || $xoopsModuleConfig['allow_require_reply']) {
$view_require = $require_reply ? 'require_reply' : ($post_karma ? 'require_karma' : 'require_null');
$radiobox = new XoopsFormRadio(_MD_VIEW_REQUIRE, 'view_require', $view_require);
if ($xoopsModuleConfig['allow_require_reply']) {
$radiobox->addOption('require_reply', _MD_REQUIRE_REPLY);
}
if ($xoopsModuleConfig['enable_karma']) {
$karmas = explode(',', $xoopsModuleConfig['karma_options']);
$karmas = array_map("trim", $karmas);
if (count($karmas) > 1) {
foreach ($karmas as $karma) {
$karma_array[strval($karma)] = intval($karma);
}
$karma_select = new XoopsFormSelect('', "post_karma", $post_karma);
$karma_select->addOptionArray($karma_array);
$radiobox->addOption('require_karma', _MD_REQUIRE_KARMA . $karma_select->render());
}
}
$radiobox->addOption('require_null', _MD_REQUIRE_NULL);
}
$forum_form->addElement($radiobox);
if (!empty($admin_form_action)) {
$approved_radio = new XoopsFormRadioYN(_AM_NEWBB_APPROVE, 'approved', 1, '' . _YES . '', ' ' . _NO . '');
$forum_form->addElement($approved_radio);
}
// backward compatible
if (!class_exists("XoopsSecurity")) {
$post_valid = 1;
$_SESSION['submit_token'] = $post_valid;
$forum_form->addElement(new XoopsFormHidden('post_valid', $post_valid));
}
示例8: index_index
function index_index($start = 0)
{
global $xoopsTpl, $limit;
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
include_once XOOPS_ROOT_PATH . '/modules/myinviter/include/functions.php';
$this_handler = $GLOBALS['myinviter']->getHandler('item');
$session = $GLOBALS['myinviter']->getHelper('session');
$count = $this_handler->getCountByStatus($session->get('status'));
$xoopsTpl->assign('count', $count);
$xoopsTpl->assign('sent', myinviter_getEmailsSent());
$xoopsTpl->assign('status', $session->get('status'));
if ($count > 0) {
if ($count > $limit) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$nav = new XoopsPageNav($count, $limit, $start, 'start', 'op=list');
$xoopsTpl->assign('pag', '<div style="float:left; padding-top:2px;" align="center">' . $nav->renderNav() . '</div>');
} else {
$xoopsTpl->assign('pag', '');
}
$objs = $this_handler->getItems(null, $start, $limit, $session->get('status'));
$xoopsTpl->assign('objs', $this_handler->toArray($objs));
unset($objs);
} else {
$xoopsTpl->assign('pag', '');
}
$select = new XoopsFormSelect('', 'status', $session->get('status'));
$select->addOption(MYINVITER_STATUS_WAITING, _AM_MYINVITER_STATUS_WAITING);
$select->addOption(MYINVITER_STATUS_ERROR, _AM_MYINVITER_STATUS_ERROR);
$select->addOption(MYINVITER_STATUS_BLACKLIST, _AM_MYINVITER_STATUS_BLACKLIST);
$select->addOption(MYINVITER_STATUS_SENT, _AM_MYINVITER_STATUS_SENT);
$select->addOption(MYINVITER_STATUS_NOTSENT, _AM_MYINVITER_STATUS_NOTSENT);
$select->setExtra('onChange="document.form.submit()"');
$xoopsTpl->assign('selectform', $select->render());
$grabdomain = new XoopsFormText('', 'grabdomain', 50, 50, $session->get('domain'));
$xoopsTpl->assign('domainform', $grabdomain->render());
$grabprovider = new XoopsFormSelect('', 'grabprovider', $session->get('provider'));
$providers = explode('|', $GLOBALS['myinviter']->getConfig('providers'));
foreach ($providers as $provider) {
$options[$provider] = $provider;
}
$grabprovider->addOptionArray($options);
$xoopsTpl->assign('providerform', $grabprovider->render());
$grabstart = new XoopsFormText('', 'grabstart', 3, 30, $session->get('start'));
$xoopsTpl->assign('startform', $grabstart->render());
$grablimit = new XoopsFormText('', 'grablimit', 3, 30, $session->get('limit'));
$xoopsTpl->assign('limitform', $grablimit->render());
return $xoopsTpl->fetch(XOOPS_ROOT_PATH . '/modules/myinviter/templates/myinviter_admin_index.html');
}
示例9: render
/**
* prepare HTML for output
*
* @return string
*/
function render()
{
$ret = "";
$formObject = new XoopsFormRadio('', 'rrule_freq', $this->_rrule_freq);
$formObject->addOption('none', _MD_EXTCAL_NO_RECCUR_EVENT);
$ret .= $formObject->render();
$ret .= "<br /><br /><fieldset><legend>" . _MD_EXTCAL_RECCUR_POLICY . "</legend><fieldset><legend>";
$formObject = new XoopsFormRadio('', 'rrule_freq', $this->_rrule_freq);
$formObject->addOption('daily', _MD_EXTCAL_DAILY);
$ret .= $formObject->render();
$ret .= "</legend>" . _MD_EXTCAL_DURING . " ";
$formObject = new XoopsFormText('', 'rrule_daily_interval', 3, 2, $this->_rrule_daily_interval);
$ret .= $formObject->render();
$ret .= " " . _MD_EXTCAL_DAYS . "</fieldset><br /><fieldset><legend>";
$formObject = new XoopsFormRadio('', 'rrule_freq', $this->_rrule_freq);
$formObject->addOption('weekly', _MD_EXTCAL_WEEKLY);
$ret .= $formObject->render();
$ret .= "</legend>" . _MD_EXTCAL_DURING . " ";
$formObject = new XoopsFormText('', 'rrule_weekly_interval', 3, 2, $this->_rrule_weekly_interval);
$ret .= $formObject->render();
$ret .= " " . _MD_EXTCAL_WEEKS . "<br />";
$formObject = new XoopsFormCheckBox('', 'rrule_weekly_bydays');
$formObject->addOption('MO', 'Mo ');
$formObject->addOption('TU', 'Tu ');
$formObject->addOption('WE', 'We ');
$formObject->addOption('TH', 'Th ');
$formObject->addOption('FR', 'Fr ');
$formObject->addOption('SA', 'Sa ');
$formObject->addOption('SU', 'Su ');
$ret .= $formObject->render();
$ret .= "</fieldset><br /><fieldset><legend>";
$formObject = new XoopsFormRadio('', 'rrule_freq', $this->_rrule_freq);
$formObject->addOption('monthly', _MD_EXTCAL_MONTHLY);
$ret .= $formObject->render();
$ret .= "</legend>" . _MD_EXTCAL_DURING . " ";
$formObject = new XoopsFormText('', 'rrule_monthly_interval', 3, 2, $this->_rrule_monthly_interval);
$ret .= $formObject->render();
$ret .= " " . _MD_EXTCAL_MONTH . ", " . _MD_EXTCAL_ON . " ";
$formObject = new XoopsFormSelect('', 'rrule_monthly_byday', $this->_rrule_weekly_bydays);
$formObject->addOption('', ' ');
$formObject->addOption('1MO', _MD_EXTCAL_1_MO);
$formObject->addOption('1TU', _MD_EXTCAL_1_TU);
$formObject->addOption('1WE', _MD_EXTCAL_1_WE);
$formObject->addOption('1TH', _MD_EXTCAL_1_TH);
$formObject->addOption('1FR', _MD_EXTCAL_1_FR);
$formObject->addOption('1SA', _MD_EXTCAL_1_SA);
$formObject->addOption('1SU', _MD_EXTCAL_1_SU);
$formObject->addOption('2MO', _MD_EXTCAL_2_MO);
$formObject->addOption('2TU', _MD_EXTCAL_2_TU);
$formObject->addOption('2WE', _MD_EXTCAL_2_WE);
$formObject->addOption('2TH', _MD_EXTCAL_2_TH);
$formObject->addOption('2FR', _MD_EXTCAL_2_FR);
$formObject->addOption('2SA', _MD_EXTCAL_2_SA);
$formObject->addOption('2SU', _MD_EXTCAL_2_SU);
$formObject->addOption('3MO', _MD_EXTCAL_3_MO);
$formObject->addOption('3TU', _MD_EXTCAL_3_TU);
$formObject->addOption('3WE', _MD_EXTCAL_3_WE);
$formObject->addOption('3TH', _MD_EXTCAL_3_TH);
$formObject->addOption('3FR', _MD_EXTCAL_3_FR);
$formObject->addOption('3SA', _MD_EXTCAL_3_SA);
$formObject->addOption('3SU', _MD_EXTCAL_3_SU);
$formObject->addOption('4MO', _MD_EXTCAL_4_MO);
$formObject->addOption('4TU', _MD_EXTCAL_4_TU);
$formObject->addOption('4WE', _MD_EXTCAL_4_WE);
$formObject->addOption('4TH', _MD_EXTCAL_4_TH);
$formObject->addOption('4FR', _MD_EXTCAL_4_FR);
$formObject->addOption('4SA', _MD_EXTCAL_4_SA);
$formObject->addOption('4SU', _MD_EXTCAL_4_SU);
$formObject->addOption('-1MO', _MD_EXTCAL_LAST_MO);
$formObject->addOption('-1TU', _MD_EXTCAL_LAST_TU);
$formObject->addOption('-1WE', _MD_EXTCAL_LAST_WE);
$formObject->addOption('-1TH', _MD_EXTCAL_LAST_TH);
$formObject->addOption('-1FR', _MD_EXTCAL_LAST_FR);
$formObject->addOption('-1SA', _MD_EXTCAL_LAST_SA);
$formObject->addOption('-1SU', _MD_EXTCAL_LAST_SU);
$ret .= $formObject->render();
$ret .= " " . _MD_EXTCAL_OR_THE . " ";
$formObject = new XoopsFormText('', 'rrule_bymonthday', 3, 2, $this->_rrule_bymonthday);
$ret .= $formObject->render();
$ret .= " " . _MD_EXTCAL_DAY_NUM_MONTH . "</fieldset><br /><fieldset><legend>";
$formObject = new XoopsFormRadio('', 'rrule_freq', $this->_rrule_freq);
$formObject->addOption('yearly', 'Yearly');
$ret .= $formObject->render();
$ret .= "</legend>" . _MD_EXTCAL_DURING . " ";
$formObject = new XoopsFormText('', 'rrule_yearly_interval', 3, 2, $this->_rrule_yearly_interval);
$ret .= $formObject->render();
$ret .= ' ' . _MD_EXTCAL_YEARS . '<br />';
$formObject = new ExtcalFormRRuleCheckBox('', 'rrule_yearly_bymonths', $this->_rrule_yearly_bymonths);
$formObject->addOption('1', 'Jan');
$formObject->addOption('2', 'Fev');
$formObject->addOption('3', 'Mar');
$formObject->addOption('4', 'Apr');
$formObject->addOption('5', 'Mai');
$formObject->addOption('6', 'Jun');
$formObject->addOption('7', 'Jul');
//.........这里部分代码省略.........
示例10: store_entry
if (is_array($field)) {
$field['value'] = $v;
}
if (preg_match('/\\*$/', $field['label'])) {
$rname = $field['name'];
$require[$rname] = preg_replace('/\\*$/', '', $field['label']);
}
if ($field['weight']) {
$form[$k] = $field;
}
}
// status setting only by admin
if ($isadmin) {
$status = new XoopsFormSelect('', 'status', $content->getVar('status'));
$status->addOptionArray($status_sel);
$form['status'] = array('name' => 'status', 'label' => _MD_CONTENT_STATUS, 'input' => $status->render());
}
$xoopsTpl->assign('form', $form);
$xoopsTpl->assign('check', $require);
$xoopsTpl->assign('is_uploads', check_groups('user_upload'));
if ($isadmin || !empty($xoopsModuleConfig['user_acl'])) {
$acls = $preview ? ml_parse_acl() : ml_get_acl($mid);
$xoopsTpl->assign('acls', $acls);
}
$xoopsTpl->assign('form', $form);
include XOOPS_ROOT_PATH . "/footer.php";
function store_entry(&$content)
{
$myts =& MyTextSanitizer::getInstance();
$nop = array('mtime', 'ctime', 'poster', 'hits');
$keys = array();
示例11: sprintf
*/
$sql = sprintf('SELECT created from %s group by left(from_unixtime(created+%d)+0,6) order by created DESC', $xoopsDB->prefix($mydirname), $useroffset * 3600, '%Y%');
$month_result = $xoopsDB->query($sql);
$last_year = 100000;
$months = array('' => _BL_SELECT_ALL);
while ($created_example = $xoopsDB->fetchArray($month_result)) {
list($this_year, $this_month) = explode(':', date('Y:m', $created_example['created']));
if ($last_year > $this_year) {
$last_year = $this_year;
$months[$this_year] = $this_year . ' ' . _BL_SELECT_ALL;
}
$months[$this_year . $this_month] = $this_year . ' ' . $months_arr[intval($this_month)];
}
$selbox_month = new XoopsFormSelect('', 'date', $date);
$selbox_month->addOptionArray($months);
$xoopsTpl->assign("dateselbox", $selbox_month->render());
/*****************************
* Get Entries
*****************************/
$results = $weblog->getEntriesForArchives($currentuid, $user_id, $date, $cat_id, $start, $numperpage, 'DESC', $useroffset);
$count = $weblog->getCountByDate($currentuid, $cat_id, $user_id, $date, $useroffset);
if (count($results) > 0) {
$xoopsTpl->assign('show_archives', true);
$xoopsTpl->assign(makeTplVars());
} else {
$xoopsTpl->assign('show_archives', false);
$xoopsTpl->assign('lang_noarchives', _BL_NOARCHIVEDESC);
}
$xoopsTpl->assign('page_title', $xoopsModule->name());
$xoopsTpl->assign('page_subtitle', $page_subtitle);
$xoopsTpl->assign('xoops_weblogdir', $xoopsModule->dirname());
示例12: adminPrepare
function adminPrepare($element)
{
$fid = $element ? $element->getVar('id_form') : intval($_GET['fid']);
$ele_value = $element ? $element->getVar('ele_value') : array();
if (!$element) {
//Specify default ele_values
$ele_value[0] = "";
$ele_value[1] = 0;
$ele_value[2] = "";
$ele_value[3] = ".";
$ele_value[4] = ",";
}
$derivedOptions = array();
$allColList = getAllColList($fid);
foreach ($allColList[$fid] as $thisCol) {
if ($thisCol['ele_colhead'] != "") {
$derivedOptions[trans($thisCol['ele_colhead'])] = printSmart(trans($thisCol['ele_colhead']));
} else {
$derivedOptions[trans(strip_tags($thisCol['ele_caption']))] = printSmart(trans(strip_tags($thisCol['ele_caption'])));
}
}
$listOfElements = new XoopsFormSelect("", 'listofelementsoptions');
$listOfElements->addOptionArray($derivedOptions);
$listofelementsoptions = $listOfElements->render();
return array('listofelementsoptions' => $listofelementsoptions, 'ele_value' => $ele_value);
}
示例13: mymenus_block_edit
function mymenus_block_edit($options)
{
//Unique ID
if (!$options[3] || isset($_GET['op']) && $_GET['op'] == 'clone') {
$options[3] = time();
}
$menus_handler =& xoops_getModuleHandler('menus', 'mymenus');
xoops_loadLanguage('admin', 'mymenus');
$criteria = new CriteriaCompo();
$criteria->setSort('title');
$criteria->setOrder('ASC');
$menus = $menus_handler->getList($criteria);
unset($criteria);
if (count($menus) == 0) {
$form = "<a href='" . $GLOBALS['xoops']->url('modules/mymenus/admin/admin_menus.php') . "'>" . _AM_MYMENUS_MSG_NOMENUS . "</a>";
return $form;
}
xoops_load('XoopsFormLoader');
//Menu
$form = "<b>" . _MB_MYMENUS_SELECT_MENU . "</b> ";
$element = new XoopsFormSelect('', 'options[0]', $options[0], 1);
$element->addOptionArray($menus);
$form .= $element->render();
$form .= "</select>\n <i>" . _MB_MYMENUS_SELECT_MENU_DSC . "</i><br /><br />";
//Skin
xoops_load('XoopsLists');
$temp_skins = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . "/modules/mymenus/skins/", "");
$skins_options = array();
foreach ($temp_skins as $key => $skin) {
if (file_exists($GLOBALS['xoops']->path('modules/mymenus/skins/' . $skin . '/skin_version.php'))) {
$skins_options[$skin] = $skin;
}
}
$form .= "<b>" . _MB_MYMENUS_SELECT_SKIN . "</b> ";
$element = new XoopsFormSelect('', 'options[1]', $options[1], 1);
$element->addOptionArray($skins_options);
$form .= $element->render();
$form .= "</select>\n <i>" . _MB_MYMENUS_SELECT_SKIN_DSC . "</i><br /><br />";
//Use skin from,theme
$form .= "<b>" . _MB_MYMENUS_USE_THEME_SKIN . "</b> ";
$element = new XoopsFormRadioYN('', 'options[2]', $options[2]);
$form .= $element->render();
$form .= "</select>\n <i>" . _MB_MYMENUS_USE_THEME_SKIN_DSC . "</i><br /><br />";
//Display method
$display_options = array('block' => _MB_MYMENUS_DISPLAY_METHOD_BLOCK, 'template' => _MB_MYMENUS_DISPLAY_METHOD_TEMPLATE);
$form .= "<b>" . _MB_MYMENUS_DISPLAY_METHOD . "</b> ";
$element = new XoopsFormSelect('', 'options[3]', $options[3], 1);
$element->addOptionArray($display_options);
$form .= $element->render();
$form .= "</select>\n <i>" . _MB_MYMENUS_DISPLAY_METHOD_DSC . "</i><br /><br />";
//Unique ID
$form .= "<b>" . _MB_MYMENUS_UNIQUEID . "</b> ";
$element = new XoopsFormText('', 'options[4]', 10, 50, $options[4]);
$form .= $element->render();
$form .= "\n <i>" . _MB_MYMENUS_UNIQUEID_DSC . "</i><br /><br />";
return $form;
}
示例14: array
$options['listofelementsoptions'] = $listOfElements->render();
//new relationship dropdown
$framework_handler = xoops_getmodulehandler('frameworks', 'formulize');
$allRelationships = $framework_handler->getFrameworksByForm($fid);
$relationships = array();
$relationshipIndex = array();
$relationships[""] = "this form only, no relationship.";
foreach ($allRelationships as $thisRelationship) {
$frid = $thisRelationship->getVar('frid');
if (!isset($relationships[$frid])) {
$relationships[$frid] = $thisRelationship->getVar('name');
}
}
$listOfRelationships = new XoopsFormSelect("", 'listofrelationshipoptions');
$listOfRelationships->addOptionArray($relationships);
$options['listofrelationshipoptions'] = $listOfRelationships->render();
//end of new relationship
} elseif ($ele_type == "yn") {
$options['ele_value_yes'] = $ele_value['_YES'];
$options['ele_value_no'] = $ele_value['_NO'];
} elseif ($ele_type == "subform") {
$ele_value[1] = explode(",", $ele_value[1]);
global $xoopsDB;
$validForms1 = q("SELECT t1.fl_form1_id, t2.desc_form FROM " . $xoopsDB->prefix("formulize_framework_links") . " AS t1, " . $xoopsDB->prefix("formulize_id") . " AS t2 WHERE t1.fl_form2_id=" . intval($fid) . " AND t1.fl_unified_display=1 AND t1.fl_relationship != 1 AND t1.fl_form1_id=t2.id_form");
$validForms2 = q("SELECT t1.fl_form2_id, t2.desc_form FROM " . $xoopsDB->prefix("formulize_framework_links") . " AS t1, " . $xoopsDB->prefix("formulize_id") . " AS t2 WHERE t1.fl_form1_id=" . intval($fid) . " AND t1.fl_unified_display=1 AND t1.fl_relationship != 1 AND t1.fl_form2_id=t2.id_form");
$caughtfirst = false;
foreach ($validForms1 as $vf1) {
$validForms[$vf1['fl_form1_id']] = $vf1['desc_form'];
if (!$caughtfirst) {
$firstform = $vf1['fl_form1_id'];
$caughtfirst = true;
示例15: empty
function b_weblog_links_edit($options)
{
global $xoopsDB, $xoopsUser;
$mydirname = empty($options[0]) ? basename(dirname(dirname(__FILE__))) : $options[0];
$apply_linkmodules = array('mylinks', 'weblinks');
$linkmods = "";
foreach ($apply_linkmodules as $modulename) {
$linkmods .= "dirname like '" . $modulename . "%' or ";
}
$mod_sql = sprintf("select dirname from %s where isactive=1 and (%s) ", $xoopsDB->prefix('modules'), rtrim($linkmods, " or"));
$mod_result = $xoopsDB->query($mod_sql);
if ($xoopsDB->getRowsNum($mod_result) == 0) {
return false;
}
include_once XOOPS_ROOT_PATH . "/class/xoopsform/formelement.php";
include_once XOOPS_ROOT_PATH . "/class/xoopsform/formselect.php";
$selectbox = new XoopsFormSelect("", "options[]", $options[0]);
$selectbox->addOption("", "---");
while ($modinfo = $xoopsDB->fetchArray($mod_result)) {
$selectbox->addOption($modinfo['dirname']);
}
$link_module_selectbox = $selectbox->render();
$form = '<table>';
$form .= "<input type='hidden' name='options[]' value='{$mydirname}' />\n";
$form .= sprintf('<tr><td><b>%s</b>:</td><td>%s</td></tr>', _MB_WEBLOG_EDIT_LINKS_MODULE, $link_module_selectbox);
$form .= sprintf('<tr><td><b>%s</b>:</td><td><input type="text" name="options[]" value="%d" size="2" maxlength="2" /></td></tr>', _MB_WEBLOG_EDIT_LINKS_NUMBER, intval($options[1]));
$form .= sprintf('<tr><td><b>%s</b>:</td><td><input type="text" name="options[]" value="%d" size="2" maxlength="2" /></td></tr>', _MB_WEBLOG_EDIT_LINKS_ONLYPOST, intval($options[2]));
$form .= sprintf('<tr><td><b>%s</b>:</td><td><input type="text" name="options[]" value="%d" size="2" maxlength="2" /></td></tr>', _MB_WEBLOG_EDIT_LINKS_SHOWDSC, intval($options[3]));
$form .= '</table>';
return $form;
}