diff options
Diffstat (limited to 'mod/walledgarden')
-rw-r--r-- | mod/walledgarden/index.php | 24 | ||||
-rw-r--r-- | mod/walledgarden/manifest.xml | 10 | ||||
-rw-r--r-- | mod/walledgarden/readme.txt | 1 | ||||
-rw-r--r-- | mod/walledgarden/start.php | 58 | ||||
-rw-r--r-- | mod/walledgarden/views/default/account/forms/login.php | 30 | ||||
-rw-r--r-- | mod/walledgarden/views/default/canvas/layouts/new_index.php | 30 | ||||
-rw-r--r-- | mod/walledgarden/views/default/walledgarden/css.php | 37 | ||||
-rw-r--r-- | mod/walledgarden/views/default/walledgarden/walledgarden.php | 15 |
8 files changed, 205 insertions, 0 deletions
diff --git a/mod/walledgarden/index.php b/mod/walledgarden/index.php new file mode 100644 index 000000000..ca822d78a --- /dev/null +++ b/mod/walledgarden/index.php @@ -0,0 +1,24 @@ +<?php + + /** + * Elgg custom index + * + * @package ElggCustomIndex + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd <info@elgg.com> + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ + + // Get the Elgg engine + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + //grab the login form + $login = elgg_view("account/forms/login"); + + //display the contents in our new canvas layout + $body = elgg_view_layout('new_index',$login); + + page_draw($title, $body); + +?>
\ No newline at end of file diff --git a/mod/walledgarden/manifest.xml b/mod/walledgarden/manifest.xml new file mode 100644 index 000000000..1f4b28a1b --- /dev/null +++ b/mod/walledgarden/manifest.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<plugin_manifest> + <field key="author" value="Curverider" /> + <field key="version" value="1.7" /> + <field key="description" value="Walled garden support for Elgg" /> + <field key="website" value="http://www.elgg.org/" /> + <field key="copyright" value="(C) Curverider 2008-2010" /> + <field key="licence" value="GNU Public License version 2" /> + <field key="elgg_version" value="2010030101" /> +</plugin_manifest> diff --git a/mod/walledgarden/readme.txt b/mod/walledgarden/readme.txt new file mode 100644 index 000000000..5df459b5d --- /dev/null +++ b/mod/walledgarden/readme.txt @@ -0,0 +1 @@ +Make sure the walledgarden plugin is the last one in the plugin list to ensure it works as expected.
\ No newline at end of file diff --git a/mod/walledgarden/start.php b/mod/walledgarden/start.php new file mode 100644 index 000000000..9d28a1418 --- /dev/null +++ b/mod/walledgarden/start.php @@ -0,0 +1,58 @@ +<?php + + /** + * 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(); + //} + + } + + function walledgarden_pagesetup() { + + global $CONFIG; + if (current_page_url() != $CONFIG->url + && !defined('externalpage') + && !isloggedin()) { + forward(); + exit; + } + + } + + function walledgarden_index() { + + if (!include_once(dirname(dirname(__FILE__))) . "/walledgarden/index.php") { + return false; + } + return true; + + } + + register_elgg_event_handler('init','system','walledgarden_init'); + register_elgg_event_handler('pagesetup','system','walledgarden_pagesetup'); +?> diff --git a/mod/walledgarden/views/default/account/forms/login.php b/mod/walledgarden/views/default/account/forms/login.php new file mode 100644 index 000000000..86ff473e5 --- /dev/null +++ b/mod/walledgarden/views/default/account/forms/login.php @@ -0,0 +1,30 @@ +<?php + + /** + * Elgg login form + * + * @package Elgg + * @subpackage Core + * @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/ + */ + + global $CONFIG; + + $form_body = "<p class=\"loginbox\"><label>" . elgg_echo('username') . "<br />" . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login-textarea')) . "</label>"; + $form_body .= "<br />"; + $form_body .= "<label>" . elgg_echo('password') . "<br />" . elgg_view('input/password', array('internalname' => 'password', 'class' => 'login-textarea')) . "</label><br />"; + $form_body .= elgg_view('input/submit', array('value' => elgg_echo('login'))) . " <div id=\"persistent_login\"><label><input type=\"checkbox\" name=\"persistent\" value=\"true\" />".elgg_echo('user:persistent')."</label></div></p>"; + $form_body .= "<p class=\"loginbox\">"; + $form_body .= (!isset($CONFIG->disable_registration) || !($CONFIG->disable_registration)) ? "<a href=\"{$vars['url']}pg/register.php\">" . elgg_echo('register') . "</a> | " : ""; + + //<input name=\"username\" type=\"text\" class="general-textarea" /></label> +?> + + <div id="login-box"> + <h2><?php echo elgg_echo('login'); ?></h2> + <?php echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$vars['url']}action/login")); ?> + + </div> diff --git a/mod/walledgarden/views/default/canvas/layouts/new_index.php b/mod/walledgarden/views/default/canvas/layouts/new_index.php new file mode 100644 index 000000000..d29b2c6e6 --- /dev/null +++ b/mod/walledgarden/views/default/canvas/layouts/new_index.php @@ -0,0 +1,30 @@ +<?php + + /** + * Elgg basic frontpage for the walled garden + * + * @package Elgg + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008 + * @link http://elgg.org/ + */ + +?> + +<div id="custom_index"> + + <!-- left column content --> + <div id="index_left"> + <?php + //this displays some content when the user is logged out + if (!isloggedin()){ + //display the login form + echo $vars['area1']; + echo "<div class=\"clearfloat\"></div>"; + } + ?> + </div> + + <div class="clearfloat"></div> +</div>
\ No newline at end of file diff --git a/mod/walledgarden/views/default/walledgarden/css.php b/mod/walledgarden/views/default/walledgarden/css.php new file mode 100644 index 000000000..cef2dde8d --- /dev/null +++ b/mod/walledgarden/views/default/walledgarden/css.php @@ -0,0 +1,37 @@ +#custom_index { + margin:10px; +} +#index_left { + width:442px; + float:left; + margin:0 0 30px 0; + padding:0 0 20px 0; +} +#index_right { + width:442px; + float:right; + margin:0 0 30px 0; + padding:0 20px 20px 0; +} +#index_welcome { + padding:5px 20px; + border:1px solid silver; + background: white; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; +} +#index_welcome #login-box { + margin:10px 0 10px 0; + padding:0; +} +#index_box h2 { + color:#0054A7; + font-size:1.35em; + line-height:1.2em; + margin:0 0 0 8px; + padding:5px; +} +#index_box .index_members { + float:left; + margin:0pt 5px 5px 0pt; +} diff --git a/mod/walledgarden/views/default/walledgarden/walledgarden.php b/mod/walledgarden/views/default/walledgarden/walledgarden.php new file mode 100644 index 000000000..15969b3be --- /dev/null +++ b/mod/walledgarden/views/default/walledgarden/walledgarden.php @@ -0,0 +1,15 @@ +<?php + /** + * 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/ + */ + + // Forward! + if (!defined('externalpage')) + gatekeeper(); +?>
\ No newline at end of file |