function getTopicStatusSelect($select_name, $selected_status = null) { $statuses = Subscriptions::getTopicStatusesNames(); $options = array(); foreach ($statuses as $status => $status_name) { $options[] = array('value' => $status, 'contents' => $status_name); } return HtmlForm::genDropdownSingleChoice(array('select_name' => $select_name, 'values' => $options, 'selected_value' => $selected_status)); }
function updateTopic($topic_id, $topic_name, $topic_status, $topic_access, $topic_auto) { $statuses = Subscriptions::getTopicStatusesNames(); if (!isset($statuses[$topic_status])) { $topic_status = SUBSCRIPTION_TOPIC_CANNOT_SUBSCRIBE; } return execQuery('SUBSCR_UPDATE_TOPIC', array('topic_name' => $topic_name, 'topic_id' => $topic_id, 'topic_status' => $topic_status, 'topic_access' => $topic_access, 'topic_auto' => $topic_auto)); }
function getTopicStatusSelect($select_name, $selected_status = null) { $statuses = Subscriptions::getTopicStatusesNames(); if (empty($selected_status)) { $selected_status = SUBSCRIPTION_TOPIC_ACTIVE; } $options = array(); foreach ($statuses as $status => $status_name) { $options[] = array('value' => $status, 'contents' => $status_name); } return HtmlForm::getRadio(array('select_name' => $select_name, 'values' => $options, 'selected_value' => $selected_status)); }