Beispiel #1
0
    /**
     * Return is the instance is visible
     * (is the type visible ? is the context enable ?)
     * @return boolean
     */
    public function is_visible() {
        global $COURSE; //TODO: this is deprecated (skodak)
        if ($COURSE->legacyfiles != 2) {
            // do not show repo if legacy files disabled in this course...
            return false;
        }

        return parent::is_visible();
    }
Beispiel #2
0
    /**
     * We want to make sure that not only is this plugin enabled and visible but also that the remote Alfresco
     * repository is currently up and running also.
     *
     * @return boolean
     */
    public function is_visible() {
        global $COURSE, $USER;

        if (!parent::is_visible() || !isset($this->elis_files) || empty($this->elis_files->isrunning)) {
            return false;
        }

        $uid = $USER->id;
        $courseid = $COURSE->id;
        $cid = ($courseid != SITEID) ? $courseid : 0;
        $oid = 0;
        $shared = (boolean)0;

        // ELIS files is visible if the user has any permissions from default browsing location
        return $this->elis_files->get_default_browsing_location($cid, $uid, $shared, $oid);
    }