* @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.
 * @copyright  (C) 2010-2013 Gregor Anzelj <*****@*****.**>
 *
 */
define('INTERNAL', true);
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'skin');
define('SECTION_PAGE', 'design');
require_once dirname(dirname(__FILE__)) . '/init.php';
require_once 'skin.php';
require_once 'pieforms/pieform.php';
safe_require('artefact', 'file');
$fieldset = param_alpha('fs', 'viewskin');
$designsiteskin = param_boolean('site', false);
if (!can_use_skins(null, $designsiteskin)) {
    throw new FeatureNotEnabledException();
}
if ($designsiteskin) {
    define('ADMIN', 1);
    if (!$USER->get('admin')) {
        $SESSION->add_error_msg(get_string('accessforbiddentoadminsection'));
        redirect();
    }
    define('MENUITEM', 'configsite/siteskins');
    $goto = '/admin/site/skins.php';
    $redirect = '/admin/site/skins.php';
} else {
    define('MENUITEM', 'myportfolio/skins');
    $goto = '/skin/index.php';
    $redirect = '/skin/index.php';
Example #2
0
/**
 * Returns the entries in the standard user menu
 *
 * See the function find_menu_children() in lib/web.php
 * for a description of the expected array structure.
 *
 * @return $standardnav a data structure containing the standard navigation
 */
function mahara_standard_nav()
{
    global $SESSION;
    $exportenabled = plugins_installed('export') && !$SESSION->get('handheld_device') ? TRUE : FALSE;
    $menu = array('home' => array('path' => 'home', 'url' => '', 'title' => get_string('dashboard', 'view'), 'weight' => 10, 'accesskey' => 'd'), 'content' => array('path' => 'content', 'url' => 'artefact/internal/index.php', 'title' => get_string('Content'), 'weight' => 20, 'accesskey' => 'c'), 'myportfolio' => array('path' => 'myportfolio', 'url' => 'view/index.php', 'title' => get_string('myportfolio'), 'weight' => 30, 'accesskey' => 'p'), 'myportfolio/views' => array('path' => 'myportfolio/views', 'url' => 'view/index.php', 'title' => get_string('Views', 'view'), 'weight' => 10), 'myportfolio/share' => array('path' => 'myportfolio/share', 'url' => 'view/share.php', 'title' => get_string('sharedbyme', 'view'), 'weight' => 30), 'myportfolio/sharedviews' => array('path' => 'myportfolio/sharedviews', 'url' => 'view/sharedviews.php', 'title' => get_string('sharedwithme', 'view'), 'weight' => 60), 'myportfolio/export' => array('path' => 'myportfolio/export', 'url' => 'export/index.php', 'title' => get_string('Export', 'export'), 'weight' => 70, 'ignore' => !$exportenabled), 'myportfolio/import' => array('path' => 'myportfolio/import', 'url' => 'import/index.php', 'title' => get_string('Import', 'import'), 'weight' => 80), 'myportfolio/collection' => array('path' => 'myportfolio/collection', 'url' => 'collection/index.php', 'title' => get_string('Collections', 'collection'), 'weight' => 20), 'groups' => array('path' => 'groups', 'url' => 'group/mygroups.php', 'title' => get_string('groups'), 'weight' => 40, 'accesskey' => 'g'), 'groups/mygroups' => array('path' => 'groups/mygroups', 'url' => 'group/mygroups.php', 'title' => get_string('mygroups'), 'weight' => 10), 'groups/find' => array('path' => 'groups/find', 'url' => 'group/find.php', 'title' => get_string('findgroups'), 'weight' => 20), 'groups/myfriends' => array('path' => 'groups/myfriends', 'url' => 'user/myfriends.php', 'title' => get_string('myfriends'), 'weight' => 30), 'groups/findfriends' => array('path' => 'groups/findfriends', 'url' => 'user/find.php', 'title' => get_string('findfriends'), 'weight' => 40), 'groups/institutionmembership' => array('path' => 'groups/institutions', 'url' => 'account/institutions.php', 'title' => get_string('institutionmembership'), 'weight' => 50));
    if (can_use_skins()) {
        $menu['myportfolio/skins'] = array('path' => 'myportfolio/skins', 'url' => 'skin/index.php', 'title' => get_string('myskins', 'skin'), 'weight' => 65);
    }
    return $menu;
}
Example #3
0
$commentoptions->offset = $offset;
$commentoptions->showcomment = $showcomment;
$commentoptions->view = $view;
$feedback = ArtefactTypeComment::get_comments($commentoptions);
// Set up theme
$viewtheme = $view->get('theme');
if ($viewtheme && $THEME->basename != $viewtheme) {
    $THEME = new Theme($viewtheme);
}
$headers = array();
$headers[] = '<link rel="stylesheet" type="text/css" href="' . append_version_number(get_config('wwwroot') . 'js/jquery/jquery-ui/css/ui-lightness/jquery-ui-1.10.2.min.css') . '">';
$headers = array_merge($headers, $view->get_all_blocktype_css());
// Set up skin, if the page has one
$viewskin = $view->get('skin');
$issiteview = $view->get('institution') == 'mahara';
if ($viewskin && get_config('skins') && can_use_skins($owner, false, $issiteview) && (!isset($THEME->skins) || $THEME->skins !== false)) {
    $skin = array('skinid' => $viewskin, 'viewid' => $view->get('id'));
    $skindata = unserialize(get_field('skin', 'viewskin', 'id', $viewskin));
} else {
    $skin = false;
}
if (!$view->is_public()) {
    $headers[] = '<meta name="robots" content="noindex">';
    // Tell search engines not to index non-public views
}
// include slimbox2 js and css files, if it is enabled...
if (get_config_plugin('blocktype', 'gallery', 'useslimbox2')) {
    $langdir = get_string('thisdirection', 'langconfig') == 'rtl' ? '-rtl' : '';
    $headers = array_merge($headers, array('<script type="application/javascript" src="' . append_version_number(get_config('wwwroot') . 'lib/slimbox2/js/slimbox2.js') . '"></script>', '<link rel="stylesheet" type="text/css" href="' . append_version_number(get_config('wwwroot') . 'lib/slimbox2/css/slimbox2' . $langdir . '.css') . '">'));
}
$can_edit = $USER->can_edit_view($view) && !$submittedgroup && !$view->is_submitted();
Example #4
0
 * @package    mahara
 * @subpackage skin
 * @author     Gregor Anzelj
 * @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.
 * @copyright  (C) 2010-2013 Gregor Anzelj <*****@*****.**>
 *
 */
define('INTERNAL', true);
require_once dirname(dirname(__FILE__)) . '/init.php';
require_once 'skin.php';
require_once get_config('docroot') . 'artefact/file/lib.php';
$exportid = param_integer('id', 0);
// id(s) of skin(s) to be exported...
$exportsiteskins = param_boolean('site', false);
if (!can_use_skins(null, $exportsiteskins)) {
    throw new FeatureNotEnabledException();
}
if ($exportid == 0) {
    if ($exportsiteskins) {
        // We are exporting site skins...
        $exportskins = get_records_array('skin', 'type', 'site');
        $xmlfilename = 'siteskins';
    } else {
        // We are exporting user skins...
        $exportskins = get_records_array('skin', 'owner', $USER->get('id'));
        $xmlfilename = 'myskins';
    }
} else {
    $exportskins = get_record('skin', 'id', $exportid, 'owner', $USER->get('id'));
    // Convert to array with one object - for one view skin, with specified id...
Example #5
0
require_once 'skin.php';
require_once 'view.php';
require_once get_config('libroot') . 'group.php';
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'view');
define('SECTION_PAGE', 'skin');
$id = param_integer('id');
$new = param_boolean('new');
$view = new View($id);
if ($new) {
    define('TITLE', get_string('chooseviewskin', 'skin'));
} else {
    define('TITLE', $view->get('title') . ': ' . get_string('chooseviewskin', 'skin'));
}
$issiteview = $view->get('institution') == 'mahara';
if (!can_use_skins(null, false, $issiteview)) {
    throw new FeatureNotEnabledException();
}
$view->set_edit_nav();
$view->set_user_theme();
// Is page skin already saved/set for current page?
$skin = param_integer('skin', null);
$saved = false;
if (!isset($skin)) {
    $skin = $view->get('skin');
    $saved = true;
}
if (!$skin || !($currentskin = get_record('skin', 'id', $skin))) {
    $currentskin = new stdClass();
    $currentskin->id = 0;
    $currentskin->title = get_string('skinnotselected', 'skin');
Example #6
0
 * @author     Gregor Anzelj
 * @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.
 * @copyright  (C) 2010-2013 Gregor Anzelj <*****@*****.**>
 *
 */
define('INTERNAL', 1);
define('MENUITEM', 'myportfolio/skins');
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'skin');
define('SECTION_PAGE', 'index');
require dirname(dirname(__FILE__)) . '/init.php';
require_once 'skin.php';
require_once 'pieforms/pieform.php';
define('TITLE', get_string('myskins', 'skin'));
if (!can_use_skins()) {
    throw new FeatureNotEnabledException();
}
$filter = param_alpha('filter', 'all');
$limit = param_integer('limit', 6);
// For 2x3 grid, showing thumbnails of view skins (2 rows with 3 thumbs each).
$offset = param_integer('offset', 0);
$metadata = param_integer('metadata', null);
$id = param_integer('id', null);
$data = Skin::get_myskins_data($limit, $offset, $filter);
$form = pieform(array('name' => 'filter', 'method' => 'post', 'renderer' => 'div', 'class' => 'form-inline with-heading', 'elements' => array('inputgroup' => array('type' => 'fieldset', 'title' => get_string('filter'), 'class' => 'input-group', 'elements' => array('options' => array('type' => 'select', 'defaultvalue' => $filter, 'options' => array('all' => get_string('allskins', 'skin'), 'site' => get_string('siteskins', 'skin'), 'user' => get_string('userskins', 'skin'), 'public' => get_string('publicskins', 'skin'))), 'submit' => array('type' => 'button', 'usebuttontag' => true, 'class' => 'btn-primary input-group-btn', 'value' => '<span class="icon icon-filter prs"></span>' . get_string('filter')))))));
$pagination = build_pagination(array('url' => get_config('wwwroot') . 'skin/index.php?filter=' . $filter, 'count' => $data->count, 'limit' => $limit, 'offset' => $offset, 'resultcounttextsingular' => get_string('skin', 'skin'), 'resultcounttextplural' => get_string('skins', 'skin')));
$css = array('<link rel="stylesheet" type="text/css" href="' . $THEME->get_url('style/skin.css') . '">');
$smarty = smarty(array(), $css);
$smarty->assign('skins', $data->data);
$smarty->assign('user', $USER->get('id'));
 *
 * @package    mahara
 * @subpackage skin
 * @author     Gregor Anzelj
 * @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.
 * @copyright  (C) 2010-2013 Gregor Anzelj <*****@*****.**>
 *
 */
define('INTERNAL', 1);
require dirname(dirname(__FILE__)) . '/init.php';
require_once 'skin.php';
require_once 'pieforms/pieform.php';
$skinid = param_integer('id');
$siteskin = param_boolean('site', false);
if (!can_use_skins(null, $siteskin)) {
    throw new FeatureNotEnabledException();
}
if ($siteskin) {
    $goto = 'admin/site/skins.php';
    $redirect = '/admin/site/skins.php';
} else {
    $goto = 'skin/index.php';
    $redirect = '/skin/index.php';
}
$skin = new Skin($skinid, null);
if (!$skin->can_edit()) {
    throw new AccessDeniedException(get_string('cantdeleteskin', 'skin'));
}
define('TITLE', get_string('deletespecifiedskin', 'skin', $skin->get('title')));
$numberofpagesuseskin = count_records('view', 'skin', $skin->get('id'));
            <a<?php if ((is_string($tmp=(isset($this->scope["selected"]) ? $this->scope["selected"] : null)) ? htmlspecialchars($tmp, ENT_QUOTES, $this->charset) : $tmp) == 'content') {
?> class="current-tab"<?php 
}?> href="<?php echo (is_string($tmp=$this->scope["WWWROOT"]) ? htmlspecialchars($tmp, ENT_QUOTES, $this->charset) : $tmp);?>view/blocks.php?id=<?php echo (is_string($tmp=$this->scope["viewid"]) ? htmlspecialchars($tmp, ENT_QUOTES, $this->charset) : $tmp);
if ((is_string($tmp=(isset($this->scope["new"]) ? $this->scope["new"] : null)) ? htmlspecialchars($tmp, ENT_QUOTES, $this->charset) : $tmp)) {
?>&new=1<?php 
}?>">
                <?php echo Dwoo_Plugin_str($this, 'editcontent', 'view', null, null, null, null, null);?><span class="accessible-hidden">(<?php echo Dwoo_Plugin_str($this, 'tab', 'mahara', null, null, null, null, null);
if ((is_string($tmp=(isset($this->scope["selected"]) ? $this->scope["selected"] : null)) ? htmlspecialchars($tmp, ENT_QUOTES, $this->charset) : $tmp) == 'content') {
?> <?php echo Dwoo_Plugin_str($this, 'selected', 'mahara', null, null, null, null, null);

}?>)</span>
            </a>
        </li>
        <?php if (! (is_string($tmp=(isset($this->scope["issitetemplate"]) ? $this->scope["issitetemplate"] : null)) ? htmlspecialchars($tmp, ENT_QUOTES, $this->charset) : $tmp)) {
?>
            <?php if (can_use_skins(null, false, (is_string($tmp=(isset($this->scope["issiteview"]) ? $this->scope["issiteview"] : null)) ? htmlspecialchars($tmp, ENT_QUOTES, $this->charset) : $tmp))) {
?>
                <li <?php if ((is_string($tmp=(isset($this->scope["selected"]) ? $this->scope["selected"] : null)) ? htmlspecialchars($tmp, ENT_QUOTES, $this->charset) : $tmp) == 'skin') {
?> class="current-tab"<?php 
}?>>
                    <a<?php if ((is_string($tmp=(isset($this->scope["selected"]) ? $this->scope["selected"] : null)) ? htmlspecialchars($tmp, ENT_QUOTES, $this->charset) : $tmp) == 'skin') {
?> class="current-tab"<?php 
}?> href="<?php echo (is_string($tmp=$this->scope["WWWROOT"]) ? htmlspecialchars($tmp, ENT_QUOTES, $this->charset) : $tmp);?>view/skin.php?id=<?php echo (is_string($tmp=$this->scope["viewid"]) ? htmlspecialchars($tmp, ENT_QUOTES, $this->charset) : $tmp);
if ((is_string($tmp=(isset($this->scope["new"]) ? $this->scope["new"] : null)) ? htmlspecialchars($tmp, ENT_QUOTES, $this->charset) : $tmp)) {
?>&new=1<?php 
}?>">
                        <?php echo Dwoo_Plugin_str($this, 'chooseskin', 'skin', null, null, null, null, null);?><span class="accessible-hidden">(<?php echo Dwoo_Plugin_str($this, 'tab', 'mahara', null, null, null, null, null);
if ((is_string($tmp=(isset($this->scope["selected"]) ? $this->scope["selected"] : null)) ? htmlspecialchars($tmp, ENT_QUOTES, $this->charset) : $tmp) == 'skin') {
?> <?php echo Dwoo_Plugin_str($this, 'selected', 'mahara', null, null, null, null, null);

}?>)</span>