* @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('MENUITEM', 'myportfolio/views');
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'view');
define('SECTION_PAGE', 'index');
require dirname(dirname(__FILE__)) . '/init.php';
require_once get_config('libroot') . 'view.php';
require_once 'pieforms/pieform.php';
define('TITLE', get_string('Views', 'view'));
$offset = param_integer('offset', 0);
list($searchform, $data, $pagination) = View::views_by_owner();
$js = <<<EOF
addLoadEvent(function () {
    p = {$pagination['javascript']}
EOF;
if ($offset > 0) {
    $js .= <<<EOF
    if (\$('myviews')) {
        getFirstElementByTagAndClassName('a', null, 'myviews').focus();
    }
EOF;
} else {
    $js .= <<<EOF
    if (\$('searchresultsheading')) {
        addElementClass('searchresultsheading', 'hidefocus');
        setNodeAttribute('searchresultsheading', 'tabIndex', -1);
 *
 */
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'configsite/siteviews');
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'siteviews');
require dirname(dirname(dirname(__FILE__))) . '/init.php';
require_once get_config('libroot') . 'view.php';
require_once 'pieforms/pieform.php';
$title = get_string('siteviews', 'admin');
define('TITLE', $title);
$offset = param_integer('offset', 0);
$templateviews = View::get_template_views();
list($searchform, $data, $pagination) = View::views_by_owner(null, 'mahara');
if ($data->data) {
    $views = array_merge($templateviews, $data->data);
} else {
    $views = $templateviews;
}
$js = <<<EOF
addLoadEvent(function () {
    p = {$pagination['javascript']}
EOF;
if ($offset > 0) {
    $js .= <<<EOF
    if (\$('myviews')) {
        getFirstElementByTagAndClassName('a', null, 'myviews'). focus();
    }
EOF;
Exemple #3
0
    if ($limit > 0 && $limit != $userlimit) {
        $USER->set_account_preference('viewsperpage', $limit);
    } else {
        $limit = $userlimit;
    }
    $offset = param_integer('offset', 0);
    $data = View::view_search(null, null, (object) array('group' => $group->id), null, $limit, $offset);
    // Add a copy view form for all templates in the list
    foreach ($data->data as &$v) {
        if ($v['template']) {
            $v['copyform'] = pieform(create_view_form(null, null, $v['id']));
        }
    }
    $pagination = build_pagination(array('url' => get_config('wwwroot') . 'view/groupviews.php?group=' . $group->id, 'count' => $data->count, 'limit' => $limit, 'offset' => $offset, 'setlimit' => $setlimit, 'jumplinks' => 6, 'numbersincludeprevnext' => 2));
} else {
    list($searchform, $data, $pagination) = View::views_by_owner($group->id);
    $createviewform = pieform(create_view_form($group->id));
}
$js = <<<EOF
addLoadEvent(function () {
    p = {$pagination['javascript']}
EOF;
if ($offset > 0) {
    $js .= <<<EOF
    if (\$('groupviews')) {
        getFirstElementByTagAndClassName('a', null, 'groupviews').focus();
    }
    if (\$('myviews')) {
        getFirstElementByTagAndClassName('a', null, 'myviews').focus();
    }
EOF;
            }
        }
    }
    sorttablebycolumn($commenters, 'count', 'desc');
    $data['mcommenters'] = $membercommenters;
    $data['ecommenters'] = $extcommenters;
    $data['mcomments'] = $membercomments;
    $data['ecomments'] = $extcomments;
    $data['comments'] = $commenters;
    $data['baseurl'] = $needsubdomain ? $view->get_url(true) : $wwwroot . $view->get_url(false);
}
if (in_array($sort, array('title', 'sharedby', 'mcomments', 'ecomments'))) {
    sorttablebycolumn($sharedviews, $sort, $direction);
}
$sharedviews = array_slice($sharedviews, $offset, $limit);
list($searchform, $groupviews, $unusedpagination) = View::views_by_owner($group->id);
$groupviews = $groupviews->data;
$groupviewscount = count($groupviews);
foreach ($groupviews as &$data) {
    $view = new View($data['id']);
    $comments = ArtefactTypeComment::get_comments(0, 0, null, $view);
    $extcommenters = 0;
    $membercommenters = 0;
    $extcomments = 0;
    $membercomments = 0;
    $commenters = array();
    foreach ($comments->data as $c) {
        if (empty($c->author)) {
            if (!isset($commenters[$c->authorname])) {
                $commenters[$c->authorname] = array();
            }
Exemple #5
0
require_once get_config('libroot') . 'institution.php';
require_once 'pieforms/pieform.php';
$institution = param_alpha('institution', false);
$offset = param_integer('offset', 0);
if ($institution == 'mahara') {
    redirect('/admin/site/views.php');
}
$s = institution_selector_for_page($institution, get_config('wwwroot') . 'view/institutionviews.php');
$institution = $s['institution'];
define('TITLE', get_string('institutionviews', 'view'));
if ($institution === false) {
    $smarty = smarty();
    $smarty->display('admin/users/noinstitutions.tpl');
    exit;
}
list($searchform, $data, $pagination) = View::views_by_owner(null, $institution);
$js = <<<EOF
addLoadEvent(function () {
    p = {$pagination['javascript']}
EOF;
if ($offset > 0) {
    $js .= <<<EOF
    if (\$('myviews')) {
        getFirstElementByTagAndClassName('a', null, 'myviews').focus();
    }
EOF;
} else {
    $js .= <<<EOF
    if (\$('searchresultsheading')) {
        addElementClass('searchresultsheading', 'hidefocus');
        setNodeAttribute('searchresultsheading', 'tabIndex', -1);