Beispiel #1
0
/**
 * Comment wall initialisation.
 */
function commentwall_init()
{
    global $CFG, $db, $function, $metatags, $template;
    // Add meta tags
    $metatags .= "<script type=\"text/javascript\" src=\"{$CFG->wwwroot}mod/commentwall/commentwall.js\"><!-- commentwall js --></script>";
    // Define some templates
    templates_add_context('commentwallobject', 'mod/commentwall/template');
    templates_add_context('commentwallfooter', 'mod/commentwall/footer');
    templates_add_context('css', 'mod/commentwall/css');
    // Set up the database
    $tables = $db->Metatables();
    if (!in_array($CFG->prefix . "commentwall", $tables)) {
        if (file_exists($CFG->dirroot . "mod/commentwall/{$CFG->dbtype}.sql")) {
            modify_database($CFG->dirroot . "mod/commentwall/{$CFG->dbtype}.sql");
            //reload system
            header_redirect($CFG->wwwroot);
        } else {
            error("Error: Your database ({$CFG->dbtype}) is not yet fully supported by the Elgg commentwall. See the mod/commentwall directory.");
        }
        print_continue($CFG->wwwroot);
        exit;
    }
    // Add configuration options
    $function['userdetails:edit:details'][] = $CFG->dirroot . "mod/commentwall/lib/commentwall_settings.php";
}
Beispiel #2
0
function generic_comments_init()
{
    global $CFG, $db, $function, $metatags, $template;
    $metatags .= "<script type=\"text/javascript\" src=\"{$CFG->wwwroot}mod/generic_comments/generic_comments.js\"><!-- generic_comments js --></script>";
    // create the generic_comments and generic watchlist table
    $tables = $db->Metatables();
    if (!in_array($CFG->prefix . "comments", $tables) || !in_array($CFG->prefix . "watchlist", $tables)) {
        if (file_exists($CFG->dirroot . "mod/generic_comments/{$CFG->dbtype}.sql")) {
            modify_database($CFG->dirroot . "mod/generic_comments/{$CFG->dbtype}.sql");
            //reload system
            header_redirect($CFG->wwwroot);
        } else {
            error("Error: Your database ({$CFG->dbtype}) is not yet fully supported by the Elgg generic comments.  See the mod/generic_comments directory.");
        }
        print_continue("index.php");
        exit;
    }
    $function['comments:init'][] = $CFG->dirroot . "mod/generic_comments/comments_actions.php";
    $function['permissions:check'][] = $CFG->dirroot . "mod/generic_comments/permissions_check.php";
    // Add annotation support
    display_set_display_annotation_function("file::file", "generic_comments_displayobjectannotations");
    display_set_display_annotation_function("mediastream::media", "generic_comments_displayobjectannotations");
    // Register file river hook (if there)
    if (function_exists('river_save_event')) {
        river_register_friendlyname_hook('file::file', 'generic_comments_get_friendly_name');
    }
    templates_add_context('embeddedcomments', 'mod/generic_comments/comments');
    templates_add_context('embeddedcomment', 'mod/generic_comments/comment');
    templates_add_context('css', 'mod/generic_comments/css', true, false);
}
Beispiel #3
0
<?php

global $CFG, $template;
templates_add_context('css', 'mod/widget/css');
<?php

global $CFG;
global $template;
global $template_definition;
$sitename = $CFG->sitename;
$template_definition[] = array('id' => 'css', 'name' => __gettext("Stylesheet"), 'description' => __gettext("The Cascading Style Sheet for the template."), 'glossary' => array(), 'display' => 1);
templates_add_context('css', $CFG->templatesroot . 'Default_Template/css');
$template_definition[] = array('id' => 'pageshell', 'name' => __gettext("Page Shell"), 'description' => __gettext("The main page shell, including headers and footers."), 'display' => 1, 'glossary' => array('{{metatags}}' => __gettext("Page metatags (mandatory) - must be in the 'head' portion of the page"), '{{title}}' => __gettext("Page title"), '{{menu}}' => __gettext("Menu"), '{{topmenu}}' => __gettext("Status menu"), '{{mainbody}}' => __gettext("Main body"), '{{register}}' => __gettext("Register"), '{{sidebar}}' => __gettext("Sidebar")));
templates_add_context('pageshell', $CFG->templatesroot . 'Default_Template/pageshell');
$template_definition[] = array('id' => 'logged_in', 'name' => __gettext("Logged In"), 'description' => __gettext("The main page shell, including headers and footers."), 'display' => 1, 'glossary' => array('{{metatags}}' => __gettext("Page metatags (mandatory) - must be in the 'head' portion of the page"), '{{title}}' => __gettext("Page title"), '{{menu}}' => __gettext("Menu"), '{{topmenu}}' => __gettext("Status menu"), '{{mainbody}}' => __gettext("Main body"), '{{register}}' => __gettext("Register"), '{{sidebar}}' => __gettext("Sidebar")));
templates_add_context('logged_in', $CFG->templatesroot . 'Default_Template/logged_in');
templates_add_context('frontpage_loggedout', $CFG->templatesroot . 'Default_Template/frontpage_loggedout');
templates_add_context('frontpage_loggedin', $CFG->templatesroot . 'Default_Template/frontpage_loggedin');
templates_add_context('register_loggedout', $CFG->templatesroot . 'Default_Template/register_loggedout');
$template_definition[] = array('id' => 'contentholder', 'name' => __gettext("Content holder"), 'description' => __gettext("Contains the main content for a page (as opposed to the sidebar or the title)."), 'glossary' => array('{{title}}' => __gettext("The title"), '{{submenu}}' => __gettext("The page submenu"), '{{body}}' => __gettext("The body of the page")));
$template['contentholder'] = <<<END
    <h1>{{title}}</h1>
\t{{submenu}}
    {{body}}

END;
$template_definition[] = array('id' => 'sidebarholder', 'name' => __gettext("Sidebar section holder"), 'description' => __gettext("Contains the sidebar section titles"), 'glossary' => array('{{title}}' => __gettext("The header"), '{{body}}' => __gettext("The body of the page")));
$template['sidebarholder'] = <<<END
    <h2>{{title}}</h2>
       {{body}}

END;
$template_definition[] = array('id' => 'ownerbox', 'name' => __gettext("Owner box"), 'description' => __gettext("A box containing a description of the owner of the current profile."), 'glossary' => array('{{name}}' => __gettext("The user's name"), '{{profileurl}}' => __gettext("The URL of the user's profile page, including terminating slash"), '{{usericon}}' => __gettext("The user's icon, if it exists"), '{{tagline}}' => __gettext("A short blurb about the user"), '{{usermenu}}' => __gettext("Links to friend / unfriend a user"), '{{lmshosts}}' => __gettext("Links to any lms hosts the user is attached to")));
$tags = __gettext("Tags");
$resources = __gettext("Resources");
$template_definition[] = array('id' => 'sidebar:wrap', 'name' => __gettext('Sidebar holder wrap'), 'description' => __gettext('Sidebar'), 'glossary' => array('{{body}}' => __gettext('Sidebar body')));
$sidebar_wrap = <<<END

<div id="sidebar-holder">
    {{body}}
</div>
END;
// override legacy sidebarholder template
$template_definition[] = array('id' => 'sidebarholder', 'name' => __gettext('Sidebar boxholder'), 'description' => __gettext('Content for each block'), 'glossary' => array('{{title}}' => __gettext('Title of block'), '{{body}}' => __gettext('Body of block')));
$sidebarholder = <<<END
    <div class="sidebar-title">
        <h2>{{title}}</h2>
    </div>

    <div class="sidebar-body">
        {{body}}
    </div>
END;
// block wrapper
$template_definition[] = array('id' => 'sidebar:block', 'name' => __gettext('Sidebar block'), 'description' => __gettext('Sidebar block holder'), 'glossary' => array('{{id}}' => __gettext('CSS id'), '{{class}}' => __gettext('CSS class'), '{{body}}' => __gettext('Body of block')));
$sidebar_block = <<<END

<div id="{{id}}" class="sidebar-block {{class}}">
    {{body}}
</div>
END;
// add templates and override if exists
templates_add_context('sidebar:wrap', $sidebar_wrap, false, true);
templates_add_context('sidebarholder', $sidebarholder, false, true);
templates_add_context('sidebar:block', $sidebar_block, false, true);
<?php

/*
 * default_template.php
 *
 * Created on Apr 16, 2007
 *
 * @author Diego Andrés Ramírez Aragón <*****@*****.**>
 */
global $template;
global $template_definition;
$template_definition[] = array('id' => 'friends_friends', 'name' => __gettext("Friends page"), 'description' => __gettext("A template for the friends page."), 'glossary' => array('{{friends}}' => __gettext('Friends list')));
$template_definition[] = array('id' => 'friends_friend', 'name' => __gettext("Friend visualization"), 'description' => __gettext("A template for friend display"), 'glossary' => array('{{name}}' => __gettext("Friend's name"), '{{link}}' => __gettext("Friend's profile page"), '{{icon}}' => __gettext("Friend's icon"), '{{menu}}' => __gettext("Friend's functions")));
templates_add_context('friends_friends', "<div id=\"networktable\"><table width=\"80%\" cellspacing=\"5\"><tr>{{friends}}</tr></table></div>", false);
templates_add_context('friends_friend', 'mod/friend/templates/friends_friend.html');
<?php

/*
 * default_template.php
 *
 * Created on Apr 9, 2007
 *
 * @author Diego Andrés Ramírez Aragón <*****@*****.**>
 */
global $template;
global $template_definitions;
$template_definition[] = array('id' => 'community_members', 'name' => __gettext("Comminity Members admin page"), 'description' => __gettext("A template for the community members admin page."), 'glossary' => array('{{members}}' => __gettext('Community members list')));
$template_definition[] = array('id' => 'community_member', 'name' => __gettext("Community member visualization"), 'description' => __gettext("A template for the community member display"), 'glossary' => array('{{name}}' => __gettext("Member's name"), '{{link}}' => __gettext("Member's profile page"), '{{icon}}' => __gettext("Member's icon"), '{{functions}}' => __gettext("Member's functions")));
$template_definition[] = array('id' => 'community_membership', 'name' => __gettext("Community membership visualization"), 'description' => __gettext("A template for the community membership display"), 'glossary' => array('{{name}}' => __gettext("Member's name"), '{{link}}' => __gettext("Member's profile page"), '{{icon}}' => __gettext("Member's icon"), '{{functions}}' => __gettext("Member's functions")));
$template_definition[] = array('id' => 'community_create', 'name' => __gettext("Community creation"), 'description' => __gettext("A template for the community creation form"), 'glossary' => array('{{title}}' => __gettext("Page title"), '{{form_fields}}' => __gettext("Form fields")));
templates_add_context('community_members', "<div id=\"networktable\"><table width=\"80%\" cellspacing=\"5\"><tr>{{members}}</tr></table></div>", false);
templates_add_context('community_member', 'mod/community/templates/community_member_view.html');
templates_add_context('community_membership', 'mod/community/templates/community_membership_view.html');
templates_add_context('community_create', 'mod/community/templates/community_create.html');
<?php

/*
 * This script configure the templates used for the private messages plug-in
 *
 * @author Diego Andrés Ramírez Aragón <*****@*****.**>
 * @copyright Corporación Somos Más - 2007
*/
// Add CSS
templates_add_context('css', 'mod/messages/css.css', true, true);
// Add page templates
templates_add_context('plug_messages', "mod/messages/templates/messages_messages.html");
templates_add_context('plug_message', "mod/messages/templates/messages_message.html");
templates_add_context('plug_detailedmessage', "mod/messages/templates/messages_detailed_message.html");
<?php

templates_add_context('weblogpost', 'mod/blog/templates/blog_post.html');
templates_add_context('weblogcomments', 'mod/blog/templates/blog_comments.html');
templates_add_context('weblogcomment', 'mod/blog/templates/blog_comment.html');
<?php

global $template;
global $template_definition;
$template_definition[] = array('id' => 'folder', 'name' => __gettext("Folder"), 'description' => __gettext("Each individual folder"), 'glossary' => array('{{username}}' => __gettext("The owner of the folder"), '{{name}}' => __gettext("The name of the folder"), '{{url}}' => __gettext("The folder's URL"), '{{menu}}' => __gettext("Menu items for folder owner (edit, delete, etc)"), '{{icon}}' => __gettext("The URL of the file's icon"), '{{keywords}}' => __gettext("Keywords associated with the folder")));
$template_definition[] = array('id' => 'file', 'name' => __gettext("File"), 'description' => __gettext("Each individual file within a folder"), 'glossary' => array('{{url}}' => __gettext("The file's URL"), '{{originalname}}' => __gettext("Its filename"), '{{description}}' => __gettext("A description of the file"), '{{title}}' => __gettext("Its title"), '{{menu}}' => __gettext("Menu items for file owner (edit, delete, etc)"), '{{icon}}' => __gettext("The URL of its icon"), '{{keywords}}' => __gettext("Keywords associated with the folder")));
$template_definition[] = array('id' => 'file_wizard', 'name' => __gettext("File selection wizard"), 'description' => __gettext("Wizard page that show the file list"), 'glossary' => array('{{user_id}}' => __gettext("File's owner id"), '{{folder}}' => __gettext("Initial folder"), '{{input_field}}' => __gettext("Input field to be modified by the wizard")));
templates_add_context('folder', 'mod/file/templates/file_folder.html');
templates_add_context('file', 'mod/file/templates/file_file.html');
templates_add_context('file_wizard', 'mod/file/templates/file_wizard.html');
<?php

/*
 * This script defines the templates used by the content toolbar module
 * 
 * Created on Apr 3, 2007
 * 
 * @uses $template
 * @uses $template_definitions
 * 
 * @author Diego Andrés Ramírez Aragón <*****@*****.**>
 * @copyright Diego Andrés Ramírez Aragón - 2007
*/
global $template;
global $template_definition;
$template_definition[] = array('id' => 'contenttoolbar', 'name' => __gettext("Content Toolbar"), 'description' => __gettext("A placeholder for content related buttons (resources, videos)"), 'glossary' => array('{{js_buttons}}' => __gettext("JS buttons definitions"), '{{buttons}}' => __gettext("Buttons definitions")));
$template_definition[] = array('id' => 'video_wizard', 'name' => __gettext("Video insert wizard page"), 'description' => __gettext("The wizard page to add a video from an external site"), 'glossary' => array('{{title}}' => __gettext("Site name"), '{{explanation}}' => __gettext("Wizard explanation"), '{{video_url_label}}' => __gettext("Video URL label"), '{{video_size_label}}' => __gettext("Video size label"), '{{video_button_label}}' => __gettext("Video insert button label"), '{{input_field}}' => __gettext("Input field for the video tag"), '{{error_msg}}' => __gettext("Invalid embed object error message")));
templates_add_context('contenttoolbar', 'mod/contenttoolbar/templates/contenttoolbar.html');
templates_add_context('video_wizard', 'mod/contenttoolbar/templates/video_wizard.html');