コード例 #1
0
ファイル: admin_chat.php プロジェクト: erico-deh/ocPortal
 /**
  * Standard aed_module edit form filler.
  *
  * @param  ID_TEXT		The entry being edited
  * @return array			A tuple of information
  */
 function fill_in_edit_form($id)
 {
     $rows = $GLOBALS['SITE_DB']->query_select('chat_rooms', array('*'), array('id' => intval($id)), '', 1);
     if (!array_key_exists(0, $rows)) {
         warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
     }
     $row = $rows[0];
     $allow2 = $row['allow_list'];
     $allow2_groups = $row['allow_list_groups'];
     $disallow2 = $row['disallow_list'];
     $disallow2_groups = $row['disallow_list_groups'];
     $username = $GLOBALS['FORUM_DRIVER']->get_username($row['room_owner']);
     if (is_null($username)) {
         $username = '';
     }
     //do_lang('UNKNOWN');
     $fields = get_chatroom_fields(false, $row['room_name'], get_translated_text($row['c_welcome']), $username, $allow2, $allow2_groups, $disallow2, $disallow2_groups);
     // Permissions
     $fields->attach($this->get_permission_fields($id));
     $delete_fields = new ocp_tempcode();
     $logs_url = build_url(array('page' => 'chat', 'type' => 'download_logs', 'id' => $id), get_module_zone('chat'));
     $delete_fields->attach(form_input_tick(do_lang_tempcode('DELETE'), do_lang_tempcode('DESCRIPTION_DELETE_CHAT_ROOM', escape_html($logs_url->evaluate())), 'delete', false));
     return array($fields, new ocp_tempcode(), $delete_fields, NULL, true);
 }
コード例 #2
0
ファイル: chat.php プロジェクト: erico-deh/ocPortal
 /**
  * The UI to create a private chat room.
  *
  * @return tempcode		The UI
  */
 function chat_private()
 {
     require_code('chat2');
     if (is_guest()) {
         access_denied('NOT_AS_GUEST');
     }
     check_specific_permission('create_private_room');
     // This function instantiates a private room...WE MUST BE TIGHT ON SECURITY WITH THIS ONE!
     $title = get_page_title('CREATE_PRIVATE_ROOM');
     require_code('form_templates');
     $fields = get_chatroom_fields(true, do_lang('CHAT_PRIVATE_DEFAULT_ROOM_NAME', escape_html($GLOBALS['FORUM_DRIVER']->get_username(get_member()))), '', '', strval(get_member()));
     $posting_name = do_lang_tempcode('CREATE_PRIVATE_ROOM');
     $posting_url = build_url(array('page' => '_SELF', 'type' => '_private'), '_SELF');
     $text = paragraph(do_lang_tempcode('CHAT_PRIVATE_ROOM_DESCRIPTION', display_time_period(60 * intval(get_option('chat_private_room_deletion_time')))));
     if (intval(get_option('chat_private_room_deletion_time')) == 0) {
         $text = new ocp_tempcode();
     }
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('CHAT_LOBBY'))));
     return do_template('FORM_SCREEN', array('_GUID' => '5697add8e81f641559a212697d35a470', 'HIDDEN' => '', 'TITLE' => $title, 'FIELDS' => $fields, 'SUBMIT_NAME' => $posting_name, 'URL' => $posting_url, 'TEXT' => $text));
 }