本文整理汇总了PHP中plugins_installed函数的典型用法代码示例。如果您正苦于以下问题:PHP plugins_installed函数的具体用法?PHP plugins_installed怎么用?PHP plugins_installed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了plugins_installed函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* constructor. overrides the parent class
* to set up smarty and the attachment directory
*/
public function __construct(User $user, $views, $artefacts, $progresshandler = null)
{
parent::__construct($user, $views, $artefacts, $progresshandler);
$this->smarty = smarty_core();
if (!check_dir_exists($this->exportdir . '/' . $this->filedir)) {
throw new SystemException("Couldn't create the temporary export directory {$this->exportdir}");
}
$this->zipfile = 'mahara-export-leap-user' . $this->get('user')->get('id') . '-' . $this->exporttime . '.zip';
// some plugins might want to do their own special thing
foreach (plugins_installed('artefact', true) as $plugin) {
$plugin = $plugin->name;
if (safe_require('export', 'leap/' . $plugin, 'lib.php', 'require_once', true)) {
$classname = 'LeapExport' . ucfirst($plugin);
if (class_exists($classname) && call_static_method($classname, 'override_entire_export')) {
$this->specialcases[$plugin] = array();
}
}
}
$outputfilter = LeapExportOutputFilter::singleton();
$outputfilter->set_artefactids(array_keys($this->artefacts));
$this->notify_progress_callback(15, 'Setup complete');
}
示例2: foreach
$SESSION->set('handheld_device', $isMobile);
$SESSION->set('mobile', $isTablet ? false : $isMobile);
$SESSION->set('tablet', $isTablet);
} else {
$SESSION->set('handheld_device', false);
$SESSION->set('mobile', false);
$SESSION->set('tablet', false);
}
$SESSION->set('mobile_detection', true);
}
// Run modules bootstrap code.
if (!defined('INSTALLER')) {
// make sure the table exists if upgrading from older version
require_once 'ddl.php';
if (table_exists(new XMLDBTable('module_installed'))) {
if ($plugins = plugins_installed('module')) {
foreach ($plugins as &$plugin) {
if (safe_require_plugin('module', $plugin->name)) {
call_static_method(generate_class_name('module', $plugin->name), 'bootstrap');
}
}
}
}
}
/*
* Initializes our performance info early.
*
* Pairs up with get_performance_info() which is actually
* in lib/mahara.php. This function is here so that we can
* call it before all the libs are pulled in.
*
示例3: define
*/
define('INTERNAL', 1);
define('MENUITEM', 'myportfolio/import');
require dirname(dirname(__FILE__)) . '/init.php';
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'import');
define('SECTION_PAGE', 'index');
//TODO: Optimize!
raise_memory_limit("512M");
define('PRINTUPLOADFORM_ACT', 0);
define('PRINTIMPORTITEMSFORM_ACT', 1);
define('DOIMPORT_ACT', 2);
$TRANSPORTER = null;
$IMPORTER = null;
// Check if leap import plugin is enabled
$importplugins = plugins_installed('import');
if (!$importplugins) {
die_info(get_string('noimportpluginsenabled', 'import'));
}
if (!array_key_exists('leap', $importplugins)) {
die_info(get_string('noleapimportpluginsenabled', 'import'));
}
// Check if unzip is available
// This is required for extracting leap2a zip file
if (!is_executable(get_config('pathtounzip'))) {
die_info(get_string('unzipnotinstalled', 'admin'));
}
$action = param_integer('action', PRINTUPLOADFORM_ACT);
switch ($action) {
case PRINTUPLOADFORM_ACT:
default:
示例4: get_search_plugins
function get_search_plugins()
{
$searchpluginoptions = array();
if ($searchplugins = plugins_installed('search')) {
foreach ($searchplugins as $plugin) {
safe_require_plugin('search', $plugin->name, 'lib.php');
if (!call_static_method(generate_class_name('search', $plugin->name), 'is_available_for_site_setting')) {
continue;
}
$searchpluginoptions[$plugin->name] = $plugin->name;
$config_path = get_config('docroot') . 'search/' . $plugin->name . '/version.php';
if (is_readable($config_path)) {
$config = new stdClass();
require_once $config_path;
if (isset($config->name)) {
$searchpluginoptions[$plugin->name] = $config->name;
}
}
}
}
return $searchpluginoptions;
}
示例5: build_column
/**
* Returns the HTML for a particular column
*
* @param int $column The column to build
* @param boolean $editing Whether the view is being built in edit mode
* @param boolean $exporting Whether the view is being built for export
*/
public function build_column($row, $column, $editing = false, $exporting = false)
{
global $USER;
$data = $this->get_column_datastructure($row, $column);
static $installed = array();
if (empty($installed)) {
$installed = plugins_installed('blocktype');
$installed = array_map(create_function('$a', 'return $a->name;'), $installed);
}
$blockcontent = '';
foreach ($data['blockinstances'] as $blockinstance) {
if (!in_array($blockinstance->get('blocktype'), $installed)) {
continue;
// this plugin has been disabled
}
if ($editing) {
$result = $blockinstance->render_editing();
$blockcontent .= $result['html'];
// NOTE: build_column is always called in the context of column
// operations, so the javascript returned, which is currently
// for configuring block instances only, is not necessary
} else {
$result = $blockinstance->render_viewing($exporting);
$blockcontent .= $result;
}
}
$columnsperrow = $this->get('columnsperrow');
$thisrownumcolumns = $columnsperrow[$row]->columns;
$smarty = smarty_core();
$smarty->assign('javascript', defined('JSON'));
$smarty->assign('column', $column);
$smarty->assign('row', $row);
$smarty->assign('numcolumns', $thisrownumcolumns);
$smarty->assign('blockcontent', $blockcontent);
if (isset($data['width'])) {
$smarty->assign('width', $data['width']);
}
$smarty->assign('addremovecolumns', $USER->get_account_preference('addremovecolumns'));
if ($editing) {
return $smarty->fetch('view/columnediting.tpl');
}
return $smarty->fetch('view/columnviewing.tpl');
}
示例6: mahara_standard_nav
/**
* Returns the entries in the standard user menu
*
* @return $standardnav a data structure containing the standard navigation
*/
function mahara_standard_nav()
{
$exportenabled = plugins_installed('export');
$menu = array(array('path' => '', 'url' => '', 'title' => get_string('home'), 'weight' => 10, 'accesskey' => 'h'), array('path' => 'myportfolio', 'url' => 'view/', 'title' => get_string('myportfolio'), 'weight' => 30, 'accesskey' => 'v'), array('path' => 'myportfolio/views', 'url' => 'view/', 'title' => get_string('myviews'), 'weight' => 10), array('path' => 'myportfolio/export', 'url' => 'export/', 'title' => get_string('Export', 'export'), 'weight' => 40, 'ignore' => !$exportenabled), array('path' => 'myportfolio/collection', 'url' => 'collection/', 'title' => get_string('mycollections', 'collection'), 'weight' => 10), array('path' => 'groups', 'url' => 'group/mygroups.php', 'title' => get_string('groups'), 'weight' => 40, 'accesskey' => 'g'), array('path' => 'groups/mygroups', 'url' => 'group/mygroups.php', 'title' => get_string('mygroups'), 'weight' => 10), array('path' => 'groups/find', 'url' => 'group/find.php', 'title' => get_string('findgroups'), 'weight' => 20), array('path' => 'groups/myfriends', 'url' => 'user/myfriends.php', 'title' => get_string('myfriends'), 'weight' => 30), array('path' => 'groups/findfriends', 'url' => 'user/find.php', 'title' => get_string('findfriends'), 'weight' => 40));
$menu = array_filter($menu, create_function('$a', 'return empty($a["ignore"]);'));
if ($plugins = get_records_array('artefact_installed', 'active', 1)) {
foreach ($plugins as &$plugin) {
safe_require('artefact', $plugin->name);
$plugin_menu = call_static_method(generate_class_name('artefact', $plugin->name), 'menu_items');
$menu = array_merge($menu, $plugin_menu);
}
}
return $menu;
}
示例7: define
define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'plugins');
require 'upgrade.php';
// @TODO when artefact plugins get installed, move the not installed blocktypes
// that get installed into the list of installed blocktype plugins
$plugins = array();
$plugins['blocktype'] = array();
foreach (plugin_types() as $plugin) {
// this has to happen first because of broken artefact/blocktype ordering
$plugins[$plugin] = array();
$plugins[$plugin]['installed'] = array();
$plugins[$plugin]['notinstalled'] = array();
}
foreach (array_keys($plugins) as $plugin) {
if (table_exists(new XMLDBTable($plugin . '_installed'))) {
if ($installed = plugins_installed($plugin, true)) {
foreach ($installed as $i) {
$key = $i->name;
if ($plugin == 'blocktype') {
$key = blocktype_single_to_namespaced($i->name, $i->artefactplugin);
}
if (!safe_require_plugin($plugin, $key)) {
continue;
}
$plugins[$plugin]['installed'][$key] = array('active' => $i->active, 'disableable' => call_static_method(generate_class_name($plugin, $key), 'can_be_disabled'));
if ($plugins[$plugin]['installed'][$key]['disableable'] || !$i->active) {
$plugins[$plugin]['installed'][$key]['activateform'] = activate_plugin_form($plugin, $i);
}
if ($plugin == 'artefact') {
$plugins[$plugin]['installed'][$key]['types'] = array();
safe_require('artefact', $key);
示例8: right_nav
function right_nav()
{
global $USER, $THEME;
safe_require('notification', 'internal');
$unread = $USER->get('unread');
$menu = array('settings' => array('path' => 'settings', 'url' => 'account/index.php', 'title' => get_string('settings'), 'alt' => '', 'weight' => 10, 'iconclass' => 'cogs'), 'inbox' => array('path' => 'inbox', 'url' => 'account/activity/index.php', 'title' => get_string('inbox'), 'alt' => get_string('inbox'), 'count' => $unread, 'countclass' => 'unreadmessagecount', 'linkid' => 'mail', 'weight' => 20, 'iconclass' => 'envelope'), 'settings/account' => array('path' => 'settings/account', 'url' => 'account/index.php', 'title' => get_config('dropdownmenu') ? get_string('general') : get_string('account'), 'weight' => 10, 'iconclass' => 'user'), 'settings/notifications' => array('path' => 'settings/notifications', 'url' => 'account/activity/preferences/index.php', 'title' => get_string('notifications'), 'weight' => 30, 'iconclass' => 'flag'));
// enable plugins to augment the menu structure
foreach (array('artefact', 'interaction', 'module') as $plugintype) {
if ($plugins = plugins_installed($plugintype)) {
foreach ($plugins as &$plugin) {
if (safe_require_plugin($plugintype, $plugin->name)) {
$plugin_nav_menu = call_static_method(generate_class_name($plugintype, $plugin->name), 'right_nav_menu_items');
$menu = array_merge($menu, $plugin_nav_menu);
}
}
}
}
// local_right_nav_update allows sites to customise the menu by munging the $menu array.
if (function_exists('local_right_nav_update')) {
local_right_nav_update($menu);
}
$menu_structure = find_menu_children($menu, '');
return $menu_structure;
}
示例9: build_column
/**
* Returns the HTML for a particular column
*
* @param int $column The column to build
* @param int $editing Whether the view is being built in edit mode
*/
public function build_column($column, $editing = false)
{
global $USER;
$data = $this->get_column_datastructure($column);
static $installed = array();
if (empty($installed)) {
$installed = plugins_installed('blocktype');
$installed = array_map(create_function('$a', 'return $a->name;'), $installed);
}
if ($editing) {
$renderfunction = 'render_editing';
} else {
$renderfunction = 'render_viewing';
}
$blockcontent = '';
foreach ($data['blockinstances'] as $blockinstance) {
if (!in_array($blockinstance->get('blocktype'), $installed)) {
continue;
// this plugin has been disabled
}
$result = $blockinstance->{$renderfunction}();
if ($editing) {
$blockcontent .= $result['html'];
// NOTE: build_column is always called in the context of column
// operations, so the javascript returned, which is currently
// for configuring block instances only, is not necessary
} else {
$blockcontent .= $result;
}
}
// Widths don't appear to apply to divs unless they have at least
// _some_ content - at least in gecko (make a view with a particular
// layout like 25/50/25 and make the middle column empty and you'll see
// what I mean)
if ($blockcontent == '') {
$blockcontent = ' ';
}
$smarty = smarty_core();
$smarty->assign('javascript', defined('JSON'));
$smarty->assign('column', $column);
$smarty->assign('numcolumns', $this->get('numcolumns'));
$smarty->assign('blockcontent', $blockcontent);
if (isset($data['width'])) {
$smarty->assign('width', intval($data['width']));
}
$smarty->assign('addremovecolumns', $USER->get_account_preference('addremovecolumns'));
if ($editing) {
return $smarty->fetch('view/columnediting.tpl');
}
return $smarty->fetch('view/columnviewing.tpl');
}
示例10: get_mahara_view_entry_data
//.........这里部分代码省略.........
// TODO: A clever way to squeeze their page into one of the standard layouts if it isn't acceptable.
// Maybe just put everything into a one-column layout and let them rearrange it?
if (count($rowwidths) < 1 || count($rowwidths) > View::$maxlayoutrows) {
$this->trace("Invalid layout specified for potential view {$entry->id}, falling back to standard import", self::LOG_LEVEL_VERBOSE);
return false;
}
$i = 1;
$layoutdata = array();
$layoutdata['numrows'] = count($rowwidths);
foreach ($rowwidths as $row) {
// First, check to see whether this row matches a valid row layout in the DB
$rowcolid = get_field('view_layout_columns', 'id', 'widths', $row);
if (!$rowcolid) {
$this->trace("Invalid layout specified for potential view {$entry->id}, falling back to standard import", self::LOG_LEVEL_VERBOSE);
return false;
}
// Data to help us generate the layout
$layoutdata["row{$i}"] = $rowcolid;
$i++;
}
// Now that we know the layout is valid, generate a record and a thumbnail image for it.
db_begin();
// An empty view object, since this view isn't present in the DB yet. We need this in order to access the layout methods
$viewobj = new View(0, array('owner' => $this->get('usr'), 'deleted' => true));
$layoutresult = $viewobj->addcustomlayout($layoutdata);
if (empty($layoutresult['layoutid'])) {
$this->trace("Invalid layout specified for potential view {$entry->id}, falling back to standard import", self::LOG_LEVEL_VERBOSE);
db_rollback();
return false;
}
$layout = (object) array('id' => $layoutresult['layoutid']);
db_commit();
}
}
// Extract the view description in the entry 'summary'
// A description may be wrapped in XHTML div
// See more PluginExportLeap::parse_xhtmlish_content()
$description = '';
if ((string) $entry->summary['type'] === 'xhtml' || (string) $entry->summary['type'] === 'html') {
$summaryelements = (string) $entry->summary['type'] === 'xhtml' && $entry->summary->div->div ? $entry->summary->div->div : $entry->summary;
$summarychildren = $summaryelements->children();
foreach ($summarychildren as $c) {
$description .= $c->asXML();
}
} else {
$description = (string) $entry->summary;
}
$config = array('title' => (string) $entry->title, 'description' => $description, 'type' => $type, 'layout' => $layout->id, 'tags' => self::get_entry_tags($entry), 'numrows' => $rowcount, 'owner' => $this->get('usr'), 'ownerformat' => $ownerformat);
$rowindex = 1;
foreach ($rows as $row) {
// If this is the old one-row layout, we'll have handled that earlier, and have the one row's columns be in $columns
if (!$onerowlayout) {
$columns = $row->xpath('mahara:column');
$columncount = count($columns);
if ($columncount < 1 || $columncount > 5) {
// Whoops, invalid number of columns
$this->trace("Invalid number of columns specified for potential view {$entry->id}, falling back to standard import", self::LOG_LEVEL_VERBOSE);
return false;
}
}
$colindex = 1;
foreach ($columns as $column) {
$blockinstances = $column->xpath('mahara:blockinstance');
$order = 1;
$config['rows'][$rowindex]['columns'][$colindex] = array();
foreach ($blockinstances as $blockinstance) {
$attrs = self::get_attributes($blockinstance, PluginImportLeap::NS_MAHARA);
if (!isset($attrs['blocktype'])) {
$this->trace(" No mahara:blocktype attribute set for blockinstance at row {$rowindex} col {$colindex}, order {$order}: skipping");
continue;
}
$this->trace(" Found block with type {$attrs['blocktype']} at [{$rowindex}][{$colindex}][{$order}]", self::LOG_LEVEL_VERBOSE);
if ($blocktypes_installed === null) {
$blocktypes_installed = array_map(create_function('$a', 'return $a->name;'), plugins_installed('blocktype'));
}
if (in_array($attrs['blocktype'], $blocktypes_installed)) {
$configelements = $blockinstance->xpath('mahara:*');
$config['rows'][$rowindex]['columns'][$colindex][$order] = array('type' => $attrs['blocktype'], 'title' => $attrs['blocktitle'], 'config' => array());
foreach ($configelements as $element) {
$value = json_decode((string) $element);
if (is_array($value) && isset($value[0])) {
$config['rows'][$rowindex]['columns'][$colindex][$order]['config'][$element->getName()] = $value[0];
} else {
$this->trace(" Value for {$element->getName()} is not an array, ignoring (value follows below)");
$this->trace($value);
}
}
$order++;
} else {
$this->trace(" Ignoring unknown blocktype {$attrs['blocktype']}");
}
}
$colindex++;
}
// cols
$rowindex++;
}
//rows
return $config;
}
示例11: release_submitted_view
/**
* Releases a submission to a remote host.
* @param int $id A view or collection id
* @param mixed $assessmentdata Assessment data from the remote host, for this assignment
* @param string $teacherusername The username of the teacher who is releasing the assignment
* @param boolean $iscollection Whether the $id is a view or a collection
*/
function release_submitted_view($id, $assessmentdata, $teacherusername, $iscollection = false)
{
global $REMOTEWWWROOT, $USER;
list($teacher, $authinstance) = find_remote_user($teacherusername, $REMOTEWWWROOT);
require_once 'view.php';
db_begin();
if ($iscollection) {
require_once 'collection.php';
$collection = new Collection($id);
$collection->release($teacher);
} else {
$view = new View($id);
View::_db_release(array($id), $view->get('owner'));
}
// Provide each artefact plugin the opportunity to handle the remote submission release
foreach (plugins_installed('artefact') as $plugin) {
safe_require('artefact', $plugin->name);
$classname = generate_class_name('artefact', $plugin->name);
if (is_callable($classname . '::view_release_external_data')) {
call_static_method($classname, 'view_release_external_data', $id, $assessmentdata, $teacher ? $teacher->id : 0, $iscollection);
}
}
// Release the view for editing
db_commit();
}
示例12: define
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
define('INTERNAL', 1);
define('MENUITEM', 'groups');
require dirname(dirname(__FILE__)) . '/init.php';
require_once get_config('docroot') . 'interaction/lib.php';
require_once get_config('libroot') . 'group.php';
define('GROUP', param_integer('id'));
$group = group_current_group();
if (group_user_access($group->id, $USER->get('id')) != 'admin') {
throw new AccessDeniedException(get_string('notallowedtoeditinteraction', 'group'));
}
define('TITLE', get_string('groupinteractions', 'group'));
$interactiontypes = array_flip(array_map(create_function('$a', 'return $a->name;'), plugins_installed('interaction')));
if (!($interactions = get_records_select_array('interaction_instance', '"group" = ? AND deleted = ?', array($group->id, 0), 'plugin, ctime', 'id, plugin, title'))) {
$interactions = array();
}
$names = array();
foreach (array_keys($interactiontypes) as $plugin) {
$names[$plugin] = array('single' => get_string('name', 'interaction.' . $plugin), 'plural' => get_string('nameplural', 'interaction.' . $plugin));
}
foreach ($interactions as $i) {
if (!is_array($interactiontypes[$i->plugin])) {
$interactiontypes[$i->plugin] = array();
}
$interactiontypes[$i->plugin][] = $i;
}
$smarty = smarty();
$smarty->assign('group', $group);
示例13: get_artefact_extra_artefacts
protected function get_artefact_extra_artefacts(&$artefactids)
{
if (empty($artefactids)) {
return array();
}
$extra = array();
$plugins = plugins_installed('artefact');
foreach ($plugins as &$plugin) {
safe_require('artefact', $plugin->name);
$classname = generate_class_name('artefact', $plugin->name);
if (is_callable($classname . '::artefact_export_extra_artefacts')) {
if ($artefacts = call_static_method($classname, 'artefact_export_extra_artefacts', $artefactids)) {
$extra = array_unique(array_merge($extra, $artefacts));
}
}
}
return $extra;
}
示例14: right_nav
function right_nav()
{
global $USER, $THEME;
safe_require('notification', 'internal');
$unread = $USER->get('unread');
$menu = array('settings' => array('path' => 'settings', 'url' => 'account/index.php', 'title' => get_string('settings'), 'icon' => $THEME->get_url('images/settings.png'), 'alt' => get_string('settings'), 'weight' => 10), 'inbox' => array('path' => 'inbox', 'url' => 'account/activity/index.php', 'icon' => $THEME->get_url($unread ? 'images/newmail.png' : 'images/message.png'), 'alt' => get_string('inbox'), 'count' => $unread, 'countclass' => 'unreadmessagecount', 'weight' => 20), 'settings/account' => array('path' => 'settings/account', 'url' => 'account/index.php', 'title' => get_config('dropdownmenu') ? get_string('general') : get_string('account'), 'weight' => 10), 'settings/notifications' => array('path' => 'settings/notifications', 'url' => 'account/activity/preferences/index.php', 'title' => get_string('notifications'), 'weight' => 30));
// enable plugins to augment the menu structure
if ($plugins = plugins_installed('artefact')) {
foreach ($plugins as &$plugin) {
safe_require('artefact', $plugin->name);
$plugin_menu = call_static_method(generate_class_name('artefact', $plugin->name), 'menu_items');
$menu = array_merge($menu, $plugin_menu);
}
}
if ($plugins = plugins_installed('interaction')) {
foreach ($plugins as &$plugin) {
safe_require('interaction', $plugin->name);
$plugin_menu = call_static_method(generate_class_name('interaction', $plugin->name), 'menu_items');
$menu = array_merge($menu, $plugin_menu);
}
}
// local_right_nav_update allows sites to customise the menu by munging the $menu array.
if (function_exists('local_right_nav_update')) {
local_right_nav_update($menu);
}
$menu_structure = find_menu_children($menu, '');
return $menu_structure;
}
示例15: mahara_standard_nav
/**
* Returns the entries in the standard user menu
*
* @return $standardnav a data structure containing the standard navigation
*/
function mahara_standard_nav()
{
$exportenabled = plugins_installed('export');
$importenabled = plugins_installed('import');
$menu = array(array('path' => '', 'url' => '', 'title' => get_string('home'), 'weight' => 10), array('path' => 'myportfolio', 'url' => 'view/', 'title' => get_string('myportfolio'), 'weight' => 30), array('path' => 'myportfolio/views', 'url' => 'view/', 'title' => get_string('myviews'), 'weight' => 10), array('path' => 'myportfolio/export', 'url' => 'export/', 'title' => get_string('Export', 'export'), 'weight' => 40, 'ignore' => !$exportenabled), array('path' => 'myportfolio/import', 'url' => 'import/', 'title' => get_string('import', 'import'), 'weight' => 40, 'ignore' => !$importenabled), array('path' => 'profile/view', 'url' => 'user/view.php', 'title' => get_string('viewmyprofilepage'), 'weight' => 9), array('path' => 'profile/editprofilepage', 'url' => 'view/blocks.php?profile=1', 'title' => get_string('editmyprofilepage'), 'weight' => 9), array('path' => 'groups', 'url' => 'group/mygroups.php', 'title' => get_string('groups'), 'weight' => 40), array('path' => 'groups/mygroups', 'url' => 'group/mygroups.php', 'title' => get_string('mygroups'), 'weight' => 10), array('path' => 'groups/find', 'url' => 'group/find.php', 'title' => get_string('findgroups'), 'weight' => 20), array('path' => 'groups/myfriends', 'url' => 'user/myfriends.php', 'title' => get_string('myfriends'), 'weight' => 30), array('path' => 'groups/findfriends', 'url' => 'user/find.php', 'title' => get_string('findfriends'), 'weight' => 40), array('path' => 'settings', 'url' => 'account/', 'title' => get_string('settings'), 'weight' => 60), array('path' => 'settings/preferences', 'url' => 'account/', 'title' => get_string('preferences'), 'weight' => 10), array('path' => 'settings/notifications', 'url' => 'account/activity/', 'title' => get_string('notifications'), 'weight' => 20), array('path' => 'settings/activitypreferences', 'url' => 'account/activity/preferences/', 'title' => get_string('activityprefs'), 'weight' => 30), array('path' => 'settings/institutions', 'url' => 'account/institutions.php', 'title' => get_string('institutionmembership'), 'weight' => 40));
$menu = array_filter($menu, create_function('$a', 'return empty($a["ignore"]);'));
if ($plugins = get_records_array('artefact_installed', 'active', 1)) {
foreach ($plugins as &$plugin) {
safe_require('artefact', $plugin->name);
$plugin_menu = call_static_method(generate_class_name('artefact', $plugin->name), 'menu_items');
$menu = array_merge($menu, $plugin_menu);
}
}
return $menu;
}