Пример #1
0
            $select.$search_info->sql.$search_info->order,
            $search_info->params,
            $start,
            DIALOG_SEARCH_NUM_PER_PAGE
        );
    }

    if ($total) {
        if ($results) {
            $pagingbar = new paging_bar($total, $page, DIALOG_SEARCH_NUM_PER_PAGE, $thisurl);
            $pagingbar->pagevar = 'page';
            $output = $OUTPUT->render($pagingbar);
            echo html_writer::tag('div',$output, array('class' => "search-paging"));

            // Generate some treeview data
            $dialog = new dialog_content();
            $dialog->items = array();
            $dialog->parent_items = array();
            $dialog->disabled_items = $this->disabled_items;

            foreach ($results as $result) {
                $item = new stdClass();

                if (method_exists($this, 'search_can_display_result') && !$this->search_can_display_result($result->id)) {
                   continue;
                }

                $item->id = $result->id;
                if (isset($result->email)) {
                    $username = new stdClass();
                    $username->fullname = $result->fullname;
    /**
     * Generate markup, but first merge categories and courses together
     *
     * @access  public
     * @return  string
     */
    public function generate_markup() {

        // Merge categories and courses (courses to follow categories)
        $categories = is_array($this->categories) ? $this->categories : array();
        $courses = is_array($this->courses) ? $this->courses : array();

        $this->items = array_merge($categories, $courses);

        return parent::generate_markup();
    }
    /**
     * Generate markup, but first merge categories and programs together
     *
     * @access  public
     * @return  string
     */
    public function generate_markup() {

        // Merge categories and program (programs to follow categories)
        $this->items = array_merge($this->categories, $this->programs);

        return parent::generate_markup();
    }
Пример #4
0
        $roomobject->id = $room->id;
        $roomobject->fullname = get_string('predefinedroom', 'facetoface', $room);
        $allrooms[$room->id] = $roomobject;
    }
    $availablerooms = facetoface_get_available_rooms($timeslotsarray, 'id', array($sessionid));
    if ($unavailablerooms = array_diff(array_keys($allrooms), array_keys($availablerooms))) {
        $unavailablerooms = array_combine($unavailablerooms, $unavailablerooms);  // make array keys and values the same
        //add alreadybooked string to fullname
        foreach ($unavailablerooms as $key => $unavailable) {
            if (isset($allrooms[$key])) {
                $allrooms[$key]->fullname .= get_string('roomalreadybooked', 'facetoface');
            }
        }
    }
} else {
    $allrooms = array();
    $unavailablerooms = array();
}

// Display page
$dialog = new dialog_content();
$dialog->searchtype = 'facetoface_room';
$dialog->items = $allrooms;
$dialog->disabled_items = $unavailablerooms;
$dialog->lang_file = 'facetoface';
$dialog->customdata['timeslots'] = $timeslots;
$dialog->customdata['sessionid'] = $sessionid;
$dialog->string_nothingtodisplay = 'error:nopredefinedrooms';

echo $dialog->generate_markup();