/** * Blog extended initialization * * Register css extensions, contentes view for groups, widgets and event handlers */ function blogextended_init() { global $CONFIG; extend_view("css", "blogextended/css"); extend_view("blog/fields_before", "blog/forms/type"); extend_view("blog/fields_before", "groups/groupselector"); //extend_view('groups/left_column', 'groups/groupcontents',1); add_widget_type('blog', elgg_echo('blog:widget:title'), elgg_echo('blog:widget:description')); register_elgg_event_handler("create", "object", "blog_type_handler"); register_elgg_event_handler("update", "object", "blog_type_handler"); register_elgg_event_handler("create", "object", "group_selector_handler"); register_elgg_event_handler("update", "object", "group_selector_handler"); register_page_handler('gblog', 'gblog_page_handler'); if (is_plugin_enabled("itemicon")) { if (!isset($CONFIG->itemicon)) { $CONFIG->itemicon[] = array(); } $CONFIG->itemicon[] = "blog"; extend_view("blog/fields_after", "itemicon/add"); } $options = array("" => "All", "WorkStories" => "Work Stories", "HowTo" => "How To's", "GroupGuides" => "Group Guides", "ManagingProjects" => "Managing a Project", "TellingYourStory" => "Telling your Story"); $CONFIG->BLOG_TYPES = $options; if (file_exists(dirname(__FILE__) . "/config.php")) { @(require_once dirname(__FILE__) . "/config.php"); } $CONFIG->blogextended = $options; }
/** * Notification settings page setup function * */ function notifications_plugin_pagesetup() { global $CONFIG; if (get_context() == 'settings') { add_submenu_item(elgg_echo('notifications:subscriptions:changesettings'), $CONFIG->wwwroot . "mod/notifications/"); if (is_plugin_enabled('groups')) { add_submenu_item(elgg_echo('notifications:subscriptions:changesettings:groups'), $CONFIG->wwwroot . "mod/notifications/groups.php"); } } }
function tagcloud_init() { add_widget_type('tagcloud', elgg_echo('tagcloud:widget:title'), elgg_echo('tagcloud:widget:description')); // Extend CSS elgg_extend_view('css', 'tagcloud/css'); if (is_plugin_enabled('blog')) { // extend blog sidebar with a tag-cloud } if (is_plugin_enabled('bookmarks')) { // extend bkmrks sidebar with a tag-cloud } }
/** * Walled garden support. * * @package ElggWalledGarden * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author Curverider Ltd * @copyright Curverider Ltd 2008-2010 * @link http://elgg.com/ */ function walledgarden_init() { global $CONFIG; $CONFIG->disable_registration = true; // elgg_set_viewtype('default'); elgg_extend_view('pageshells/pageshell', 'walledgarden/walledgarden'); elgg_extend_view('css', 'walledgarden/css'); // Replace the default index page if the custom index plugin does not exist if (!is_plugin_enabled("custom_index")) { register_plugin_hook('index', 'system', 'walledgarden_index'); } // um...what is this doing here? // Turn off simple cache if enabled //if (function_exists('elgg_view_disable_simplecache')) { // elgg_view_disable_simplecache(); //} }
/** * Country Selector * * Main init file * * @package country_selector * @author ColdTrick IT Solutions * @copyright Coldtrick IT Solutions 2009 * @link http://www.coldtrick.com/ * @version 0.1 */ function country_selector_init() { if (is_plugin_enabled("profile_manager")) { // default profile options $profileoptions = array(); $profileoptions["show_on_register"] = true; $profileoptions["mandatory"] = true; $profileoptions["user_editable"] = true; $profileoptions["output_as_tags"] = false; $profileoptions["admin_only"] = true; $profileoptions["simple_search"] = true; $profileoptions["advanced_search"] = true; // default group options $groupoptions = array(); $groupoptions["output_as_tags"] = false; $groupoptions["admin_only"] = true; // Add profile fields add_custom_field_type("custom_profile_field_types", 'country', elgg_echo("country_selector:field_type:country"), $profileoptions); add_custom_field_type("custom_profile_field_types", 'ca_us_state', elgg_echo("country_selector:field_type:ca_us_state"), $profileoptions); // Add group fields add_custom_field_type("custom_group_field_types", 'country', elgg_echo("country_selector:field_type:country"), $groupoptions); add_custom_field_type("custom_group_field_types", 'ca_us_state', elgg_echo("country_selector:field_type:ca_us_state"), $groupoptions); } }
if (is_plugin_enabled('blog')) { $blog_link = "<li {$blog_highlight}><a href=\"{$vars['url']}pg/blog/{$username}\">Blog</a></li>"; } else { $blog_link = ""; } if (is_plugin_enabled('video')) { $video_link = "<li {$video_highlight}><a href=\"{$vars['url']}pg/video/{$username}\">Videos</a></li>"; } else { $video_link = ""; } if (is_plugin_enabled('pages')) { $pages_link = "<li {$pages_highlight}><a href=\"{$vars['url']}pg/pages/owned/{$username}\">Pages</a></li>"; } else { $pages_link = ""; } if (is_plugin_enabled('bookmarks')) { $bookmark_link = "<li {$bookmarks_highlight}><a href=\"{$vars['url']}pg/bookmarks/{$username}\">Bookmarks</a></li>"; } else { $bookmark_link = ""; } //contruct the display $display = <<<EOT <div id="owner_block"> \t<div class="owner_block_icon {$icon_class}"> \t\t{$icon} \t</div> \t{$more_info} \t{$profile_actions} \t<div class="owner_block_links"> \t\t<ul>
/** * Page handler for autocomplete endpoint. * * @param $page * @return unknown_type */ function input_livesearch_page_handler($page) { global $CONFIG; // only return results to logged in users. if (!($user = get_loggedin_user())) { exit; } if (!($q = get_input('q'))) { exit; } $q = mysql_real_escape_string($q); // replace mysql vars with escaped strings $q = str_replace(array('_', '%'), array('\\_', '\\%'), $q); $match_on = get_input('match_on', 'all'); if ($match_on == 'all' || $match_on[0] == 'all') { $match_on = array('users', 'groups'); } if (!is_array($match_on)) { $match_on = array($match_on); } if (get_input('match_owner', false)) { $owner_guid = $user->getGUID(); $owner_where = 'AND e.owner_guid = ' . $user->getGUID(); } else { $owner_guid = null; $owner_where = ''; } $limit = get_input('limit', 10); // grab a list of entities and send them in json. $results = array(); foreach ($match_on as $type) { switch ($type) { case 'all': // only need to pull up title from objects. if (!($entities = elgg_get_entities(array('owner_guid' => $owner_guid, 'limit' => $limit))) and is_array($entities)) { $results = array_merge($results, $entities); } break; case 'users': $query = "SELECT * FROM {$CONFIG->dbprefix}users_entity as ue, {$CONFIG->dbprefix}entities as e\n\t\t\t\t\tWHERE e.guid = ue.guid\n\t\t\t\t\t\tAND e.enabled = 'yes'\n\t\t\t\t\t\tAND ue.banned = 'no'\n\t\t\t\t\t\tAND (ue.name LIKE '{$q}%' OR ue.username LIKE '{$q}%')\n\t\t\t\t\tLIMIT {$limit}\n\t\t\t\t"; if ($entities = get_data($query)) { foreach ($entities as $entity) { $json = json_encode(array('type' => 'user', 'name' => $entity->name, 'desc' => $entity->username, 'icon' => '<img class="livesearch_icon" src="' . get_entity($entity->guid)->getIcon('tiny') . '" />', 'guid' => $entity->guid)); $results[$entity->name . rand(1, 100)] = $json; } } break; case 'groups': // don't return results if groups aren't enabled. if (!is_plugin_enabled('groups')) { continue; } $query = "SELECT * FROM {$CONFIG->dbprefix}groups_entity as ge, {$CONFIG->dbprefix}entities as e\n\t\t\t\t\tWHERE e.guid = ge.guid\n\t\t\t\t\t\tAND e.enabled = 'yes'\n\t\t\t\t\t\t{$owner_where}\n\t\t\t\t\t\tAND (ge.name LIKE '{$q}%' OR ge.description LIKE '%{$q}%')\n\t\t\t\t\tLIMIT {$limit}\n\t\t\t\t"; if ($entities = get_data($query)) { foreach ($entities as $entity) { $json = json_encode(array('type' => 'group', 'name' => $entity->name, 'desc' => strip_tags($entity->description), 'icon' => '<img class="livesearch_icon" src="' . get_entity($entity->guid)->getIcon('tiny') . '" />', 'guid' => $entity->guid)); //$results[$entity->name . rand(1,100)] = "$json|{$entity->guid}"; $results[$entity->name . rand(1, 100)] = $json; } } break; case 'friends': $access = get_access_sql_suffix(); $query = "SELECT * FROM {$CONFIG->dbprefix}users_entity as ue, {$CONFIG->dbprefix}entity_relationships as er, {$CONFIG->dbprefix}entities as e\n\t\t\t\t\tWHERE er.relationship = 'friend'\n\t\t\t\t\t\tAND er.guid_one = {$user->getGUID()}\n\t\t\t\t\t\tAND er.guid_two = ue.guid\n\t\t\t\t\t\tAND e.guid = ue.guid\n\t\t\t\t\t\tAND e.enabled = 'yes'\n\t\t\t\t\t\tAND ue.banned = 'no'\n\t\t\t\t\t\tAND (ue.name LIKE '{$q}%' OR ue.username LIKE '{$q}%')\n\t\t\t\t\tLIMIT {$limit}\n\t\t\t\t"; if ($entities = get_data($query)) { foreach ($entities as $entity) { $json = json_encode(array('type' => 'user', 'name' => $entity->name, 'desc' => $entity->username, 'icon' => '<img class="livesearch_icon" src="' . get_entity($entity->guid)->getIcon('tiny') . '" />', 'guid' => $entity->guid)); $results[$entity->name . rand(1, 100)] = $json; } } break; default: // arbitrary subtype. //@todo you cannot specify a subtype without a type. // did this ever work? elgg_get_entities(array('subtype' => $type, 'owner_guid' => $owner_guid)); break; } } ksort($results); echo implode($results, "\n"); exit; }
/** * Return an array of installed plugins. */ function get_installed_plugins() { global $CONFIG; $installed_plugins = array(); if (!empty($CONFIG->pluginspath)) { $plugins = get_plugin_list(); foreach ($plugins as $mod) { $installed_plugins[$mod] = array(); $installed_plugins[$mod]['active'] = is_plugin_enabled($mod); $installed_plugins[$mod]['manifest'] = load_plugin_manifest($mod); } } return $installed_plugins; }
$contents = ""; // Are there feeds to display? global $autofeed; if (isset($autofeed) && $autofeed == true) { $url = $url2 = full_url(); if (substr_count($url, '?')) { $url .= "&view=rss"; } else { $url .= "?view=rss"; } $label = elgg_echo('feed:rss'); $contents .= <<<END \t<div class="rss_link clearfloat"><a href="{$url}" rel="nofollow" title="{$label}">{$label}</a></div> END; } if (is_plugin_enabled('profile')) { // Is there a page owner? $owner = page_owner_entity(); $location = elgg_view("output/tags", array('value' => $owner->location)); if ($owner instanceof ElggEntity) { $icon = elgg_view("profile/icon", array('entity' => $owner, 'size' => 'tiny')); if ($owner instanceof ElggUser || $owner instanceof ElggGroup) { $info = '<h3><a href="' . $owner->getURL() . '">' . $owner->name . '</a></h3>'; } $display = "<div class='owner_block_icon'>" . $icon . "</div>"; $display .= "<div class='owner_block_contents clearfloat'>" . $info; if ($owner->briefdescription) { $desc = $owner->briefdescription; $display .= "<p class='profile_info briefdescription'>" . $desc . "</p>"; } $display .= "<p class='profile_info location'>{$location}</p>";
//$label2 = elgg_echo('feed:odd'); $contents .= <<<END \t<div id="owner_block_rss_feed"><a href="{$url}" rel="nofollow">{$label}</a></div> \t\t\t END; } //the follow are for logged in users only if (isloggedin()) { //is the bookmark plugin installed? if (is_plugin_enabled('bookmarks')) { $label3 = elgg_echo('bookmarks:this'); $contents .= "<div id=\"owner_block_bookmark_this\"><a href=\"javascript:location.href='" . $CONFIG->wwwroot . "mod/bookmarks/add.php?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">{$label3}</a></div>"; } //report this button if (is_plugin_enabled('reportedcontent')) { $label4 = elgg_echo('reportedcontent:report'); $contents .= "<div id=\"owner_block_report_this\"><a href=\"javascript:location.href='" . $CONFIG->wwwroot . "mod/reportedcontent/add.php?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">{$label4}</a></div>"; } } $contents .= elgg_view('owner_block/extend'); // Have we been asked to inject any content? If so, display it if (isset($vars['content'])) { $contents .= $vars['content']; } // Initialise the submenu $submenu = get_submenu(); // elgg_view('canvas_header/submenu'); if (!empty($submenu)) { $contents .= "<div id=\"owner_block_submenu\">" . $submenu . "</div>"; }
<?php /** * iZAP izap_videos * * @package youtube, vimeo, veoh and onserver uploading * @license GNU Public License version 3 * @author iZAP Team "<*****@*****.**>" * @link http://www.izap.in/ * @version 1.5-1.0 */ if (is_plugin_enabled('izap_videos')) { $videos = $vars['entities']; $total = 16; if (isset($vars['videosTOdisplay'])) { $total = $vars['videosTOdisplay']; } echo '<div class="index_box">'; echo elgg_view_title(elgg_echo('videos')); echo '<div class="contentWrapper">'; ?> <script> function selectTab(selectedTab, displayDiv) { $('#ltab').removeClass('selected'); $('#vtab').removeClass('selected'); $('#ctab').removeClass('selected'); $('#latest').hide('slow'); $('#views').hide('slow'); $('#com').hide('slow');
/** * Users initialisation function, which establishes the page handler * */ function users_init() { // Load config global $CONFIG; // add Friends to tools menu - if profile mod is running if (isloggedin() && is_plugin_enabled('profile')) { $user = get_loggedin_user(); add_menu(elgg_echo('friends'), $CONFIG->wwwroot . "pg/friends/" . $user->username, array(), 'core:friends'); } register_page_handler('friends', 'friends_page_handler'); register_page_handler('friendsof', 'friends_of_page_handler'); //register_page_handler('collections', 'collections_page_handler'); register_page_handler('dashboard', 'dashboard_page_handler'); register_page_handler('register', 'registration_page_handler'); register_page_handler('resetpassword', 'elgg_user_resetpassword_page_handler'); register_action("register", true); register_action("useradd", true); register_action("friends/add"); register_action("friends/remove"); //register_action('friends/addcollection'); //register_action('friends/deletecollection'); //register_action('friends/editcollection'); //register_action("user/spotlight"); register_action("usersettings/save"); register_action("user/passwordreset"); register_action("user/requestnewpassword"); // User name change extend_elgg_settings_page('user/settings/name', 'usersettings/user', 1); //register_action("user/name"); // User password change extend_elgg_settings_page('user/settings/password', 'usersettings/user', 1); //register_action("user/password"); // Add email settings extend_elgg_settings_page('user/settings/email', 'usersettings/user', 1); //register_action("email/save"); // Add language settings extend_elgg_settings_page('user/settings/language', 'usersettings/user', 1); // Add default access settings extend_elgg_settings_page('user/settings/default_access', 'usersettings/user', 1); //register_action("user/language"); // Register the user type register_entity_type('user', ''); register_plugin_hook('usersettings:save', 'user', 'users_settings_save'); register_elgg_event_handler('create', 'user', 'user_create_hook_add_site_relationship'); // Handle a special case for newly created users when the user is not logged in // TODO: handle this better! register_plugin_hook('permissions_check', 'all', 'new_user_enable_permissions_check'); }
/** * Function to add menu items to the pages * * @return unknown_type */ function profile_manager_pagesetup() { global $CONFIG; if (get_context() == "admin" && isadminloggedin()) { if (is_plugin_enabled("profile")) { // Remake admin submenu $subA =& $CONFIG->submenu["a"]; foreach ($subA as $index => $item) { if ($item->name == elgg_echo("profile:edit:default")) { unset($subA[$index]); } } add_submenu_item(elgg_echo("profile:edit:default"), $CONFIG->wwwroot . "pg/profile_manager/profile_fields", "b"); } if (is_plugin_enabled("groups")) { add_submenu_item(elgg_echo("profile_manager:group_fields"), $CONFIG->wwwroot . "pg/profile_manager/group_fields", "b"); } } if (get_plugin_setting("show_members_search") == "yes" && (get_input("handler") == "search" || strpos($_SERVER["REQUEST_URI"], "/search/") === 0)) { add_submenu_item(elgg_echo('profile_manager:members:submenu'), $CONFIG->wwwroot . "pg/members", "b"); } }
function check_plugin_dependencies($plugin_name, $force_inclusion = FALSE) { $dependencies = get_plugin_dependencies($plugin_name, $force_inclusion); if (!$dependencies) { return TRUE; } if ($dependencies === SQ_INCOMPATIBLE) { return $dependencies; } $missing_or_bad = array(); foreach ($dependencies as $depend_name => $depend_requirements) { // check for core plugins first // if (strpos(strtoupper($depend_requirements['version']), 'CORE') === 0) { // see if the plugin is in the core (just check if the directory exists) // if (!file_exists(SM_PATH . 'plugins/' . $depend_name)) { $missing_or_bad[$depend_name] = $depend_requirements; } else { if ($depend_requirements['activate'] && !is_plugin_enabled($depend_name)) { $missing_or_bad[$depend_name] = $depend_requirements; } else { if (strpos($depend_requirements['version'], ':') !== FALSE) { $version = explode('.', substr($depend_requirements['version'], strpos($depend_requirements['version'], ':') + 1), 3); $version[0] = intval($version[0]); if (isset($version[1])) { $version[1] = intval($version[1]); } else { $version[1] = 0; } if (isset($version[2])) { $version[2] = intval($version[2]); } else { $version[2] = 0; } if (!check_sm_version($version[0], $version[1], $version[2])) { $missing_or_bad[$depend_name] = $depend_requirements; } } } } continue; } // if the plugin is actually incompatible; check that it // is not activated // if ($depend_requirements['version'] == SQ_INCOMPATIBLE) { if (is_plugin_enabled($depend_name)) { $missing_or_bad[$depend_name] = $depend_requirements; } continue; } // check for normal plugins // $version = explode('.', $depend_requirements['version'], 3); $version[0] = intval($version[0]); if (isset($version[1])) { $version[1] = intval($version[1]); } else { $version[1] = 0; } if (isset($version[2])) { $version[2] = intval($version[2]); } else { $version[2] = 0; } $force_dependency_inclusion = !$depend_requirements['activate']; if (!check_plugin_version($depend_name, $version[0], $version[1], $version[2], $force_dependency_inclusion)) { $missing_or_bad[$depend_name] = $depend_requirements; } } if (empty($missing_or_bad)) { return TRUE; } // get non-parsed required versions // $non_parsed_dependencies = get_plugin_dependencies($plugin_name, $force_inclusion, FALSE); $return_array = array(); foreach ($missing_or_bad as $depend_name => $ignore) { $return_array[$depend_name] = $non_parsed_dependencies[$depend_name]; } return $return_array; }
<?php /** * Elgg user search box. * * @package Elgg * @subpackage Core * @author Curverider Ltd * @link http://elgg.org/ */ if (is_plugin_enabled('search') && is_plugin_enabled('profile')) { ?> <div class="admin_settings user_search"> <form action="<?php echo $vars['url']; ?> pg/search/" method="get"> <h3><?php echo elgg_echo('admin:user:label:search'); ?> </h3> <?php echo elgg_view('input/text', array('internalname' => 'q')); ?> <input type="hidden" name="entity_type" value="user" /> <input type="hidden" name="search_type" value="entities" /> <input type="submit" name="<?php echo elgg_echo('admin:user:label:searchbutton'); ?> " value="<?php
* @subpackage bug_report */ // This is the bug_report options page // define('PAGE_NAME', 'bug_report_options'); // Include the SquirrelMail initialization file. // require '../../include/init.php'; // load plugin functions // require_once SM_PATH . 'plugins/bug_report/functions.php'; displayPageHeader($color); // error out when bug_report plugin is disabled // or is called by the wrong user // if (!is_plugin_enabled('bug_report') || !bug_report_check_user()) { error_box(_("Plugin is disabled.")); $oTemplate->display('footer.tpl'); exit; } // get system specs // require_once SM_PATH . 'plugins/bug_report/system_specs.php'; list($body, $warnings, $corrections) = get_system_specs(); $body_top = "I am subscribed to the this mailing list.\n" . " (applies when you are sending email to SquirrelMail mailing list)\n" . " [ ] True - No need to CC me when replying\n" . " [ ] False - Please CC me when replying\n" . "\n" . "This bug occurs when I ...\n" . " ... view a particular message\n" . " ... use a specific plugin/function\n" . " ... try to do/view/use ....\n" . "\n\n\n" . "The description of the bug:\n\n\n" . "I can reproduce the bug by:\n\n\n" . "(Optional) I got bored and found the bug occurs in:\n\n\n" . "(Optional) I got really bored and here's a fix:\n\n\n" . "----------------------------------------------\n\n"; $body = $body_top . $body; global $oTemplate, $bug_report_admin_email; if (!empty($bug_report_admin_email)) { $oTemplate->assign('admin_email', $bug_report_admin_email); } $oTemplate->assign('message_body', $body);
* @link http://www.izap.in/ * */ $mce_lang = $vars['user']->language; if (!is_file($CONFIG->pluginspath . "tinymce/tinymce/jscripts/tiny_mce/langs/{$mce_lang}.js")) { $mce_lang = 'en'; } ?> <?php //Tinymce is load when loads this if (is_plugin_enabled('tinymcebrowser')) { $file = $CONFIG->pluginspath . 'tinymcebrowser/views/default/input/longtext.php'; } elseif (is_plugin_enabled('tinymce_adv')) { $file = $CONFIG->pluginspath . 'tinymce_adv/views/default/input/longtext.php'; } elseif (is_plugin_enabled('tinymce')) { $file = $CONFIG->pluginspath . 'tinymce/views/default/input/longtext.php'; if (is_file($file)) { ob_start(); include $file; $ret = ob_get_clean(); $pos = strpos($ret, "tinyMCE.init"); $ret = substr($ret, 0, $pos) . substr($ret, $pos); $pos = strpos($ret, "tinyMCE.init"); if ($vars['noEditor'] != 'yes') { //add the plugins to init $substr = substr($ret, $pos); $limited_substr = substr($substr, 0, strpos($substr, "}")); if (strpos($limited_substr, 'plugins') !== false) { $pos1 = $pos + strpos($substr, "plugins"); $substr = substr($ret, $pos1);
<?php /** * iZAP izap_videos * * @package Elgg videotizer, by iZAP Web Solutions. * @license GNU Public License version 3 * @Contact iZAP Team "<*****@*****.**>" * @Founder Tarun Jangra "<*****@*****.**>" * @link http://www.izap.in/ * */ ?> <p> <label for="video_file"> <?php echo elgg_echo('izap_videos:addEditForm:videoFile'); ?> </label><br /> <?php if (is_plugin_enabled('izap-uploadify')) { echo elgg_view('input/izap-uploadify', array('internalname' => 'izap[videoFile]', 'value' => $vars['loaded_data']->videoFile, 'internalid' => 'video_file', 'form_id' => 'video_form', 'redirect_url' => $vars['url'] . 'pg/videos/list/' . get_loggedin_user()->username)); } else { echo elgg_view('input/file', array('internalname' => 'izap[videoFile]', 'value' => $vars['loaded_data']->videoFile, 'internalid' => 'video_file')); } ?> </p> <?php echo elgg_view('input/hidden', array('internalname' => 'izap[videoType]', 'value' => 'ONSERVER'));
function getPlugins() { $handle = opendir(ROOT . './plugins/'); $plugins = $new_plugins = $installed = array(); $query = DB::query('SELECT name FROM plugin'); while ($row = DB::fetch($query)) { $installed[] = $row['name']; } while (1) { $folder = readdir($handle); if (!$folder) { break; } if ($folder == '.' || $folder == '..') { continue; } $classfile = ROOT . './plugins/' . $folder . '/plugin.class.php'; if (!file_exists($classfile)) { continue; } require_once $classfile; $classname = "plugin_{$folder}"; if (!class_exists("plugin_{$folder}", false)) { continue; } $obj = new $classname(); $arr = array('id' => $folder, 'description' => $obj->description, 'config' => method_exists($obj, 'on_config'), 'enabled' => is_plugin_enabled($folder), 'version' => getPluginVersion($folder), 'installed' => in_array($folder, $installed)); if ($arr['installed']) { $plugins[] = $arr; } else { $new_plugins[] = $arr; } } return array_merge($plugins, $new_plugins); }
<?php /** * Elgg plugin specific user settings. * * @package Elgg * @subpackage Core * @author Curverider Ltd * @link http://elgg.org/ */ // Description of what's going on echo "<div class=\"contentWrapper\">" . elgg_view('output/longtext', array('value' => elgg_echo("usersettings:plugins:description"))) . "</div>"; $limit = get_input('limit', 10); $offset = get_input('offset', 0); // Get the installed plugins $installed_plugins = $vars['installed_plugins']; $count = count($installed_plugins); // Display list of plugins $n = 0; foreach ($installed_plugins as $plugin => $data) { if (is_plugin_enabled($plugin)) { echo elgg_view("usersettings/plugins_opt/plugin", array('plugin' => $plugin, 'details' => $data)); } }
<?php /** * Elgg latest content page * * @package Elgg * @subpackage Core * @author Curverider Ltd * @link http://elgg.org/ */ /** * Start the Elgg engine */ require_once dirname(dirname(__FILE__)) . "/engine/start.php"; // Load the front page global $CONFIG; if (is_plugin_enabled('riverdashboard')) { $title = elgg_view_title(elgg_echo('content:latest')); set_context('search'); $content = elgg_list_registered_entities(array('limit' => 10, 'full_view' => FALSE, 'allowed_types' => array('object', 'group'))); set_context('latest'); } else { $content = "Riverdashboard not loaded"; } $content = elgg_view_layout('one_column_with_sidebar', $title . $content); page_draw(elgg_echo('content:latest'), $content);
<span>Bookmarks</span> <img class="icon" src="<?php echo elgg_get_site_url(); ?> mod/super_dashboard/images/tasks.png" alt="" /> </a> <?php } //End of Bookmarks Plugin Metro Dashboard Menu ?> <?php //Event Calendar Plugin Metro Dashboard Menu if (is_plugin_enabled(event_calendar)) { ?> <a class="box height2" href="<?php echo elgg_get_site_url(); ?> event_calendar/list/" style="background: #4c5e51;"> <span>Event Calendar</span> <img class="icon big" src="<?php echo elgg_get_site_url(); ?> mod/super_dashboard/images/deviantart.png" alt="" /> </a> <?php }
echo elgg_echo('twitterservice:twittername'); ?> <?php echo elgg_view('input/text', array('internalname' => 'params[twittername]', 'value' => $vars['entity']->twittername)); ?> </label></p> <p><label> <?php echo elgg_echo('twitterservice:twitterpass'); ?> <?php echo elgg_view('input/password', array('internalname' => 'params[twitterpass]', 'value' => $vars['entity']->twitterpass)); ?> </label></p> <?php if (is_plugin_enabled('thewire')) { ?> <p> <?php echo elgg_echo('twitterservice:postwire'); ?> <select name="params[sendtowire]"> <option value="yes" <?php if ($vars['entity']->sendtowire == 'yes') { echo " selected=\"yes\" "; } ?> ><?php echo elgg_echo('option:yes'); ?>
<?php /** * Elgg vazco_mainpage plugin * * @author Michal Zacher [michal.zacher@gmail.com] */ if (is_plugin_enabled('groups')) { //newest groups $groups = get_entities('group', '', 0, 4, false, false, false); ?> <!-- display latest groups --> <div class="index_box"> <h2><?php echo elgg_echo("custom:groups"); ?> </h2> <div class="contentWrapper"> <?php if (isset($groups)) { //display member avatars foreach ($groups as $group) { echo "<div class=\"index_members\">"; echo elgg_view("vazco_mainpage/groups/icon", array('entity' => $group, 'size' => 'small')); echo "</div>"; } } else { echo "<p><?php echo elgg_echo('custom:nogroups'); ?>.</p>"; } ?>
<?php if (is_plugin_enabled('pages')) { $limit = get_plugin_setting('pages_num_items', 'vazco_mainpage'); if (!isset($limit) || !$limit) { $limit = 10; } $objects = list_entities("object", "page_top", 0, $limit, false); ?> <div class="index_box listing_narrow"> <h2><?php echo elgg_echo("custom:pages"); ?> </h2> <div class="search_listing"> <?php if ($objects != '') { echo $objects; } else { echo elgg_echo('vazco_mainpage:pages:nopages'); } ?> </div> </div> <?php }
<?php /** * Elgg vazco_mainpage plugin * * @author Michal Zacher [michal.zacher@gmail.com] */ if (is_plugin_enabled('file')) { //grab the latest files $files = get_entities('object', 'file', 0, "", 4); ?> <!-- display latest files --> <div class="index_box"> <h2><?php echo elgg_echo("custom:files"); ?> </h2> <?php if (!empty($files)) { foreach ($files as $file) { $vars['entity'] = $file; $info = "<p> <a href=\"{$file->getURL()}\">{$file->title}</a></p>"; $info .= "<p class=\"owner_timestamp\"><a href=\"{$vars['url']}pg/file/{$owner->username}\">{$owner->name}</a> {$friendlytime}"; $numcomments = elgg_count_comments($file); if ($numcomments) { $info .= ", <a href=\"{$file->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a>"; } $info .= "</p>"; // $icon = elgg_view("profile/icon",array('entity' => $owner, 'size' => 'small')); if ($file->smallthumb) {
/** * main function that register everything * * @global <type> $CONFIG */ function init_izap_videos() { global $CONFIG; // render this plugin from izap-elgg-bridge now if (is_plugin_enabled('izap-elgg-bridge')) { func_init_plugin_byizap(array('plugin' => array('name' => GLOBAL_IZAP_VIDEOS_PLUGIN))); } else { register_error('This plugin needs izap-elgg-bridge'); disable_plugin(GLOBAL_IZAP_VIDEOS_PLUGIN); } // for the first time, admin settings are not set so send admin to the setting page, to set the default settings if (isadminloggedin() && (int) datalist_get('izap_videos_installtime') == 0) { datalist_set('izap_videos_installtime', time()); forward($CONFIG->wwwroot . 'pg/videos/adminSettings/' . get_loggedin_user()->username . '?option=settings'); } // extend the views if (is_callable('elgg_extend_view')) { $extend_view = 'elgg_extend_view'; } else { $extend_view = 'extend_view'; } // include the main lib file include dirname(__FILE__) . '/lib/izapLib.php'; // load all the required files izapLoadLib_izap_videos(); // register pagehandler register_page_handler('videos', 'pageHandler_izap_videos'); register_page_handler('izap_videos_files', 'pageHandler_izap_videos_files'); // register the notification hook if (is_callable('register_notification_object')) { register_notification_object('object', 'izap_videos', elgg_echo('izap_videos:newVideoAdded')); } $period = get_plugin_setting('izap_cron_time', GLOBAL_IZAP_VIDEOS_PLUGIN); if (isOnserverEnabled() && is_plugin_enabled('crontrigger') && $period != 'none') { register_plugin_hook('cron', $period, 'izap_queue_cron'); } // asking group to include the izap_videos if (is_callable('add_group_tool_option')) { add_group_tool_option('izap_videos', elgg_echo('izap_videos:group:enablevideo'), true); } // register the notification hook if (is_callable('register_notification_object')) { register_notification_object('object', 'izap_videos', elgg_echo('izap_videos:newVideoAdded')); } // skip tags from filteration if (is_old_elgg()) { //allow some tags for elgg lesser than 1.6 $CONFIG->allowedtags['object'] = array('width' => array(), 'height' => array(), 'classid' => array(), 'codebase' => array(), 'data' => array(), 'type' => array()); $CONFIG->allowedtags['param'] = array('name' => array(), 'value' => array()); $CONFIG->allowedtags['embed'] = array('src' => array(), 'type' => array(), 'wmode' => array(), 'width' => array(), 'height' => array()); } else { $allowed_tags = get_plugin_setting('izapHTMLawedTags', GLOBAL_IZAP_VIDEOS_PLUGIN); $CONFIG->htmlawed_config['elements'] = 'object, embed, param, p, img, b, i, ul, li, ol, u, a, s, blockquote, br, strong, em' . ($allowed_tags ? ', ' . $allowed_tags : ''); } run_function_once('izapSetup_izap_videos'); $extend_view('css', 'izap_videos/css/default'); $extend_view('metatags', 'izap_videos/js/javascript'); //$extend_view('profile/menu/links','izap_videos/menu'); $extend_view('groups/right_column', 'izap_videos/gruopVideos', 1); // only if enabled by admin if (izapIncludeIndexWidget_izap_videos()) { $extend_view('index/righthandside', 'izap_videos/customindexVideos'); } // only if enabled by admin if (izapTopBarWidget_izap_videos()) { $extend_view('elgg_topbar/extend', 'izap_videos/navBar'); } // finally lets register the object register_entity_type('object', 'izap_videos'); }
<?php if (is_plugin_enabled('blog')) { //grab the latest 4 blog posts. to display more, change 4 to something else //$blogs = list_entities('object','blog',0,4,false, false, false); $blogs = get_entities('object', 'blog', 0, "", 4, 0, false); ?> <!-- latest blogs --> <div class="index_box"> <h2><?php echo elgg_echo("custom:blogs"); ?> </h2> <?php foreach ($blogs as $blog) { echo elgg_view('vazco_mainpage/objects/blog', array('entity' => $blog)); //display blog posts } ?> </div> <?php }
<?php if (is_plugin_enabled('tidypics')) { $limit = get_plugin_setting('tidypics_num_items', 'vazco_mainpage'); if (!isset($limit) || !$limit) { $limit = 10; } $images = get_entities('object', 'image', 0, 0, $limit, false, false); ?> <div class="index_box"> <h2><?php echo elgg_echo("custom:tidypics"); ?> </h2> <div class="search_listing"> <?php if (isset($images)) { $counter = -1; echo '<div class="frontpage_tidypics_box_narrow">'; foreach ($images as $image) { $counter += 1; if ($counter == 2) { $counter = 0; echo "</div>"; echo '<div class="frontpage_tidypics_box_narrow">'; } echo "<div class=\"tidypics_index\">"; echo elgg_view("vazco_mainpage/tidypics/icon", array('mimetype' => $image->mimetype, 'thumbnail' => $image->thumbnail, 'file_guid' => $image->guid, 'link' => $image->getUrl(), 'size' => 'small')); echo "</div>"; //tidypics_index
<div class="index_box"> <h2><?php echo elgg_echo('custom:quote'); ?> </h2> <div class="search_listing"> <?php if (is_plugin_enabled('quoteoftheday')) { $todays_quote = get_featured_quote_entity(); if ($todays_quote) { if (isloggedin()) { echo elgg_view_entity($todays_quote); } else { echo $todays_quote->description; } } else { echo elgg_echo('quoteoftheday:emptyset'); } } ?> </div> </div>