/** * Profile init function; sets up the profile functions * */ function flexprofile_init() { // override profile views set_view_location("profile/userdetails", dirname(__FILE__) . '/views/'); set_view_location("profile/edit", dirname(__FILE__) . '/views/'); // Register a page handler, so we can have nice URLs register_page_handler('flexprofile', 'flexprofile_page_handler'); }
/** * TinyMCE wysiwyg editor * @package ElggTinyMCE * @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.org/ **/ function tinymce_init() { // Load system configuration global $CONFIG; // Add our CSS elgg_extend_view('css', 'tinymce/css'); set_view_location('embed/addcontentjs', $CONFIG->pluginspath . 'tinymce/views/'); }
function sociable_init() { global $CONFIG; if (elgg_get_context() === "admin") { elgg_unregister_css("twitter-bootstrap"); elgg_unregister_css("ui-lightness"); elgg_unregister_css("sociable"); elgg_unregister_css("bubblegum"); elgg_unregister_css("righteous"); elgg_unregister_css("ubuntu"); elgg_unregister_js("sociable"); elgg_unregister_js("jquery-migrate"); elgg_unregister_js("twitter-bootstrap"); } else { elgg_register_css("twitter-bootstrap", $CONFIG->url . "mod/sociable/vendors/bootstrap/css/bootstrap.css"); elgg_register_css("ui-lightness", $CONFIG->url . "mod/sociable/vendors/jquery-ui-1.10.2.custom/css/ui-lightness/jquery-ui-1.10.2.custom.min.css"); elgg_register_css("sociable", $CONFIG->url . "mod/sociable/css/sociable.css"); elgg_register_css("bubblegum", "http://fonts.googleapis.com/css?family=Bubblegum+Sans"); elgg_register_css("righteous", "http://fonts.googleapis.com/css?family=Righteous"); elgg_register_css("ubuntu", "http://fonts.googleapis.com/css?family=Ubuntu:400,300,300italic,400italic,500,500italic,700,700italic"); elgg_register_js("sociable", $CONFIG->url . "mod/sociable/js/sociable.js"); elgg_register_js("jquery", $CONFIG->url . "mod/sociable/vendors/jquery/jquery-1.9.1.min.js", "head", 0); elgg_register_js("jquery-migrate", $CONFIG->url . "mod/sociable/vendors/jquery/jquery-migrate-1.1.1.js", "head", 1); elgg_register_js("jquery-ui", $CONFIG->url . "mod/sociable/vendors/jquery-ui-1.10.2.custom/js/jquery-ui-1.10.2.custom.min.js", "head", 2); elgg_register_js("twitter-bootstrap", $CONFIG->url . "mod/sociable/vendors/bootstrap/js/bootstrap.min.js"); elgg_load_css("ui-lightness"); elgg_load_css("twitter-bootstrap"); elgg_load_js("jquery-migrate"); elgg_load_js("sociable"); elgg_load_js("twitter-bootstrap"); elgg_load_css("righteous"); elgg_load_css("ubuntu"); elgg_load_css("bubblegum"); elgg_load_css("sociable"); set_view_location("navigation/menu/site", elgg_get_plugins_path() . "sociable/new_views/"); set_view_location("navigation/menu/elements/item", elgg_get_plugins_path() . "sociable/new_views/"); set_view_location("navigation/menu/elements/section", elgg_get_plugins_path() . "sociable/new_views/"); set_view_location("navigation/tabs", elgg_get_plugins_path() . "sociable/new_views/"); set_view_location("navigation/menu/widget", elgg_get_plugins_path() . "sociable/new_views/"); } }
/** * Auto-registers views from a particular starting location * * @param string $view_base The base of the view name * @param string $folder The folder to begin looking in * @param string $base_location_path The base views directory to use with set_view_location * @param string $viewtype The type of view we're looking at (default, rss, etc) */ function autoregister_views($view_base, $folder, $base_location_path, $viewtype) { if (!isset($i)) { $i = 0; } if ($handle = opendir($folder)) { while ($view = readdir($handle)) { if (!in_array($view, array('.', '..', '.svn', 'CVS')) && !is_dir($folder . "/" . $view)) { if (substr_count($view, ".php") > 0 || substr_count($view, ".png") > 0) { if (!empty($view_base)) { $view_base_new = $view_base . "/"; } else { $view_base_new = ""; } set_view_location($view_base_new . str_replace(".php", "", $view), $base_location_path, $viewtype); } } else { if (!in_array($view, array('.', '..', '.svn', 'CVS')) && is_dir($folder . "/" . $view)) { if (!empty($view_base)) { $view_base_new = $view_base . "/"; } else { $view_base_new = ""; } autoregister_views($view_base_new . $view, $folder . "/" . $view, $base_location_path, $viewtype); } } } } }
<?php admin_gatekeeper(); // remove some view extensions digest_prepare_run(); //overide view set_view_location('river/elements/summary', elgg_get_plugins_path() . "digest/views/custom/"); $digest = "site"; $interval = DIGEST_INTERVAL_MONTHLY; $header_text = elgg_get_plugin_setting("custom_text_site_header", "digest"); $footer_text = elgg_get_plugin_setting("custom_text_site_footer", "digest"); switch ($page[1]) { case "group": if (!empty($page[3]) && ($group = get_entity($page[3])) && elgg_instanceof($group, "group")) { $digest = "group"; $header_text = elgg_get_plugin_setting("custom_text_group_header", "digest"); $footer_text = elgg_get_plugin_setting("custom_text_group_footer", "digest"); } else { forward(); } case "site": default: $interval = $page[2]; break; } // set some interval settings $ts_upper = time(); switch ($interval) { case DIGEST_INTERVAL_DAILY: $ts_lower = $ts_upper - 60 * 60 * 24; break;