diff options
Diffstat (limited to 'views')
464 files changed, 12146 insertions, 9397 deletions
diff --git a/views/default/account/forms/forgotten_password.php b/views/default/account/forms/forgotten_password.php deleted file mode 100644 index 48fafe4d8..000000000 --- a/views/default/account/forms/forgotten_password.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * Elgg forgotten password. - * - * @package Elgg - * @subpackage Core - */ - -$form_body = "<p>" . elgg_echo('user:password:text') . "</p>"; -$form_body .= "<p><label>". elgg_echo('username') . " " - . elgg_view('input/text', array('internalname' => 'username')) . "</label></p>"; -$form_body .= elgg_view('input/captcha'); -$form_body .= "<p>" . elgg_view('input/submit', array('value' => elgg_echo('request'))) . "</p>"; - -echo elgg_view('input/form', array( - 'action' => "action/user/requestnewpassword", - 'body' => $form_body, - 'class' => "margin-top" -)); -?> - -<script type="text/javascript"> - $(document).ready(function() { $('input[name=username]').focus(); }); -</script>
\ No newline at end of file diff --git a/views/default/account/forms/login.php b/views/default/account/forms/login.php deleted file mode 100644 index 87dd6d5ad..000000000 --- a/views/default/account/forms/login.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * Elgg login form - * - * @package Elgg - * @subpackage Core - */ -?> - -<p class='loginbox'> - <label><?php echo elgg_echo('loginusername'); ?></label> - <?php echo elgg_view('input/text', array('internalname' => 'username', 'class' => 'login-textarea')); ?> - <label><?php echo elgg_echo('password'); ?></label> - <?php echo elgg_view('input/password', array('internalname' => 'password', 'class' => 'login-textarea')); ?> - - <?php echo elgg_view('input/submit', array('value' => elgg_echo('login'))); ?> - - <span class='rememberme'> - <label> - <input type="checkbox" name="persistent" value="true" /> - <?php echo elgg_echo('user:persistent'); ?> - </label> - </span> - - <?php echo elgg_view('login/extend'); ?> - -<?php - if ($CONFIG->allow_registration) { - echo '<a class="registration_link" href="' . elgg_get_site_url() . 'pg/register/">' . elgg_echo('register') . '</a> | '; - } -?> - <a class="forgotten_password_link" href="<?php echo elgg_get_site_url(); ?>pages/account/forgotten_password.php"> - <?php echo elgg_echo('user:password:lost'); ?> - </a> -</p>
\ No newline at end of file diff --git a/views/default/account/forms/register.php b/views/default/account/forms/register.php deleted file mode 100644 index bf629b589..000000000 --- a/views/default/account/forms/register.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php -/** - * Elgg register form - * - * @package Elgg - * @subpackage Core - */ - -$register_url = elgg_get_site_url(); -if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) { - $register_url = str_replace("http:", "https:", $register_url); -} - -$username = get_input('u'); -$email = get_input('e'); -$name = get_input('n'); - -$admin_option = false; -$loggedin_user = get_loggedin_user(); - -if ($loggedin_user && $loggedin_user->isAdmin() && isset($vars['show_admin'])) { - $admin_option = true; -} - -$form_body = "<p><label>" . elgg_echo('name') . "<br />" . elgg_view('input/text' , array('internalname' => 'name', 'class' => "input-text name", 'value' => $name)) . "</label></p>"; -$form_body .= "<p><label>" . elgg_echo('email') . "<br />" . elgg_view('input/text' , array('internalname' => 'email', 'class' => "input-text", 'value' => $email)) . "</label></p>"; -$form_body .= "<p><label>" . elgg_echo('username') . "<br />" . elgg_view('input/text' , array('internalname' => 'username', 'class' => "input-text", 'value' => $username)) . "</label></p>"; -$form_body .= "<p><label>" . elgg_echo('password') . "<br />" . elgg_view('input/password' , array('internalname' => 'password', 'class' => "input-password")) . "</label></p>"; -$form_body .= "<p><label>" . elgg_echo('passwordagain') . "<br />" . elgg_view('input/password' , array('internalname' => 'password2', 'class' => "input-password")) . "</label></p>"; - -// view to extend to add more fields to the registration form -$form_body .= elgg_view('register/extend'); - -// Add captcha hook -$form_body .= elgg_view('input/captcha'); - -if ($admin_option) { - $form_body .= elgg_view('input/checkboxes', array('internalname' => "admin", 'options' => array(elgg_echo('admin_option')))); -} - -$form_body .= elgg_view('input/hidden', array('internalname' => 'friend_guid', 'value' => $vars['friend_guid'])); -$form_body .= elgg_view('input/hidden', array('internalname' => 'invitecode', 'value' => $vars['invitecode'])); -$form_body .= elgg_view('input/hidden', array('internalname' => 'action', 'value' => 'register')); -$form_body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('register'))) . "</p>"; - -echo elgg_view('input/form', array( - 'action' => "{$login_url}action/register", - 'body' => $form_body, - 'class' => "margin-top" -)); -?> - -<script type="text/javascript"> - $(document).ready(function() { $('input[name=name]').focus(); }); -</script> diff --git a/views/default/account/forms/useradd.php b/views/default/account/forms/useradd.php deleted file mode 100644 index 7c1969f1b..000000000 --- a/views/default/account/forms/useradd.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * Elgg add user form. - * - * @package Elgg - * @subpackage Core - */ - -$admin_option = false; -if ((get_loggedin_user()->isAdmin()) && ($vars['show_admin'])) { - $admin_option = true; -} - -$form_body = "<p><label>" . elgg_echo('name') . "<br />" . elgg_view('input/text' , array('internalname' => 'name')) . "</label></p>"; -$form_body .= "<p><label>" . elgg_echo('username') . "<br />" . elgg_view('input/text' , array('internalname' => 'username')) . "</label></p>"; -$form_body .= "<p><label>" . elgg_echo('email') . "<br />" . elgg_view('input/text' , array('internalname' => 'email')) . "</label></p>"; -$form_body .= "<p><label>" . elgg_echo('password') . "<br />" . elgg_view('input/password' , array('internalname' => 'password')) . "</label></p>"; -$form_body .= "<p><label>" . elgg_echo('passwordagain') . "<br />" . elgg_view('input/password' , array('internalname' => 'password2')) . "</label></p>"; -$form_body .= "<p>"; - -if ($admin_option) { - $form_body .= elgg_view('input/checkboxes', array('internalname' => "admin", 'options' => array(elgg_echo('admin_option')))); -} - -$form_body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('register'))) . "</p>"; -?> - -<div class="admin_settings add-user"> - <h3><?php echo elgg_echo('adduser'); ?></h3> - <?php echo elgg_view('input/form', array('action' => "action/useradd", 'body' => $form_body)) ?> -</div>
\ No newline at end of file diff --git a/views/default/account/login_box.php b/views/default/account/login_box.php deleted file mode 100644 index eb37d7554..000000000 --- a/views/default/account/login_box.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -/** - * Elgg login box - * - * @package Elgg - * @subpackage Core - */ - -$form_body = elgg_view('account/forms/login'); - -$login_url = elgg_get_site_url(); -if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) { - $login_url = str_replace("http:", "https:", $login_url); -} -?> - -<div id="login"> -<h2><?php echo elgg_echo('login'); ?></h2> - <?php - echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$login_url}action/login")); - ?> -</div> -<script type="text/javascript"> - $(document).ready(function() { $('input[name=username]').focus(); }); -</script> diff --git a/views/default/account/login_dropdown.php b/views/default/account/login_dropdown.php deleted file mode 100644 index dc124f4e8..000000000 --- a/views/default/account/login_dropdown.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php -/** - * Elgg drop-down login form - * - */ - -if (isloggedin()) { - return true; -} - -$form_body = elgg_view('account/forms/login'); -$form_body .= "<input type='hidden' name='returntoreferer' value='true' />"; - -$login_url = elgg_get_site_url(); -if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) { - $login_url = str_replace("http", "https", elgg_get_site_url()); -} - -?> - -<div id="login-dropdown"> - <div id="signin-button" class="signin-button"> - <a href="<?php echo $CONFIG->url; ?>pg/login" class="signin"><span><?php echo elgg_echo('login') ?></span></a> - </div> - <fieldset id="signin-menu"> - <?php echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$login_url}action/login")); ?> - </fieldset> -</div> - -<script type="text/javascript"> -$(document).ready(function() { - - $(".signin").click(function(e) { - e.preventDefault(); - $("fieldset#signin-menu").toggle(); - $(".signin").toggleClass("menu-open"); - $('.login-textarea.name').focus(); - }); - - $("fieldset#signin-menu").mouseup(function() { - return false - }); - - $(document).mouseup(function(e) { - if($(e.target).parent("a.signin").length==0) { - $(".signin").removeClass("menu-open"); - $("fieldset#signin-menu").hide(); - } - }); - -}); -</script>
\ No newline at end of file diff --git a/views/default/account/login_walled_garden.php b/views/default/account/login_walled_garden.php deleted file mode 100644 index 9f407bdff..000000000 --- a/views/default/account/login_walled_garden.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php -/** -* Walled Garden Login Form -*/ - -global $CONFIG; - -/* -$form_body = "<label>" . elgg_echo('username') . "<br />" . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login-textarea username')) . "</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'))); -$form_body .= "<div class='remember_me'><label><input type='checkbox' name='persistent' checked value='true' />".elgg_echo('user:persistent')."</label></div>"; - -$register = elgg_echo('register'); -$lost_password = elgg_echo('user:password:lost'); -$form_body .= '<p class="lost_password">'; -$form_body .= $CONFIG->allow_registration ? "<a class=\"registration_link\" href=\"".elgg_get_site_url()."pg/register/\">$register</a> | " : ''; -$form_body .= "<a class='forgotten_password_link' href=\"{$login_url}pages/account/forgotten_password.php\">$lost_password</a>"; -$form_body .= '</p>'; -*/ - -$form_body = elgg_view('account/forms/login'); -$form_body .= elgg_view('input/hidden', array('internalname' => 'returntoreferer', 'value' => 'true')); - -$login_url = elgg_get_site_url(); -if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) { - $login_url = str_replace("http", "https", elgg_get_site_url()); -} -?> -<h2><?php echo elgg_echo('login'); ?></h2> -<?php - echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$login_url}action/login")); - echo elgg_view('login/extend'); // view for plugins to extend -?> - -<?php -if ($CONFIG->allow_registration) { - $title = elgg_echo('register'); - $body = elgg_view("account/forms/register", array( - 'friend_guid' => (int) get_input('friend_guid', 0), - 'invitecode' => get_input('invitecode'), - )); - - echo <<<__HTML -<div id="registration_form" class="hidden clearfix"> -<div id="hiddenform_body" class="clearfix"> - <h2>$title</h2> - $body -</div><div id="hiddenform_bottom"></div></div> -__HTML; -} -?> - <?php - $lostpassword_form_body = "<p>" . elgg_echo('user:password:text') . "</p>"; - $lostpassword_form_body .= "<p class='margin-none'><label>". elgg_echo('username') . " " - . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login-textarea lostusername')) . "</label></p>"; - $lostpassword_form_body .= elgg_view('input/captcha'); - $lostpassword_form_body .= "<p>" . elgg_view('input/submit', array('value' => elgg_echo('request'))) . "<input class='action-button disabled cancel_request' type='reset' value='Cancel'></p>"; - - ?> -<div id="lostpassword_form" class="hidden clearfix"> - <div id="hiddenform_body" class="clearfix"> - <h2><?php echo elgg_echo('user:password:lost'); ?></h2> - <?php - echo elgg_view('input/form', array( - 'action' => "action/user/requestnewpassword", - 'body' => $lostpassword_form_body - )); - ?> -</div><div id="hiddenform_bottom"></div></div> - -<script type="text/javascript"> -$(document).ready(function() { - $('input.username').focus(); - - // add cancel button to inline register form - $('#registration_form').find('input.submit-button').after("<input class='action-button disabled cancel_request' type='reset' value='Cancel'>"); - - function elgg_slide_hiddenform(activateLink, parentElement, toggleElement) { - $(activateLink).closest(parentElement).find(toggleElement).animate({"width": "563px", duration: 400}); - $(activateLink).closest(parentElement).animate({"height": "256px", duration: 400}, function() { - // ewwww dirty. Webkit has problems when showing images that were hidden. - // forcing a reload of all the images. - $('.visual_captcha img').each(function() { $(this).attr('src', $(this).attr('src')); }); - }); - return false; - } - - $('a.registration_link').click(function(e) { - e.preventDefault(); - elgg_slide_hiddenform(this, '.walledgardenlogin', '#registration_form'); - $('input.name').focus(); - }); - - $('a.forgotten_password_link').click(function(e) { - e.preventDefault(); - elgg_slide_hiddenform(this, '.walledgardenlogin', '#lostpassword_form'); - $('input.lostusername').focus(); - }); - - $('input.cancel_request').click(function() { - if ($('#lostpassword_form').is(':visible')) { - $('#lostpassword_form').fadeOut(400); - location.reload(); - } else if ($('#registration_form').is(':visible')) { - $('#registration_form').fadeOut(400); - location.reload(); - } - return false; - }); -}); -</script> diff --git a/views/default/admin/appearance/default_widgets.php b/views/default/admin/appearance/default_widgets.php new file mode 100644 index 000000000..1bf5791ac --- /dev/null +++ b/views/default/admin/appearance/default_widgets.php @@ -0,0 +1,82 @@ +<?php +/** + * Default widgets landing page. + * + * @package Elgg.Core + * @subpackage Administration.DefaultWidgets + */ + +$object = elgg_get_entities(array( + 'type' => 'object', + 'subtype' => 'moddefaultwidgets', + 'limit' => 1, +)); + +if ($object) { + echo elgg_view('output/url', array( + 'text' => elgg_echo('upgrade'), + 'href' => 'action/widgets/upgrade', + 'is_action' => true, + 'is_trusted' => true, + 'class' => 'elgg_button elgg-button-submit', + 'title' => 'Upgrade your default widgets to work on Elgg 1.8', + )); +} + +elgg_push_context('default_widgets'); +$widget_context = get_input('widget_context'); +$list = elgg_trigger_plugin_hook('get_list', 'default_widgets', null, array()); + +// default to something if we can +if (!$widget_context && $list) { + $widget_context = $list[0]['widget_context']; +} + +$current_info = null; +$tabs = array(); +foreach ($list as $info) { + $url = "admin/appearance/default_widgets?widget_context={$info['widget_context']}"; + $selected = false; + if ($widget_context == $info['widget_context']) { + $selected = true; + $current_info = $info; + } + + $tabs[] = array( + 'title' => $info['name'], + 'url' => $url, + 'selected' => $selected + ); +} + +$tabs_vars = array( + 'tabs' => $tabs +); + +echo elgg_view('navigation/tabs', $tabs_vars); + +echo elgg_view('output/longtext', array('value' => elgg_echo('admin:default_widgets:instructions'))); + +if (!$current_info) { + $content = elgg_echo('admin:default_widgets:unknown_type'); +} else { + // default widgets are owned and saved to the site. + elgg_set_page_owner_guid(elgg_get_config('site_guid')); + elgg_push_context($current_info['widget_context']); + + $default_widgets_input = elgg_view('input/hidden', array( + 'name' => 'default_widgets', + 'value' => 1 + )); + + $params = array( + 'content' => $default_widgets_input, + 'num_columns' => $current_info['widget_columns'], + ); + + $content = elgg_view_layout('widgets', $params); + elgg_pop_context(); +} +elgg_pop_context(); + +echo $content; diff --git a/views/default/admin/appearance/menu_items.php b/views/default/admin/appearance/menu_items.php index 9bed69a06..1d5c95cf9 100644 --- a/views/default/admin/appearance/menu_items.php +++ b/views/default/admin/appearance/menu_items.php @@ -6,82 +6,5 @@ * @subpackage Core */ -$menu_items = get_register('menu'); -$featured_urls = get_config('menu_items_featured_urls'); -// get an alphabetical sort of the items + urls -foreach ($menu_items as $name => $info) { - $menu_sorted[$info->name] = $info->value->url; -} - -ksort($menu_sorted); - -$pulldown_values = array_flip($menu_sorted); -$pulldown_values[''] = elgg_echo('none'); - -echo elgg_view_title(elgg_echo('admin:menu_items')); -echo "<div class='admin_settings menuitems'><h3>".elgg_echo('admin:menu_items:configure')."</h3>"; -echo "<p class='margin-top'>".strip_tags(elgg_view('output/longtext', array('value' => elgg_echo("admin:menu_items:description"))))."</p>"; -$form_body = ''; - -// @todo Could probably make this number configurable -for ($i=0; $i<6; $i++) { - if (array_key_exists($i, $featured_urls)) { - $current_value = $featured_urls[$i]->value->url; - } else { - $current_value = ''; - } - - $form_body .= elgg_view('input/pulldown', array( - 'options_values' => $pulldown_values, - 'internalname' => 'featured_urls[]', - 'value' => $current_value - )); -} - -// add arbitrary links -$form_body .= "<h3>".elgg_echo('admin:add_menu_item')."</h3>"; -$form_body .= elgg_view('output/longtext', array('value' => elgg_echo("admin:add_menu_item:description"))); - -$custom_items = get_config('menu_items_custom_items'); - -$name_str = elgg_echo('name'); -$url_str = elgg_echo('admin:plugins:label:website'); - -$form_body .= '<ul class="custom_menuitems">'; - -if (is_array($custom_items)) { - foreach ($custom_items as $url => $name) { - $name_input = elgg_view('input/text', array( - 'internalname' => 'custom_item_names[]', - 'value' => $name - )); - - $url_input = elgg_view('input/text', array( - 'internalname' => 'custom_item_urls[]', - 'value' => $url - )); - - $form_body .= "<li class='custom_menuitem'>$name_str: $name_input $url_str: $url_input $delete</li>"; - } -} - -$new = elgg_echo('new'); -$name_input = elgg_view('input/text', array( - 'internalname' => 'custom_item_names[]', -)); - -$url_input = elgg_view('input/text', array( - 'internalname' => 'custom_item_urls[]', -)); - -$form_body .= "<li class='custom_menuitem'>$name_str: $name_input $url_str: $url_input</li> -</ul>"; - -$form_body .= elgg_view('input/submit', array('value' => elgg_echo('save'))); - -echo elgg_view('input/form', array( - 'body' => $form_body, - 'action' => "action/admin/menu_items" -)); -echo "</div>";
\ No newline at end of file +echo elgg_view_form('admin/menu/save', array('class' => 'elgg-form-settings')); diff --git a/views/default/admin/appearance/profile_fields.php b/views/default/admin/appearance/profile_fields.php new file mode 100644 index 000000000..f1d78c19f --- /dev/null +++ b/views/default/admin/appearance/profile_fields.php @@ -0,0 +1,24 @@ +<?php +/** + * Admin area: edit default profile fields + */ + +$add = elgg_view_form('profile/fields/add', array('class' => 'elgg-form-settings'), array()); +$list = elgg_view('admin/appearance/profile_fields/list'); + +$reset = elgg_view('output/confirmlink', array( + 'text' => elgg_echo('reset'), + 'href' => 'action/profile/fields/reset', + 'title' => elgg_echo('profile:resetdefault'), + 'confirm' => elgg_echo('profile:resetdefault:confirm'), + 'class' => 'elgg-button elgg-button-cancel', + 'is_trusted' => 'true', +)); + +$body = <<<__HTML +$add +$list +<div class="mtl">$reset</div> +__HTML; + +echo $body; diff --git a/views/default/admin/appearance/profile_fields/list.php b/views/default/admin/appearance/profile_fields/list.php new file mode 100644 index 000000000..b9440a95d --- /dev/null +++ b/views/default/admin/appearance/profile_fields/list.php @@ -0,0 +1,55 @@ +<?php +/** + * Profile fields. + * + * @todo Needs some review + */ + +// List form elements +$n = 0; +$loaded_defaults = array(); +$items = array(); +$fieldlist = elgg_get_config('profile_custom_fields'); +if ($fieldlist) { + $fieldlistarray = explode(',', $fieldlist); + foreach ($fieldlistarray as $listitem) { + $translation = elgg_get_config("admin_defined_profile_$listitem"); + $type = elgg_get_config("admin_defined_profile_type_$listitem"); + if ($translation && $type) { + $item = new stdClass; + $item->translation = $translation; + $item->shortname = $listitem; + $item->name = "admin_defined_profile_$listitem"; + $item->type = elgg_echo("profile:field:$type"); + $items[] = $item; + } + } +} +?> +<ul id="elgg-profile-fields" class="mvm"> +<?php + +$save = elgg_echo('save'); +$cancel = elgg_echo('cancel'); + +foreach ($items as $item) { + echo elgg_view("profile/", array('value' => $item->translation)); + + //$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; + $url = elgg_view('output/url', array( + 'href' => "action/profile/fields/delete?id={$item->shortname}", + 'text' => elgg_view_icon('delete-alt'), + 'is_action' => true, + 'is_trusted' => true, + )); + $type = elgg_echo($item->type); + echo <<<HTML +<li id="$item->shortname" class="clearfix"> + <span class="elgg-icon elgg-icon-drag-arrow elgg-state-draggable"></span> + <b><span id="elgg-profile-field-{$item->shortname}" class="elgg-state-editable">$item->translation</span></b> [$type] $url +</li> +HTML; +} + +?> +</ul>
\ No newline at end of file diff --git a/views/default/admin/components/plugin.php b/views/default/admin/components/plugin.php deleted file mode 100644 index ad3d0ad96..000000000 --- a/views/default/admin/components/plugin.php +++ /dev/null @@ -1,153 +0,0 @@ -<?php -/** - * Elgg plugin manifest class - * - * This file renders a plugin for the admin screen, including active/deactive, manifest details & display plugin - * settings. - * - * @package Elgg - * @subpackage Core - */ - -$plugin = $vars['plugin']; -$details = $vars['details']; - -$active = $details['active']; -$manifest = $details['manifest']; - -$plugin_pretty_name = (isset($manifest['name'])) ? $manifest['name'] : $plugin; - -// Check elgg version if available -$version_check_valid = false; -if ($manifest['elgg_version']) { - $version_check_valid = check_plugin_compatibility($manifest['elgg_version']); -} - -$ts = time(); -$token = generate_action_token($ts); -$active_class = ($active) ? 'active' : 'not_active'; - -$top_url = $up_url = $down_url = $bottom_url = ''; -if ($vars['order'] > 10) { - $top_url = elgg_get_site_url()."action/admin/plugins/reorder?plugin={$plugin}&order=1&__elgg_token=$token&__elgg_ts=$ts"; - $top_link = '<a href="' . elgg_format_url($top_url) . '">' . elgg_echo('top') . '</a>'; - - $order = $vars['order'] - 11; - - $up_url = elgg_get_site_url()."action/admin/plugins/reorder?plugin={$plugin}&order=$order&__elgg_token=$token&__elgg_ts=$ts"; - $up_link = '<a href="' . elgg_format_url($up_url) . '">' . elgg_echo('up') . '</a>'; -} - -if ($vars['order'] < $vars['maxorder']) { - $order = $vars['order'] + 11; - $down_url = elgg_get_site_url()."action/admin/plugins/reorder?plugin={$plugin}&order=$order&__elgg_token=$token&__elgg_ts=$ts"; - $down_link = '<a href="' . elgg_format_url($down_url) . '">' . elgg_echo('down') . '</a>'; - - $order = $vars['maxorder'] + 11; - $bottom_url = elgg_get_site_url()."action/admin/plugins/reorder?plugin={$plugin}&order=$order&__elgg_token=$token&__elgg_ts=$ts"; - $bottom_link = '<a href="' . elgg_format_url($bottom_url) . '">' . elgg_echo('bottom') . '</a>'; -} - -if ($active) { - $url = elgg_get_site_url()."action/admin/plugins/disable?plugin=$plugin&__elgg_token=$token&__elgg_ts=$ts"; - $enable_disable = '<a class="cancel-button" href="' . elgg_format_url($url) . '">' . elgg_echo('disable') . '</a>'; -} else { - $url = elgg_get_site_url()."action/admin/plugins/enable?plugin=$plugin&__elgg_token=$token&__elgg_ts=$ts"; - $enable_disable = '<a class="submit-button" href="' . elgg_format_url($url) . '">' . elgg_echo('enable') . '</a>'; -} - - -$categories_list = ''; -if ($manifest['category']) { - $categories_arr = array(); - $base_url = elgg_get_site_url()."pg/admin/plugins?category="; - - foreach($manifest['category'] as $category) { - $url = $base_url . urlencode($category); - $categories_arr[] = "<a href=\"$url\">" . htmlspecialchars($category) . '</a>'; - } - - $categories_list = implode(', ', $categories_arr); -} - -$screenshots = ''; -if ($manifest['screenshot']) { - $base_url = elgg_get_site_url()."mod/"; - - $limit = 4; - foreach ($manifest['screenshot'] as $screenshot) { - if ($limit <= 0) { - break; - } - - $screenshot_src = $base_url . $plugin . "/$screenshot"; - $screenshots .= "<li class=\"plugin_screenshot\"><a href=\"$screenshot_src\"><img src=\"$screenshot_src\"></a></li>"; - - $limit--; - } -} - -?> - -<div class="plugin_details <?php echo $active_class ?>"> - <div class="admin_plugin_reorder"> - <?php echo "$top_link $up_link $down_link $bottom_link"; ?> - </div><div class="clearfloat"></div> - - <div class="admin_plugin_enable_disable"><?php echo $enable_disable; ?></div> - - <?php - if (elgg_view_exists("settings/{$plugin}/edit")) { - $link = elgg_get_site_url()."pg/admin/plugin_settings/$plugin"; - $settings_link = "<a class='plugin_settings small link' href='$link'>[". elgg_echo('settings') ."]</a>"; - } - ?> - <h3><?php echo "$plugin_pretty_name $settings_link"; ?></h3> - <?php - echo $settings_panel; - - if ($manifest) { - ?> - <div class="plugin_description"><?php echo elgg_view('output/longtext',array('value' => $manifest['description'])); ?></div> - <p class="plugin_author"><span><?php echo elgg_echo('admin:plugins:label:author') . "</span>: ". htmlspecialchars($manifest['author']) ?></p> - <p class="plugin_version"><span><?php echo elgg_echo('admin:plugins:label:version') . "</span>: ". htmlspecialchars($manifest['version']) ?></p> - - <p><a class="manifest_details small link"><?php echo elgg_echo("admin:plugins:label:moreinfo"); ?></a></p> - - <div class="manifest_file hidden"> - - <?php - if ((!$version_check_valid) || (!isset($manifest['elgg_version']))) { - ?> - <div id="version_check"> - <?php - if (!isset($manifest['elgg_version'])) { - echo elgg_echo('admin:plugins:warning:elggversionunknown'); - } else { - echo elgg_echo('admin:plugins:warning:elggtoolow'); - } - ?> - </div> - <?php - } - - ?> - <div><?php echo elgg_echo('admin:plugins:label:directory') . ": ". htmlspecialchars($plugin) ?></div> - <?php - if ($categories_list) { - ?> - <div><?php echo elgg_echo('admin:plugins:label:categories') . ": ". $categories_list ?></div> - <?php - } - if ($screenshots) { - ?> - <div><ul><?php echo $screenshots; ?></ul></div> - <?php - } - ?> - <div><?php echo elgg_echo('admin:plugins:label:copyright') . ": ". htmlspecialchars($manifest['copyright']) ?></div> - <div><?php echo elgg_echo('admin:plugins:label:licence') . ": ". htmlspecialchars($manifest['licence'] . $manifest['license']) ?></div> - <div><?php echo elgg_echo('admin:plugins:label:website') . ": "; ?><a href="<?php echo $manifest['website']; ?>"><?php echo $manifest['website']; ?></a></div> - <?php } ?> - </div> -</div>
\ No newline at end of file diff --git a/views/default/admin/components/plugin_settings.php b/views/default/admin/components/plugin_settings.php deleted file mode 100644 index 4e32b0e14..000000000 --- a/views/default/admin/components/plugin_settings.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Elgg plugin settings - * - * @package Elgg - * @subpackage Core - */ - -$plugin = $vars['plugin']; -$plugin_info = load_plugin_manifest($plugin); - -$form_body = elgg_view("settings/{$plugin}/edit", $vars); -$form_body .= elgg_view('input/hidden', array('internalname' => 'plugin', 'value' => $plugin)); -$form_body .= "<div class='divider'></div>" . elgg_view('input/submit', array('value' => elgg_echo('save'))); -$form_body .= elgg_view('input/reset', array('value' => elgg_echo('reset'), 'class' => 'action-button disabled')); - -echo elgg_view_title($plugin_info['name']); - -echo elgg_view('input/form', array('body' => $form_body, 'internalid' => 'plugin_settings', 'action' => "action/plugins/settings/save"));
\ No newline at end of file diff --git a/views/default/admin/dashboard.php b/views/default/admin/dashboard.php new file mode 100644 index 000000000..d3976ca38 --- /dev/null +++ b/views/default/admin/dashboard.php @@ -0,0 +1,12 @@ +<?php + +elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); + +$params = array( + 'num_columns' => 2, + 'exact_match' => true, + 'show_access' => false, +); +$widgets = elgg_view_layout('widgets', $params); + +echo $widgets;
\ No newline at end of file diff --git a/views/default/admin/footer.php b/views/default/admin/footer.php new file mode 100644 index 000000000..ce420e99a --- /dev/null +++ b/views/default/admin/footer.php @@ -0,0 +1,9 @@ +<?php +/** + * Elgg admin footer. Extend this view to add content to the admin footer + */ + +$options = array( + 'class' => 'elgg-menu-hz' +); +echo elgg_view_menu('admin_footer', $options);
\ No newline at end of file diff --git a/views/default/admin/header.php b/views/default/admin/header.php new file mode 100644 index 000000000..331190a88 --- /dev/null +++ b/views/default/admin/header.php @@ -0,0 +1,27 @@ +<?php +/** + * Elgg admin header + */ +$admin_title = elgg_get_site_entity()->name . ' ' . elgg_echo('admin'); + +$view_site = elgg_view('output/url', array( + 'href' => elgg_get_site_url(), + 'text' => elgg_echo('admin:view_site'), + 'is_trusted' => true, +)); +$logout = elgg_view('output/url', array( + 'href' => 'action/logout', + 'text' => elgg_echo('logout'), + 'is_trusted' => true, +)); +?> +<h1 class="elgg-heading-site"> + <a href="<?php echo elgg_get_site_url(); ?>admin"> + <?php echo $admin_title; ?> + </a> +</h1> +<ul class="elgg-menu-user"> + <li><?php echo elgg_echo('admin:loggedin', array(elgg_get_logged_in_user_entity()->name)); ?></li> + <li><?php echo $view_site; ?></li> + <li><?php echo $logout; ?></li> +</ul>
\ No newline at end of file diff --git a/views/default/admin/overview.php b/views/default/admin/overview.php deleted file mode 100644 index 1785864e7..000000000 --- a/views/default/admin/overview.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php -/** - * Elgg statistics screen - * - * @package Elgg - * @subpackage Core - */ - -// Work out number of users -$users_stats = get_number_users(); -$total_users = get_number_users(true); - -global $CONFIG; - -// Get version information -$version = get_version(); -$release = get_version(true); - -echo elgg_view_title(elgg_echo('admin:overview')); -?> -<div class="admin_settings site_stats"> - <?php echo elgg_view('overview/extend'); ?> - <h3><?php echo elgg_echo('admin:statistics:label:basic'); ?></h3> - <table class="styled"> - <tr class="odd"> - <td class="column-one"><b><?php echo elgg_echo('admin:statistics:label:version'); ?> :</b></td> - <td><?php echo elgg_echo('admin:statistics:label:version:release'); ?> - <?php echo $release; ?>, <?php echo elgg_echo('admin:statistics:label:version:version'); ?> - <?php echo $version; ?></td> - </tr> - <tr class="even"> - <td class="column-one"><b><?php echo elgg_echo('admin:statistics:label:numusers'); ?> :</b></td> - <td><?php echo $users_stats; ?> <?php echo elgg_echo('active'); ?> / <?php echo $total_users; ?> <?php echo elgg_echo('total') ?></td> - </tr> - - </table> -</div> - -<?php - - -// Get entity statistics -$entity_stats = get_entity_statistics(); -$even_odd = ""; -?> -<div class="admin_settings site_entities"> - <h3><?php echo elgg_echo('admin:statistics:label:numentities'); ?></h3> - <table class="styled"> - <?php - foreach ($entity_stats as $k => $entry) { - arsort($entry); - foreach ($entry as $a => $b) { - - //This function controls the alternating class - $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; - - if ($a == "__base__") { - $a = elgg_echo("item:{$k}"); - if (empty($a)) - $a = $k; - } else { - if (empty($a)) { - $a = elgg_echo("item:{$k}"); - } else { - $a = elgg_echo("item:{$k}:{$a}"); - } - - if (empty($a)) { - $a = "$k $a"; - } - } - echo <<< END - <tr class="{$even_odd}"> - <td class="column-one">{$a}:</td> - <td>{$b}</td> - </tr> -END; - } - } - ?> - </table> -</div>
\ No newline at end of file diff --git a/views/default/admin/overview/numentities.php b/views/default/admin/overview/numentities.php deleted file mode 100644 index 6ecd388dd..000000000 --- a/views/default/admin/overview/numentities.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php -/** - * Elgg statistics screen - * - * @package Elgg - * @subpackage Core - */ diff --git a/views/default/admin/overview/online.php b/views/default/admin/overview/online.php deleted file mode 100644 index f8b890c91..000000000 --- a/views/default/admin/overview/online.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Elgg statistics screen - * - * @package Elgg - * @subpackage Core - */ - -// users online -if( (is_plugin_enabled('search')) && (is_plugin_enabled('profile')) ) { - elgg_push_context('search'); - $users_online = get_online_users(); - elgg_pop_context(); - ?> - - <div class="admin_settings members-list users_online"> - <h3><?php echo elgg_echo('admin:statistics:label:onlineusers'); ?></h3> - <?php echo $users_online; ?> - </div> -<?php -} -?>
\ No newline at end of file diff --git a/views/default/admin/plugin_settings.php b/views/default/admin/plugin_settings.php new file mode 100644 index 000000000..1c6e9e206 --- /dev/null +++ b/views/default/admin/plugin_settings.php @@ -0,0 +1,26 @@ +<?php +/** + * Elgg plugin settings + * + * @uses ElggPlugin $vars['plugin'] The plugin object to display settings for. + * + * @package Elgg.Core + * @subpackage Plugins.Settings + */ + +$plugin = $vars['plugin']; +$plugin_id = $plugin->getID(); + +// required for plugin settings backward compatibility +$vars['entity'] = $plugin; + +$settings = false; + +if (elgg_view_exists("settings/$plugin_id/edit") || elgg_view_exists("plugins/$plugin_id/settings")) { + $title = $plugin->getManifest()->getName(); + + $params = array('id' => "$plugin_id-settings", 'class' => 'elgg-form-settings'); + $body = elgg_view_form("plugins/settings/save", $params, $vars); + + echo elgg_view_module('info', $title, $body); +}
\ No newline at end of file diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php new file mode 100644 index 000000000..42f153d0f --- /dev/null +++ b/views/default/admin/plugins.php @@ -0,0 +1,197 @@ +<?php +/** + * Elgg administration plugin screen + * + * Shows a list of plugins that can be sorted and filtered. + * + * @package Elgg.Core + * @subpackage Admin.Plugins + */ + +elgg_load_js('lightbox'); +elgg_load_css('lightbox'); + +elgg_generate_plugin_entities(); +$installed_plugins = elgg_get_plugins('any'); +$show_category = get_input('category', 'all'); +$sort = get_input('sort', 'priority'); + +// Get a list of the all categories +// and trim down the plugin list if we're not viewing all categories. +// @todo this could be cached somewhere after have the manifest loaded +$categories = array(); + +foreach ($installed_plugins as $id => $plugin) { + if (!$plugin->isValid()) { + if ($plugin->isActive()) { + // force disable and warn + elgg_add_admin_notice('invalid_and_deactivated_' . $plugin->getID(), + elgg_echo('ElggPlugin:InvalidAndDeactivated', array($plugin->getId()))); + $plugin->deactivate(); + } + continue; + } + + $plugin_categories = $plugin->getManifest()->getCategories(); + + // handle plugins that don't declare categories + // unset them here because this is the list we foreach + switch ($show_category) { + case 'all': + break; + case 'active': + if (!$plugin->isActive()) { + unset($installed_plugins[$id]); + } + break; + case 'inactive': + if ($plugin->isActive()) { + unset($installed_plugins[$id]); + } + break; + case 'nonbundled': + if (in_array('bundled', $plugin_categories)) { + unset($installed_plugins[$id]); + } + break; + default: + if (!in_array($show_category, $plugin_categories)) { + unset($installed_plugins[$id]); + } + break; + } + + if (isset($plugin_categories)) { + foreach ($plugin_categories as $category) { + if (!array_key_exists($category, $categories)) { + $categories[$category] = ElggPluginManifest::getFriendlyCategory($category); + } + } + } +} + +$guids = array(); +foreach ($installed_plugins as $plugin) { + $guids[] = $plugin->getGUID(); +} + +// sort plugins +switch ($sort) { + case 'date': + $plugin_list = array(); + foreach ($installed_plugins as $plugin) { + $create_date = $plugin->getTimeCreated(); + while (isset($plugin_list[$create_date])) { + $create_date++; + } + $plugin_list[$create_date] = $plugin; + } + krsort($plugin_list); + break; + case 'alpha': + $plugin_list = array(); + foreach ($installed_plugins as $plugin) { + $plugin_list[$plugin->getFriendlyName()] = $plugin; + } + ksort($plugin_list); + break; + case 'priority': + default: + $plugin_list = $installed_plugins; + break; +} + + + +asort($categories); + +// we want bundled/nonbundled pulled to be at the top of the list +unset($categories['bundled']); +unset($categories['nonbundled']); + +$common_categories = array( + 'all' => elgg_echo('admin:plugins:category:all'), + 'active' => elgg_echo('admin:plugins:category:active'), + 'inactive' => elgg_echo('admin:plugins:category:inactive'), + 'bundled' => elgg_echo('admin:plugins:category:bundled'), + 'nonbundled' => elgg_echo('admin:plugins:category:nonbundled'), +); + +$categories = array_merge($common_categories, $categories); +// security - only want a defined option +if (!array_key_exists($show_category, $categories)) { + $show_category = reset($categories); +} + +$category_form = elgg_view_form('admin/plugins/filter', array( + 'action' => 'admin/plugins', + 'method' => 'get', + 'disable_security' => true, +), array( + 'category' => $show_category, + 'category_options' => $categories, + 'sort' => $sort, +)); + + +$sort_options = array( + 'priority' => elgg_echo('admin:plugins:sort:priority'), + 'alpha' => elgg_echo('admin:plugins:sort:alpha'), + 'date' => elgg_echo('admin:plugins:sort:date'), +); +// security - only want a defined option +if (!array_key_exists($sort, $sort_options)) { + $sort = reset($sort_options); +} + +$sort_form = elgg_view_form('admin/plugins/sort', array( + 'action' => 'admin/plugins', + 'method' => 'get', + 'disable_security' => true, +), array( + 'sort' => $sort, + 'sort_options' => $sort_options, + 'category' => $show_category, +)); + +$buttons = "<div class=\"clearfix mbm\">"; +$buttons .= elgg_view_form('admin/plugins/change_state', array( + 'action' => 'action/admin/plugins/activate_all', + 'class' => 'float', +), array( + 'guids' => $guids, + 'action' => 'activate', +)); +$buttons .= elgg_view_form('admin/plugins/change_state', array( + 'action' => 'action/admin/plugins/deactivate_all', + 'class' => 'float', +), array( + 'guids' => $guids, + 'action' => 'deactivate', +)); +$buttons .= "</div>"; + +$buttons .= $category_form . $sort_form; + +// construct page header +?> +<div id="content_header" class="mbm clearfix"> + <div class="content-header-options"><?php echo $buttons ?></div> +</div> + +<div id="elgg-plugin-list"> +<?php + +$options = array( + 'limit' => 0, + 'full_view' => true, + 'list_type_toggle' => false, + 'pagination' => false, +); +if ($show_category == 'all' && $sort == 'priority') { + $options['display_reordering'] = true; +} +echo elgg_view_entity_list($plugin_list, $options); + +?> +</div>
\ No newline at end of file diff --git a/views/default/admin/plugins/advanced.php b/views/default/admin/plugins/advanced.php deleted file mode 100644 index 195df5169..000000000 --- a/views/default/admin/plugins/advanced.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php -/** - * Elgg administration advanced plugin screen - * - * Shows a list of all plugins sorted by load order. - * - * @package Elgg - * @subpackage Core - */ - -regenerate_plugin_list(); -$installed_plugins = get_installed_plugins(); -$plugin_list = array(); -$show_category = get_input('category', NULL); - -// Get a list of the all categories -// and trim down the plugin list if we're not viewing all categories. -// @todo this could be cached somewhere after have the manifest loaded -$categories = array(); - -foreach ($installed_plugins as $id => $plugin) { - $plugin_categories = $plugin['manifest']['category']; - - // handle plugins that don't declare categories - if ((!$plugin_categories && $show_category) || ($show_category && !in_array($show_category, $plugin_categories))) { - unset($installed_plugins[$id]); - } - - foreach ($plugin_categories as $category) { - if (!array_key_exists($category, $categories)) { - $categories[$category] = elgg_echo("admin:plugins:label:moreinfo:categories:$category"); - } - } -} - -$ts = time(); -$token = generate_action_token($ts); -$categories = array_merge(array('' => elgg_echo('admin:plugins:categories:all')), $categories); - -$category_pulldown = elgg_view('input/pulldown', array( - 'internalname' => 'category', - 'options_values' => $categories, - 'value' => $show_category -)); - -$category_button = elgg_view('input/submit', array( - 'value' => elgg_echo('filter'), - 'class' => 'action-button' -)); - -$category_form = elgg_view('input/form', array( - 'body' => $category_pulldown . $category_button -)); - -// Page Header elements -$title = elgg_view_title(elgg_echo('admin:plugins')); - -// @todo Until "en/disable all" means "All plugins on this page" hide when not looking at all. -if (!isset($show_category) || empty($show_category)) { - $buttons = "<a class='action-button' href=\"{$CONFIG->url}action/admin/plugins/enableall?__elgg_token=$token&__elgg_ts=$ts\">".elgg_echo('enableall')."</a> <a class='action-button disabled' href=\"{$CONFIG->url}action/admin/plugins/disableall?__elgg_token=$token&__elgg_ts=$ts\">".elgg_echo('disableall')."</a> "; - $buttons .= "<br /><br />"; -} else { - $buttons = ''; -} - -$buttons .= $category_form; - -// construct page header -?> -<div id="content_header" class="clearfix"> - <div class="content-header-title"><?php echo $title ?></div> - <div class="content-header-options"><?php echo $buttons ?></div> -</div> -<br /> -<?php - -$limit = get_input('limit', 10); -$offset = get_input('offset', 0); - -$plugin_list = get_plugin_list(); -$max = 0; -foreach($plugin_list as $key => $foo) { - if ($key > $max) $max = $key; -} - -// Display list of plugins -$n = 0; -foreach ($installed_plugins as $plugin => $data) { - echo elgg_view('admin/components/plugin', array( - 'plugin' => $plugin, - 'details' => $data, - 'maxorder' => $max, - 'order' => array_search($plugin, $plugin_list) - )); - $n++; -} -?> -<script type="text/javascript"> - $(document).ready(function() { - $('a.manifest_details.link').click(function() { - elgg_slide_toggle($(this), '.plugin_details', '.manifest_file'); - }); - }); -</script>
\ No newline at end of file diff --git a/views/default/admin/plugins/simple.php b/views/default/admin/plugins/simple.php deleted file mode 100644 index 89373fc7d..000000000 --- a/views/default/admin/plugins/simple.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/** - * Elgg administration simple plugin screen - * - * Shows an alphabetical list of "simple" plugins. - * - * @package Elgg - * @subpackage Core - */ - -regenerate_plugin_list(); -$installed_plugins = get_installed_plugins(); -$plugin_list = array(); -$title = elgg_view_title(elgg_echo('admin:plugins')); - -foreach ($installed_plugins as $installed_name => $plugin) { - if (!isset($plugin['manifest']['admin_interface']) || $plugin['manifest']['admin_interface'] == 'advanced') { - continue; - } - - $plugin['installed_name'] = $installed_name; - - $plugin_list[$plugin['manifest']['name']] = $plugin; -} - -ksort($plugin_list); -$form_body .= <<<___END - <div id="content_header" class="clearfix"> - <div class="content-header-title">$title</div> - </div> - <ul class="admin_plugins margin-top"> -___END; - -foreach ($plugin_list as $name => $info) { - $manifest = $info['manifest']; - $version_valid = (isset($manifest['elgg_version'])) ? check_plugin_compatibility($manifest['elgg_version']) : FALSE; - if ($info['active']) { - $active_class = 'active'; - $checked = 'checked="checked"'; - } else { - $active_class = 'not_active'; - $checked = ''; - } - - $author = $link = $version = $settings = ''; - - if (isset($manifest['author'])) { - $author = elgg_echo('admin:plugins:author', array($manifest['author'])); - } - - if (isset($manifest['version'])) { - $version = ' | ' . elgg_echo('admin:plugins:version', array($manifest['version'])); - } - - if (isset($manifest['website'])) { - $link = " | <a href=\"{$manifest['website']}\">" . elgg_echo('admin:plugins:plugin_website') . '</a>'; - } - - if (elgg_view_exists("settings/{$info['installed_name']}/edit")) { - $settings_href = elgg_get_site_url()."pg/admin/plugin_settings/{$info['installed_name']}"; - $settings = " | <a class='plugin_settings link' href='$settings_href'>". elgg_echo('settings') ."</a>"; - } - - $form_body .= <<<___END - <li class="plugin_details $active_class"> - <span class="plugin_controls"> - <input type="checkbox" id="{$info['installed_name']}" class="plugin_enabled" $checked name="enabled_plugins[]" value="{$info['installed_name']}"/> - <label for="{$info['installed_name']}">$name</label> - </span> - - <span class="plugin_info"> - <span class="plugin_description"> - {$manifest['description']} - </span> - <span class="plugin_metadata small"> - $author - $version - $link - $settings - </span> - </span> - </li> -___END; -} - -$form_body .= '</ul>'; -$form_body .= elgg_view('input/submit', array('value' => elgg_echo('save'))); -$form_body .= elgg_view('input/reset', array('value' => elgg_echo('reset'), 'class' => 'action-button disabled')); - -echo elgg_view('input/form', array( - 'action' => "action/admin/plugins/simple_update_states", - 'body' => $form_body, - 'class' => 'admin_plugins_simpleview' -));
\ No newline at end of file diff --git a/views/default/admin/settings/advanced.php b/views/default/admin/settings/advanced.php new file mode 100644 index 000000000..a262740f2 --- /dev/null +++ b/views/default/admin/settings/advanced.php @@ -0,0 +1,9 @@ +<?php +/** + * Elgg administration site advanced settings + * + * @package Elgg + * @subpackage Core + */ + +echo elgg_view_form('admin/site/update_advanced', array('class' => 'elgg-form-settings')); diff --git a/views/default/admin/settings/advanced/site_secret.php b/views/default/admin/settings/advanced/site_secret.php new file mode 100644 index 000000000..e70ac7ab6 --- /dev/null +++ b/views/default/admin/settings/advanced/site_secret.php @@ -0,0 +1,11 @@ +<?php +/** + * Elgg administration site secret settings + * + * @package Elgg + * @subpackage Core + */ + +echo elgg_view_form('admin/site/regenerate_secret', array(), array( + 'strength' => _elgg_get_site_secret_strength(), +)); diff --git a/views/default/admin/settings/basic.php b/views/default/admin/settings/basic.php new file mode 100644 index 000000000..9334ba81b --- /dev/null +++ b/views/default/admin/settings/basic.php @@ -0,0 +1,9 @@ +<?php +/** + * Elgg administration site basic settings + * + * @package Elgg + * @subpackage Core + */ + +echo elgg_view_form('admin/site/update_basic', array('class' => 'elgg-form-settings')); diff --git a/views/default/admin/sidebar.php b/views/default/admin/sidebar.php new file mode 100644 index 000000000..100ce2af8 --- /dev/null +++ b/views/default/admin/sidebar.php @@ -0,0 +1,8 @@ +<?php +/** + * Admin sidebar -- just outputs the page menus + */ + +$content = elgg_view_menu('page', array('sort_by' => 'priority', 'show_section_headers' => true)); + +echo elgg_view_module('main', '', $content, array('class' => 'elgg-admin-sidebar-menu'));
\ No newline at end of file diff --git a/views/default/admin/site/advanced.php b/views/default/admin/site/advanced.php deleted file mode 100644 index 048ffa883..000000000 --- a/views/default/admin/site/advanced.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * Elgg administration site advanced settings - * - * @package Elgg - * @subpackage Core - */ - -$action = elgg_get_site_url() . "action/admin/site/update_advanced"; - -$form_body = ""; - -foreach(array('wwwroot', 'path', 'dataroot', 'view') as $field) { - $form_body .= "<p>"; - $form_body .= elgg_echo('installation:' . $field) . "<br />"; - $warning = elgg_echo('installation:warning:' . $field); - if ($warning != 'installation:warning:' . $field) echo "<b>" . $warning . "</b><br />"; - $value = $vars['config']->$field; - $form_body .= elgg_view("input/text",array('internalname' => $field, 'value' => $value)); - $form_body .= "</p>"; -} - -$form_body .= "<p>" . elgg_echo('admin:site:access:warning') . "<br />"; -$form_body .= elgg_echo('installation:sitepermissions') . elgg_view('input/access', array('internalname' => 'default_access','value' => $vars['config']->default_access)) . "</p>"; -$form_body .= "<p>" . elgg_echo('installation:allow_user_default_access:description') . "<br />" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:allow_user_default_access:label')), 'internalname' => 'allow_user_default_access', 'value' => ($vars['config']->allow_user_default_access ? elgg_echo('installation:allow_user_default_access:label') : "") )) . "</p>"; -$form_body .= "<p>" . elgg_echo('installation:simplecache:description') . "<br />" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:simplecache:label')), 'internalname' => 'simplecache_enabled', 'value' => ($vars['config']->simplecache_enabled ? elgg_echo('installation:simplecache:label') : "") )) . "</p>"; -$form_body .= "<p>" . elgg_echo('installation:viewpathcache:description') . "<br />" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:viewpathcache:label')), 'internalname' => 'viewpath_cache_enabled', 'value' => (($vars['config']->viewpath_cache_enabled) ? elgg_echo('installation:viewpathcache:label') : "") )) . "</p>"; - -$debug_options = array('0' => elgg_echo('installation:debug:none'), 'ERROR' => elgg_echo('installation:debug:error'), 'WARNING' => elgg_echo('installation:debug:warning'), 'NOTICE' => elgg_echo('installation:debug:notice')); -$form_body .= "<p>" . elgg_echo('installation:debug'); -$form_body .= elgg_view('input/pulldown', array('options_values' => $debug_options, 'internalname' => 'debug', 'value' => $vars['config']->debug)); -$form_body .= '</p>'; - -// control new user registration -$options = array( - 'options' => array(elgg_echo('installation:registration:label')), - 'internalname' => 'allow_registration', - 'value' => $vars['config']->allow_registration ? elgg_echo('installation:registration:label') : '', -); -$form_body .= '<p>' . elgg_echo('installation:registration:description'); -$form_body .= '<br />' .elgg_view('input/checkboxes', $options) . '</p>'; - -// control walled garden -$options = array( - 'options' => array(elgg_echo('installation:walled_garden:label')), - 'internalname' => 'walled_garden', - 'value' => $vars['config']->walled_garden ? elgg_echo('installation:walled_garden:label') : '', -); -$form_body .= '<p>' . elgg_echo('installation:walled_garden:description'); -$form_body .= '<br />' . elgg_view('input/checkboxes', $options) . '</p>'; - -$form_body .= "<p>" . elgg_echo('installation:httpslogin') . "<br />" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:httpslogin:label')), 'internalname' => 'https_login', 'value' => ($vars['config']->https_login ? elgg_echo('installation:httpslogin:label') : "") )) . "</p>"; - -$form_body .= "<p>" . elgg_echo('installation:disableapi') . "<br />"; -$on = elgg_echo('installation:disableapi:label'); -if ((isset($CONFIG->disable_api)) && ($CONFIG->disable_api == true)) { - $on = ($vars['config']->disable_api ? "" : elgg_echo('installation:disableapi:label')); -} -$form_body .= elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:disableapi:label')), 'internalname' => 'api', 'value' => $on )); -$form_body .= "</p>"; - -$form_body .= elgg_view('input/hidden', array('internalname' => 'settings', 'value' => 'go')); - -$form_body .= "<div class='divider'></div>".elgg_view('input/submit', array('value' => elgg_echo("save"))); -$form_body = "<div class='admin_settings site_admin margin-top'>".$form_body."</div>"; -echo elgg_view_title(elgg_echo('admin:site:advanced') . " " . elgg_echo('admin:site')); -echo elgg_view('input/form', array('action' => $action, 'body' => $form_body)); diff --git a/views/default/admin/site/basic.php b/views/default/admin/site/basic.php deleted file mode 100644 index 9b8f4652d..000000000 --- a/views/default/admin/site/basic.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php -/** - * Elgg administration site basic settings - * - * @package Elgg - * @subpackage Core - */ - -$action = elgg_get_site_url() . "action/admin/site/update_basic"; - -$form_body = ""; - -foreach(array('sitename','sitedescription', 'siteemail') as $field) { - $form_body .= "<p>"; - $form_body .= elgg_echo('installation:' . $field) . "<br />"; - $warning = elgg_echo('installation:warning:' . $field); - if ($warning != 'installation:warning:' . $field) echo "<b>" . $warning . "</b><br />"; - $value = $vars['config']->$field; - $form_body .= elgg_view("input/text",array('internalname' => $field, 'value' => $value)); - $form_body .= "</p>"; -} - -$languages = get_installed_translations(); -$form_body .= "<p>" . elgg_echo('installation:language') . elgg_view("input/pulldown", array('internalname' => 'language', 'value' => $vars['config']->language, 'options_values' => $languages)) . "</p>"; - -$form_body .= "<div class='divider'></div>".elgg_view('input/submit', array('value' => elgg_echo("save"))); -$form_body = "<div class='admin_settings site_admin margin-top'>".$form_body."</div>"; -echo elgg_view_title(elgg_echo('admin:site')); -echo elgg_view('input/form', array('action' => $action, 'body' => $form_body)); diff --git a/views/default/admin/statistics/overview.php b/views/default/admin/statistics/overview.php new file mode 100644 index 000000000..ac5aaac36 --- /dev/null +++ b/views/default/admin/statistics/overview.php @@ -0,0 +1,13 @@ +<?php +/** + * Elgg statistics screen + * + * @package Elgg + * @subpackage Core + */ + +echo elgg_view('admin/statistics/extend'); + +echo elgg_view_module('inline', elgg_echo('admin:statistics:label:basic'), elgg_view('admin/statistics/overview/basic')); + +echo elgg_view_module('inline', elgg_echo('admin:statistics:label:numentities'), elgg_view('admin/statistics/overview/numentities')); diff --git a/views/default/admin/statistics/overview/basic.php b/views/default/admin/statistics/overview/basic.php new file mode 100644 index 000000000..2c9b3b88e --- /dev/null +++ b/views/default/admin/statistics/overview/basic.php @@ -0,0 +1,19 @@ +<?php +// Work out number of users +$users_stats = get_number_users(); +$total_users = get_number_users(true); + +// Get version information +$version = get_version(); +$release = get_version(true); +?> +<table class="elgg-table-alt"> + <tr class="odd"> + <td><b><?php echo elgg_echo('admin:statistics:label:version'); ?> :</b></td> + <td><?php echo elgg_echo('admin:statistics:label:version:release'); ?> - <?php echo $release; ?>, <?php echo elgg_echo('admin:statistics:label:version:version'); ?> - <?php echo $version; ?></td> + </tr> + <tr class="even"> + <td><b><?php echo elgg_echo('admin:statistics:label:numusers'); ?> :</b></td> + <td><?php echo $users_stats; ?> <?php echo elgg_echo('active'); ?> / <?php echo $total_users; ?> <?php echo elgg_echo('total') ?></td> + </tr> +</table>
\ No newline at end of file diff --git a/views/default/admin/statistics/overview/numentities.php b/views/default/admin/statistics/overview/numentities.php new file mode 100644 index 000000000..af4ae2773 --- /dev/null +++ b/views/default/admin/statistics/overview/numentities.php @@ -0,0 +1,40 @@ +<?php +// Get entity statistics +$entity_stats = get_entity_statistics(); +$even_odd = ""; +?> +<table class="elgg-table-alt"> +<?php +foreach ($entity_stats as $k => $entry) { + arsort($entry); + foreach ($entry as $a => $b) { + + //This function controls the alternating class + $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; + + if ($a == "__base__") { + $a = elgg_echo("item:{$k}"); + if (empty($a)) + $a = $k; + } else { + if (empty($a)) { + $a = elgg_echo("item:{$k}"); + } else { + $a = elgg_echo("item:{$k}:{$a}"); + } + + if (empty($a)) { + $a = "$k $a"; + } + } + + echo <<< END + <tr class="{$even_odd}"> + <td>{$a}:</td> + <td>{$b}</td> + </tr> +END; + } + } +?> +</table> diff --git a/views/default/admin/statistics/server.php b/views/default/admin/statistics/server.php new file mode 100644 index 000000000..9d21addc1 --- /dev/null +++ b/views/default/admin/statistics/server.php @@ -0,0 +1,8 @@ +<?php +/** + * Server information + */ + +echo elgg_view_module('inline', elgg_echo('admin:server:label:web_server'), elgg_view('admin/statistics/server/web_server')); + +echo elgg_view_module('inline', elgg_echo('admin:server:label:php'), elgg_view('admin/statistics/server/php')); diff --git a/views/default/admin/statistics/server/php.php b/views/default/admin/statistics/server/php.php new file mode 100644 index 000000000..7c6a51383 --- /dev/null +++ b/views/default/admin/statistics/server/php.php @@ -0,0 +1,50 @@ +<?php +/** + * Server PHP info + */ + +$php_log = ini_get('error_log'); +if (!$php_log) { + $php_log = elgg_echo('admin:server:error_log'); +} + +$post_max_size = elgg_get_ini_setting_in_bytes('post_max_size'); +$upload_max_filesize = elgg_get_ini_setting_in_bytes('upload_max_filesize'); + +$post_max_size_warning = ''; +if ($upload_max_filesize > $post_max_size) { + // @todo show a link to something like http://nigel.mcnie.name/blog/uploadmaxfilesizepostmaxsize-experimentation ? + $post_max_size_warning = elgg_echo('admin:server:warning:post_max_too_small'); +} + +?> +<table class="elgg-table-alt"> + <tr class="odd"> + <td><b><?php echo elgg_echo('admin:server:label:php_version'); ?> :</b></td> + <td><?php echo phpversion(); ?></td> + </tr> + <tr class="even"> + <td><b><?php echo elgg_echo('admin:server:label:php_ini'); ?> :</b></td> + <td><?php echo php_ini_loaded_file(); ?></td> + </tr> + <tr class="odd"> + <td><b><?php echo elgg_echo('admin:server:label:php_log'); ?> :</b></td> + <td><?php echo $php_log; ?></td> + </tr> + <tr class="even"> + <td><b><?php echo elgg_echo('admin:server:label:mem_avail'); ?> :</b></td> + <td><?php echo number_format(elgg_get_ini_setting_in_bytes('memory_limit')); ?></td> + </tr> + <tr class="odd"> + <td><b><?php echo elgg_echo('admin:server:label:mem_used'); ?> :</b></td> + <td><?php echo number_format(memory_get_peak_usage()); ?></td> + </tr> + <tr class="even"> + <td><b><?php echo elgg_echo('admin:server:label:post_max_size'); ?> :</b></td> + <td><?php echo number_format($post_max_size); ?></td> + </tr> + <tr class="odd"> + <td><b><?php echo elgg_echo('admin:server:label:upload_max_filesize'); ?> :</b></td> + <td><?php echo number_format($upload_max_filesize) . ' ' . $post_max_size_warning; ?></td> + </tr> +</table> diff --git a/views/default/admin/statistics/server/web_server.php b/views/default/admin/statistics/server/web_server.php new file mode 100644 index 000000000..904a54f4b --- /dev/null +++ b/views/default/admin/statistics/server/web_server.php @@ -0,0 +1,16 @@ +<?php +/** + * Web server info + */ + +?> +<table class="elgg-table-alt"> + <tr class="odd"> + <td><b><?php echo elgg_echo('admin:server:label:server'); ?> :</b></td> + <td><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td> + </tr> + <tr class="even"> + <td><b><?php echo elgg_echo('admin:server:label:log_location'); ?> :</b></td> + <td><?php echo getenv('APACHE_LOG_DIR'); ?></td> + </tr> +</table> diff --git a/views/default/admin/users/add.php b/views/default/admin/users/add.php index cc2da61db..6d22b9c29 100644 --- a/views/default/admin/users/add.php +++ b/views/default/admin/users/add.php @@ -3,5 +3,7 @@ * Display an add user form. */ -echo elgg_view_title(elgg_echo('admin:users')); -echo elgg_view('account/forms/useradd', array('show_admin'=>true));
\ No newline at end of file +$title = elgg_echo('adduser'); +$body = elgg_view_form('useradd', array(), array('show_admin' => true)); + +echo elgg_view_module('inline', $title, $body);
\ No newline at end of file diff --git a/views/default/admin/users/admins.php b/views/default/admin/users/admins.php new file mode 100644 index 000000000..9b175d437 --- /dev/null +++ b/views/default/admin/users/admins.php @@ -0,0 +1,12 @@ +<?php +$admins = elgg_list_entities(array(), 'elgg_get_admins'); + +?> +<div class="elgg-module elgg-module-inline"> + <div class="elgg-head"> + <h3><?php echo elgg_echo('admin:statistics:label:admins'); ?></h3> + </div> + <div class="elgg-body"> + <?php echo $admins; ?> + </div> +</div> diff --git a/views/default/admin/users/newest.php b/views/default/admin/users/newest.php index 4d5b85836..91a6fa338 100644 --- a/views/default/admin/users/newest.php +++ b/views/default/admin/users/newest.php @@ -1,17 +1,18 @@ <?php // newest users -if (is_plugin_enabled('profile')) { - $users = elgg_list_entities(array( - 'type' => 'user', 'subtype'=>null, - 'full_view' => FALSE - )); +$users = elgg_list_entities(array( + 'type' => 'user', + 'subtype'=> null, + 'full_view' => FALSE +)); - echo elgg_view_title(elgg_echo('admin:users')); - ?> +?> - <div class="admin_settings members-list users_online"> +<div class="elgg-module elgg-module-inline"> + <div class="elgg-head"> <h3><?php echo elgg_echo('admin:users:newest'); ?></h3> + </div> + <div class="elgg-body"> <?php echo $users; ?> </div> -<?php -}
\ No newline at end of file +</div> diff --git a/views/default/admin/users/online.php b/views/default/admin/users/online.php index 9c0f52c7f..dbda06066 100644 --- a/views/default/admin/users/online.php +++ b/views/default/admin/users/online.php @@ -1,16 +1,13 @@ <?php -// users online -if ((is_plugin_enabled('search')) && (is_plugin_enabled('profile'))) { - elgg_push_context('search'); - $users_online = get_online_users(); - elgg_pop_context(); - - echo elgg_view_title(elgg_echo('admin:users')); - ?> - <div class="admin_settings members-list users_online"> +$users_online = get_online_users(); + +?> +<div class="elgg-module elgg-module-inline"> + <div class="elgg-head"> <h3><?php echo elgg_echo('admin:statistics:label:onlineusers'); ?></h3> + </div> + <div class="elgg-body"> <?php echo $users_online; ?> </div> -<?php -}
\ No newline at end of file +</div> diff --git a/views/default/ajax/loader.php b/views/default/ajax/loader.php deleted file mode 100644 index b1f35971a..000000000 --- a/views/default/ajax/loader.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Elgg AJAX loader - * - * @package Elgg - * @subpackage Core - */ - -$loader = <<< END - -<div align="center" class="ajax-loader hidden"></div> - -END; - -$loader = str_replace("\n","",$loader); -$loader = str_replace("\r","",$loader); - -if (isset($vars['slashes']) && $vars['slashes'] == true) { - $loader = addslashes($loader); -} - -echo $loader;
\ No newline at end of file diff --git a/views/default/annotation/annotate.php b/views/default/annotation/annotate.php deleted file mode 100644 index de2513587..000000000 --- a/views/default/annotation/annotate.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -$performed_by = get_entity($vars['item']->subject_guid); -$object = get_entity($vars['item']->object_guid); -$url = $object->getURL(); -$title = $object->title; -if (!$title) { - $title = elgg_echo('file:untitled'); -} - -$subtype = get_subtype_from_id($object->subtype); -//grab the annotation, if one exists -$comment = ''; -if ($vars['item']->annotation_id != 0) { - $comment = get_annotation($vars['item']->annotation_id)->value; -} - -$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; -$string = elgg_echo("river:posted:generic", array($url)) . " "; -$string .= elgg_echo("{$subtype}:river:annotate") . " <a href=\"{$object->getURL()}\">" . $title . "</a> <span class='entity-subtext'>" . elgg_view_friendly_time($object->time_created) . "<a class='river_comment_form_button link'>Comment</a>"; -$string .= elgg_view('likes/forms/link', array('entity' => $object)); -$string .= "</span>"; -if (elgg_get_context() != 'riverdashboard') { - $comment = elgg_get_excerpt($comment, 200); - if ($comment) { - $string .= "<div class='river_content_display'>"; - $string .= $comment; - $string .= "</div>"; - } -} -echo $string;
\ No newline at end of file diff --git a/views/default/annotation/annotatelike.php b/views/default/annotation/annotatelike.php deleted file mode 100644 index 7b0d5c2e2..000000000 --- a/views/default/annotation/annotatelike.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -$performed_by = get_entity($vars['item']->subject_guid); -$object = get_entity($vars['item']->object_guid); -$url = $object->getURL(); -$title = $object->title; - -$string = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a> "; -$string .= elgg_echo("likes:river:annotate") . " <a href=\"{$object->getURL()}\">" . $title . "</a> <span class='entity-subtext'>" . elgg_view_friendly_time($object->time_created)."</span>"; - -echo $string;
\ No newline at end of file diff --git a/views/default/annotation/default.php b/views/default/annotation/default.php index 13713e8ad..5d29a53e2 100644 --- a/views/default/annotation/default.php +++ b/views/default/annotation/default.php @@ -1,11 +1,40 @@ <?php /** * Elgg default annotation view + * + * @note To add or remove from the annotation menu, register handlers for the menu:annotation hook. + * + * @uses $vars['annotation'] */ -$owner = get_user($vars['annotation']->owner_guid); -$icon = elgg_view("profile/icon", array('entity' => $owner, 'size' => 'tiny')); +$annotation = $vars['annotation']; -$info = elgg_view("output/longtext", array("value" => $vars['annotation']->value)); +$owner = get_entity($annotation->owner_guid); +if (!$owner) { + return true; +} +$icon = elgg_view_entity_icon($owner, 'tiny'); +$owner_link = "<a href=\"{$owner->getURL()}\">$owner->name</a>"; -echo elgg_view_listing($icon, $info); +$menu = elgg_view_menu('annotation', array( + 'annotation' => $annotation, + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz float-alt', +)); + +$text = elgg_view("output/longtext", array("value" => $annotation->value)); + +$friendlytime = elgg_view_friendly_time($annotation->time_created); + +$body = <<<HTML +<div class="mbn"> + $menu + $owner_link + <span class="elgg-subtext"> + $friendlytime + </span> + $text +</div> +HTML; + +echo elgg_view_image_block($icon, $body); diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php index 63633d3b5..22a8d9211 100644 --- a/views/default/annotation/generic_comment.php +++ b/views/default/annotation/generic_comment.php @@ -3,14 +3,14 @@ * Elgg generic comment view * * @uses $vars['annotation'] ElggAnnotation object - * @uses $vars['full'] Display fill view or brief view + * @uses $vars['full_view'] Display fill view or brief view */ if (!isset($vars['annotation'])) { return true; } -$full_view = elgg_get_array_value('full', $vars, true); +$full_view = elgg_extract('full_view', $vars, true); $comment = $vars['annotation']; @@ -22,51 +22,48 @@ if (!$entity || !$commenter) { $friendlytime = elgg_view_friendly_time($comment->time_created); -$commenter_icon = elgg_view("profile/icon", array('entity' => $commenter, 'size' => 'tiny')); +$commenter_icon = elgg_view_entity_icon($commenter, 'tiny'); $commenter_link = "<a href=\"{$commenter->getURL()}\">$commenter->name</a>"; $entity_title = $entity->title ? $entity->title : elgg_echo('untitled'); $entity_link = "<a href=\"{$entity->getURL()}\">$entity_title</a>"; if ($full_view) { - - $delete_button = ''; - if ($comment->canEdit()) { - $delete_button = elgg_view("output/confirmlink",array( - 'href' => "action/comments/delete?annotation_id={$comment->id}", - 'text' => elgg_echo('delete'), - 'confirm' => elgg_echo('deleteconfirm') - )); - $delete_button = "<span class=\"delete-button\">$delete_button</span>"; - } + $menu = elgg_view_menu('annotation', array( + 'annotation' => $comment, + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz float-alt', + )); $comment_text = elgg_view("output/longtext", array("value" => $comment->value)); $body = <<<HTML -<p class="mbn"> - $delete_button +<div class="mbn"> + $menu $commenter_link - <span class="entity-subtext"> + <span class="elgg-subtext"> $friendlytime </span> $comment_text -</p> +</div> HTML; - echo elgg_view_media($commenter_icon, $body, array('id' => "comment-$comment->id")); + echo elgg_view_image_block($commenter_icon, $body); } else { // brief view //@todo need link to actual comment! - - $on = elgg_echo('on'); + + $commented_on = elgg_echo('generic_comment:on', array($commenter_link, $entity_link)); + + $excerpt = elgg_get_excerpt($comment->value, 80); $body = <<<HTML -<span class="entity-subtext"> - $commenter_link $on <span class='entity-title'>$entity_link</span> ($friendlytime) +<span class="elgg-subtext"> + $commented_on ($friendlytime): $excerpt </span> HTML; - echo elgg_view_media($commenter_icon, $body); + echo elgg_view_image_block($commenter_icon, $body); } diff --git a/views/default/annotation/likes.php b/views/default/annotation/likes.php deleted file mode 100644 index 3fdf2349b..000000000 --- a/views/default/annotation/likes.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * Elgg show the user who liked the object - */ - -$owner = get_user($vars['annotation']->owner_guid); - -?> -<div class="elgg-likes-user clearfix"> - <div class="entity-listing-icon"> - <?php - echo elgg_view("profile/icon", array( - 'entity' => $owner, - 'size' => 'tiny' - )); - ?> - </div> - - <div class="entity-listing-info"> - <?php - // if the user looking at the like listing can edit, show the delete link - if ($vars['annotation']->canEdit()) { - ?> - <div class="entity-metadata"><span class="delete-button"> - <?php echo elgg_view("output/confirmlink",array( - 'href' => "action/likes/delete?annotation_id=" . $vars['annotation']->id, - 'text' => elgg_echo('remove'), - 'confirm' => elgg_echo('deleteconfirm') - )); - ?> - </span></div> - <?php - } //end of can edit if statement - ?> - <p class="elgg-likes-owner"> - <a href="<?php echo $owner->getURL(); ?>"><?php echo $owner->name; ?></a> <?php echo elgg_echo('likes:this') . - " <span class=\"entity-subtext\">" . elgg_view_friendly_time($vars['annotation']->time_created) . "</span>"; ?> - </p> - </div> -</div>
\ No newline at end of file diff --git a/views/default/annotation/list.php b/views/default/annotation/list.php deleted file mode 100644 index f432ad640..000000000 --- a/views/default/annotation/list.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Annotation list - * - * @uses $vars['annotations'] - * @uses $vars['limit'] - * @uses $vars['offset'] - * @uses $vars['count'] - * @uses $vars['pagination'] - */ - -$offset = $vars['offset']; -$limit = $vars['limit']; -$count = $vars['count']; -$annotations = $vars['annotations']; -$pagination = elgg_get_array_value('pagination', $vars, true); - -$html = ""; -$nav = ""; - -if ($pagination) { - $nav .= elgg_view('navigation/pagination', array( - 'baseurl' => $_SERVER['REQUEST_URI'], - 'offset' => $offset, - 'count' => $count, - 'limit' => $limit, - 'word' => 'annoff', - 'nonefound' => false, - )); -} - -if (is_array($annotations) && count($annotations) > 0) { - $html .= '<ul class="elgg-annotation-list elgg-list">'; - foreach ($annotations as $annotation) { - $html .= '<li>'; - $html .= elgg_view_annotation($annotation, true); - $html .= '</li>'; - } - $html .= '</ul>'; -} - -if ($count) { - $html .= $nav; -} - -echo $html; diff --git a/views/default/comments/latest.php b/views/default/comments/latest.php deleted file mode 100644 index c38b1f5c4..000000000 --- a/views/default/comments/latest.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -/** - * Latest comments on an entity - * - * @uses $vars['comments'] Array of comment objects - */ - -if (isset($vars['comments'])) { - echo '<ul class="elgg-latest-comments elgg-list">'; - foreach ($vars['comments'] as $comment) { - $html = elgg_view_annotation($comment, false); - if ($html) { - echo "<li>$html</li>"; - } - } - echo '</ul>'; -}
\ No newline at end of file diff --git a/views/default/comments/list.php b/views/default/comments/list.php deleted file mode 100644 index 6dbe51483..000000000 --- a/views/default/comments/list.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php -/** - * List comments with optional add form - * - * @uses $vars['entity'] ElggEntity - * @uses $vars['show_add_form'] Display add form or not - */ - -$show_add_form = elgg_get_array_value('show_add_form', $vars, true); - -echo '<div class="elgg-comments">'; - -echo list_annotations($vars['entity']->getGUID(), 'generic_comment'); - -if ($show_add_form) { - $form_vars = array('name' => 'elgg_add_comment'); - echo elgg_view_form('comments/add', $form_vars, $vars); -} - -echo '</div>'; diff --git a/views/default/core/account/login_box.php b/views/default/core/account/login_box.php new file mode 100644 index 000000000..f39113653 --- /dev/null +++ b/views/default/core/account/login_box.php @@ -0,0 +1,21 @@ +<?php +/** + * Elgg login box + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['module'] The module name. Default: aside + */ + +$module = elgg_extract('module', $vars, 'aside'); + +$login_url = elgg_get_site_url(); +if (elgg_get_config('https_login')) { + $login_url = str_replace("http:", "https:", $login_url); +} + +$title = elgg_echo('login'); +$body = elgg_view_form('login', array('action' => "{$login_url}action/login")); + +echo elgg_view_module($module, $title, $body); diff --git a/views/default/core/account/login_dropdown.php b/views/default/core/account/login_dropdown.php new file mode 100644 index 000000000..e90cbf106 --- /dev/null +++ b/views/default/core/account/login_dropdown.php @@ -0,0 +1,27 @@ +<?php +/** + * Elgg drop-down login form + */ + +if (elgg_is_logged_in()) { + return true; +} + +$login_url = elgg_get_site_url(); +if (elgg_get_config('https_login')) { + $login_url = str_replace("http:", "https:", elgg_get_site_url()); +} + +$body = elgg_view_form('login', array('action' => "{$login_url}action/login"), array('returntoreferer' => TRUE)); +?> +<div id="login-dropdown"> + <?php + echo elgg_view('output/url', array( + 'href' => 'login#login-dropdown-box', + 'rel' => 'popup', + 'class' => 'elgg-button elgg-button-dropdown', + 'text' => elgg_echo('login'), + )); + echo elgg_view_module('dropdown', '', $body, array('id' => 'login-dropdown-box')); + ?> +</div> diff --git a/views/default/core/avatar/crop.php b/views/default/core/avatar/crop.php new file mode 100644 index 000000000..1c59842c8 --- /dev/null +++ b/views/default/core/avatar/crop.php @@ -0,0 +1,16 @@ +<?php +/** + * Avatar cropping view + * + * @uses vars['entity'] + */ + +?> +<div id="avatar-croppingtool" class="mtl ptm"> + <label><?php echo elgg_echo('avatar:crop:title'); ?></label> + <br /> + <p> + <?php echo elgg_echo("avatar:create:instructions"); ?> + </p> + <?php echo elgg_view_form('avatar/crop', array(), $vars); ?> +</div> diff --git a/views/default/core/avatar/upload.php b/views/default/core/avatar/upload.php new file mode 100644 index 000000000..6f9124192 --- /dev/null +++ b/views/default/core/avatar/upload.php @@ -0,0 +1,51 @@ +<?php +/** + * Avatar upload view + * + * @uses $vars['entity'] + */ + +$user_avatar = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('medium'), + 'alt' => elgg_echo('avatar'), +)); + +$current_label = elgg_echo('avatar:current'); + +$remove_button = ''; +if ($vars['entity']->icontime) { + $remove_button = elgg_view('output/url', array( + 'text' => elgg_echo('remove'), + 'title' => elgg_echo('avatar:remove'), + 'href' => 'action/avatar/remove?guid=' . elgg_get_page_owner_guid(), + 'is_action' => true, + 'class' => 'elgg-button elgg-button-cancel mll', + )); +} + +$form_params = array('enctype' => 'multipart/form-data'); +$upload_form = elgg_view_form('avatar/upload', $form_params, $vars); + +?> + +<p class="mtm"> + <?php echo elgg_echo('avatar:upload:instructions'); ?> +</p> + +<?php + +$image = <<<HTML +<div id="current-user-avatar" class="mrl prl"> + <label>$current_label</label><br /> + $user_avatar +</div> +$remove_button +HTML; + +$body = <<<HTML +<div id="avatar-upload"> + $upload_form +</div> +HTML; + +echo elgg_view_image_block($image, $upload_form); diff --git a/views/default/core/friends/collection.php b/views/default/core/friends/collection.php new file mode 100644 index 000000000..1a330af01 --- /dev/null +++ b/views/default/core/friends/collection.php @@ -0,0 +1,64 @@ +<?php +/** + * View a friends collection + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['collection'] The individual friends collection + */ + +$coll = $vars['collection']; + +if (is_array($vars['collection']->members)) { + $count = sizeof($vars['collection']->members); +} else { + $count = 0; +} + +echo "<li><h2>"; + +//as collections are private, check that the logged in user is the owner +if ($coll->owner_guid == elgg_get_logged_in_user_guid()) { + echo "<div class=\"friends_collections_controls\">"; + echo elgg_view('output/confirmlink', array( + 'href' => 'action/friends/collections/delete?collection=' . $coll->id, + 'class' => 'delete_collection', + 'text' => elgg_view_icon('delete'), + 'encode_text' => false, + )); + echo "</div>"; +} +echo $coll->name; +echo " (<span id=\"friends_membership_count{$vars['friendspicker']}\">{$count}</span>) </h2>"; + +// individual collection panels +$friends = $vars['collection']->entities; +if ($friends) { + $content = elgg_view('core/friends/collectiontabs', array( + 'owner' => elgg_get_logged_in_user_entity(), + 'collection' => $vars['collection'], + 'friendspicker' => $vars['friendspicker'], + )); + + echo elgg_view('input/friendspicker', array( + 'entities' => $friends, + 'value' => $vars['collection']->members, + 'content' => $content, + 'replacement' => '', + 'friendspicker' => $vars['friendspicker'], + )); +?> +<?php //@todo JS 1.8: no ?> + <script type="text/javascript"> + $(function () { + + $('#friends-picker_placeholder<?php echo $vars['friendspicker']; ?>').load(elgg.config.wwwroot + 'pages/friends/collections/pickercallback.php?username=<?php echo elgg_get_logged_in_user_entity()->username; ?>&type=list&collection=<?php echo $vars['collection']->id; ?>'); + + }); + </script> + <?php +} + +// close friends-picker div and the accordian list item +echo "</li>"; diff --git a/views/default/friends/collections.php b/views/default/core/friends/collections.php index d0669bb46..c6ee082c8 100644 --- a/views/default/friends/collections.php +++ b/views/default/core/friends/collections.php @@ -9,17 +9,16 @@ * @uses $vars['collections'] The array of friends collections */ -if (!isset($friendspicker)) { - $friendspicker = 0; -} - - if (is_array($vars['collections']) && sizeof($vars['collections'])) { echo "<ul id=\"friends_collections_accordian\">"; - foreach($vars['collections'] as $collection) { + $friendspicker = 0; + foreach ($vars['collections'] as $collection) { $friendspicker++; - echo elgg_view('friends/collection',array('collection' => $collection, 'friendspicker' => $friendspicker)); + echo elgg_view('core/friends/collection', array( + 'collection' => $collection, + 'friendspicker' => $friendspicker, + )); } echo "</ul>"; @@ -29,11 +28,11 @@ if (is_array($vars['collections']) && sizeof($vars['collections'])) { } ?> - +<?php //@todo JS 1.8: no ?> <script> -$(document).ready(function(){ +$(function(){ $('#friends_collections_accordian h2').click(function () { - $(this.parentNode).children("[class=friends-picker]").slideToggle("fast"); + $(this.parentNode).children("[class=friends-picker-main-wrapper]").slideToggle("fast"); //return false; }); }); diff --git a/views/default/core/friends/collectiontabs.php b/views/default/core/friends/collectiontabs.php new file mode 100644 index 000000000..bf12e0edb --- /dev/null +++ b/views/default/core/friends/collectiontabs.php @@ -0,0 +1,62 @@ +<?php +/** + * Elgg friends collections + * Lists a user's friends collections + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['collections'] The array of friends collections + */ + +$friendspicker = $vars['friendspicker']; + +$collectionid = $vars['collection']->id; +$ownerid = $vars['owner']->getGUID(); + +?> + +<ul class="elgg-tabs"> + <li class="elgg-state-selected"> + <a href="#" class="collectionmembers<?php echo $friendspicker; ?>"> + <?php echo elgg_echo('friends:collections:members'); ?> + </a> + </li> + <li> + <a href="#" class="editmembers<?php echo $friendspicker; ?>"> + <?php echo elgg_echo('friends:collections:edit'); ?> + </a> + </li> +</ul> + +<?php //@todo JS 1.8: no ?> +<script type="text/javascript"> +$(function () { + + $('a.collectionmembers<?php echo $friendspicker; ?>').click(function () { + // load collection members pane + $('#friends-picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo elgg_get_site_url(); ?>pages/friends/collections/pickercallback.php?username=<?php echo elgg_get_logged_in_user_entity()->username; ?>&type=list&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>'); + + // remove selected state from previous tab + $(this).parent().parent().find("li.elgg-state-selected").removeClass("elgg-state-selected"); + // add selected class to current tab + $(this).parent().addClass("elgg-state-selected"); + + return false; + }); + + $('a.editmembers<?php echo $friendspicker; ?>').click(function () { + // load friends picker pane + $('#friends-picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo elgg_get_site_url(); ?>pages/friends/collections/pickercallback.php?username=<?php echo elgg_get_logged_in_user_entity()->username; ?>&type=picker&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>'); + + // remove selected state from previous tab + $(this).parent().parent().find("li.elgg-state-selected").removeClass("elgg-state-selected"); + // add selected class to current tab + $(this).parent().addClass("elgg-state-selected"); + + return false; + }); + + +}); +</script> diff --git a/views/default/friends/tablelist.php b/views/default/core/friends/tablelist.php index 12a0763c9..339b9ab1b 100644 --- a/views/default/friends/tablelist.php +++ b/views/default/core/friends/tablelist.php @@ -13,7 +13,7 @@ if (is_array($vars['entities'])) { ?> -<table cellspacing="0" id="collectionMembersTable"> +<table cellspacing="0" id="friendspicker-members-table"> <tr> <?php $column = 0; @@ -25,11 +25,11 @@ if (is_array($vars['entities'])) { if ($entity instanceof ElggEntity) { ?> <td style="width:25px;"> - <div style="width: 25px; margin-bottom: 15px;"> - <?php echo elgg_view("profile/icon",array('entity' => $entity, 'size' => 'tiny')); ?> + <div style="width: 25px;" class="mbl"> + <?php echo elgg_view_entity_icon($entity, 'tiny'); ?> </div> </td> - <td style="width: 200px; padding: 5px;"> + <td style="width: 200px;" class="pas"> <?php echo $entity->name; ?> </td> <?php diff --git a/views/default/friends/tablelistcountupdate.php b/views/default/core/friends/tablelistcountupdate.php index 8e2ab637d..7a0da1caa 100644 --- a/views/default/friends/tablelistcountupdate.php +++ b/views/default/core/friends/tablelistcountupdate.php @@ -11,7 +11,7 @@ */ ?> - +<?php //@todo JS 1.8: no ?> <script language="text/javascript"> $("#friends_membership_count<?php echo $vars['friendspicker']; ?>").html("<?php echo $vars['count']; ?>"); </script>
\ No newline at end of file diff --git a/views/default/core/river/filter.php b/views/default/core/river/filter.php new file mode 100644 index 000000000..9b7fadaa8 --- /dev/null +++ b/views/default/core/river/filter.php @@ -0,0 +1,38 @@ +<?php +/** + * Content filter for river + * + * @uses $vars[] + */ + +// create selection array +$options = array(); +$options['type=all'] = elgg_echo('river:select', array(elgg_echo('all'))); +$registered_entities = elgg_get_config('registered_entities'); + +if (!empty($registered_entities)) { + foreach ($registered_entities as $type => $subtypes) { + // subtype will always be an array. + if (!count($subtypes)) { + $label = elgg_echo('river:select', array(elgg_echo("item:$type"))); + $options["type=$type"] = $label; + } else { + foreach ($subtypes as $subtype) { + $label = elgg_echo('river:select', array(elgg_echo("item:$type:$subtype"))); + $options["type=$type&subtype=$subtype"] = $label; + } + } + } +} + +$params = array( + 'id' => 'elgg-river-selector', + 'options_values' => $options, +); +$selector = $vars['selector']; +if ($selector) { + $params['value'] = $selector; +} +echo elgg_view('input/dropdown', $params); + +elgg_load_js('elgg.ui.river'); diff --git a/views/default/core/settings/account.php b/views/default/core/settings/account.php new file mode 100644 index 000000000..0c3792ece --- /dev/null +++ b/views/default/core/settings/account.php @@ -0,0 +1,9 @@ +<?php +/** + * Account settings form wrapper + * + * @package Elgg + * @subpackage Core + */ + +echo elgg_view_form('usersettings/save', array('class' => 'elgg-form-alt'));
\ No newline at end of file diff --git a/views/default/core/settings/account/default_access.php b/views/default/core/settings/account/default_access.php new file mode 100644 index 000000000..690f2714a --- /dev/null +++ b/views/default/core/settings/account/default_access.php @@ -0,0 +1,25 @@ +<?php +/** + * Provide a way of setting your default access + * + * @package Elgg + * @subpackage Core + */ +if (elgg_get_config('allow_user_default_access')) { + $user = elgg_get_page_owner_entity(); + + if ($user) { + if (false === ($default_access = $user->getPrivateSetting('elgg_default_access'))) { + $default_access = elgg_get_config('default_access'); + } + + $title = elgg_echo('default_access:settings'); + $content = elgg_echo('default_access:label') . ': '; + $content .= elgg_view('input/access', array( + 'name' => 'default_access', + 'value' => $default_access, + )); + + echo elgg_view_module('info', $title, $content); + } +} diff --git a/views/default/core/settings/account/email.php b/views/default/core/settings/account/email.php new file mode 100644 index 000000000..4bcdbb100 --- /dev/null +++ b/views/default/core/settings/account/email.php @@ -0,0 +1,19 @@ +<?php +/** + * Provide a way of setting your email + * + * @package Elgg + * @subpackage Core + */ + +$user = elgg_get_page_owner_entity(); + +if ($user) { + $title = elgg_echo('email:settings'); + $content = elgg_echo('email:address:label') . ': '; + $content .= elgg_view('input/email', array( + 'name' => 'email', + 'value' => $user->email, + )); + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/account/language.php b/views/default/core/settings/account/language.php new file mode 100644 index 000000000..b36057422 --- /dev/null +++ b/views/default/core/settings/account/language.php @@ -0,0 +1,20 @@ +<?php +/** + * Provide a way of setting your language prefs + * + * @package Elgg + * @subpackage Core + */ + +$user = elgg_get_page_owner_entity(); + +if ($user) { + $title = elgg_echo('user:set:language'); + $content = elgg_echo('user:language:label') . ': '; + $content .= elgg_view("input/dropdown", array( + 'name' => 'language', + 'value' => $user->language, + 'options_values' => get_installed_translations() + )); + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/account/name.php b/views/default/core/settings/account/name.php new file mode 100644 index 000000000..e356146a3 --- /dev/null +++ b/views/default/core/settings/account/name.php @@ -0,0 +1,21 @@ +<?php +/** + * Provide a way of setting your full name. + * + * @package Elgg + * @subpackage Core + */ + +$user = elgg_get_page_owner_entity(); +if ($user) { + $title = elgg_echo('user:name:label'); + $content = elgg_echo('name') . ': '; + $content .= elgg_view('input/text', array( + 'name' => 'name', + 'value' => $user->name, + )); + echo elgg_view_module('info', $title, $content); + + // need the user's guid to make sure the correct user gets updated + echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $user->guid)); +} diff --git a/views/default/core/settings/account/notifications.php b/views/default/core/settings/account/notifications.php new file mode 100644 index 000000000..c212b3886 --- /dev/null +++ b/views/default/core/settings/account/notifications.php @@ -0,0 +1,44 @@ +<?php +/** + * User settings for notifications. + * + * @package Elgg + * @subpackage Core + */ + +global $NOTIFICATION_HANDLERS; +$notification_settings = get_user_notification_settings(elgg_get_page_owner_guid()); + +$title = elgg_echo('notifications:usersettings'); + +$rows = ''; + +// Loop through options +foreach ($NOTIFICATION_HANDLERS as $k => $v) { + + if ($notification_settings->$k) { + $val = "yes"; + } else { + $val = "no"; + } + + $radio = elgg_view('input/radio', array( + 'name' => "method[$k]", + 'value' => $val, + 'options' => array( + elgg_echo('option:yes') => 'yes', + elgg_echo('option:no') => 'no' + ), + )); + + $cells = '<td class="prm pbl">' . elgg_echo("notification:method:$k") . ': </td>'; + $cells .= "<td>$radio</td>"; + + $rows .= "<tr>$cells</tr>"; +} + + +$content = elgg_echo('notifications:methods'); +$content .= "<table>$rows</table>"; + +echo elgg_view_module('info', $title, $content); diff --git a/views/default/core/settings/account/password.php b/views/default/core/settings/account/password.php new file mode 100644 index 000000000..4857034b2 --- /dev/null +++ b/views/default/core/settings/account/password.php @@ -0,0 +1,33 @@ +<?php + +/** + * Provide a way of setting your password + * + * @package Elgg + * @subpackage Core + */ +$user = elgg_get_page_owner_entity(); + +if ($user) { + $title = elgg_echo('user:set:password'); + + // only make the admin user enter current password for changing his own password. + $admin = ''; + if (!elgg_is_admin_logged_in() || elgg_is_admin_logged_in() && $user->guid == elgg_get_logged_in_user_guid()) { + $admin .= elgg_echo('user:current_password:label') . ': '; + $admin .= elgg_view('input/password', array('name' => 'current_password')); + $admin = "<p>$admin</p>"; + } + + $password = elgg_echo('user:password:label') . ': '; + $password .= elgg_view('input/password', array('name' => 'password')); + $password = "<p>$password</p>"; + + $password2 = elgg_echo('user:password2:label') . ': '; + $password2 .= elgg_view('input/password', array('name' => 'password2')); + $password2 = "<p>$password2</p>"; + + $content = $admin . $password . $password2; + + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/statistics.php b/views/default/core/settings/statistics.php new file mode 100644 index 000000000..1d7a5b052 --- /dev/null +++ b/views/default/core/settings/statistics.php @@ -0,0 +1,6 @@ +<?php +/** + * User statitsics + * + * Blank view that can be extended + */ diff --git a/views/default/core/settings/statistics/numentities.php b/views/default/core/settings/statistics/numentities.php new file mode 100644 index 000000000..3782fd8bc --- /dev/null +++ b/views/default/core/settings/statistics/numentities.php @@ -0,0 +1,44 @@ +<?php +/** + * Elgg statistics screen + * + * @package Elgg + * @subpackage Core + */ + +// Get entity statistics +$entity_stats = get_entity_statistics(elgg_get_page_owner_guid()); + +if ($entity_stats) { + $rows = ''; + foreach ($entity_stats as $k => $entry) { + foreach ($entry as $a => $b) { + + // This function controls the alternating class + $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; + + if ($a == "__base__") { + $a = elgg_echo("item:{$k}"); + if (empty($a)) { + $a = $k; + } + } else { + $a = elgg_echo("item:{$k}:{$a}"); + if (empty($a)) { + $a = "$k $a"; + } + } + $rows .= <<< END + <tr class="{$even_odd}"> + <td class="column-one"><b>{$a}:</b></td> + <td>{$b}</td> + </tr> +END; + } + } + + $title = elgg_echo('usersettings:statistics:label:numentities'); + $content = "<table class=\"elgg-table-alt\">$rows</table>"; + + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/statistics/online.php b/views/default/core/settings/statistics/online.php new file mode 100644 index 000000000..1385ff60f --- /dev/null +++ b/views/default/core/settings/statistics/online.php @@ -0,0 +1,42 @@ +<?php +/** + * Statistics about this user. + * + * @package Elgg + * @subpackage Core + */ + +$user = elgg_get_page_owner_entity(); + +$label_name = elgg_echo('usersettings:statistics:label:name'); +$label_email = elgg_echo('usersettings:statistics:label:email'); +$label_member_since = elgg_echo('usersettings:statistics:label:membersince'); +$label_last_login = elgg_echo('usersettings:statistics:label:lastlogin'); + +$time_created = date("r", $user->time_created); +$last_login = date("r", $user->last_login); + +$title = elgg_echo('usersettings:statistics:yourdetails'); + +$content = <<<__HTML +<table class="elgg-table-alt"> + <tr class="odd"> + <td class="column-one">$label_name</td> + <td>$user->name</td> + </tr> + <tr class="even"> + <td class="column-one">$label_email</td> + <td>$user->email</td> + </tr> + <tr class="odd"> + <td class="column-one">$label_member_since</td> + <td>$time_created</td> + </tr> + <tr class="even"> + <td class="column-one">$label_last_login</td> + <td>$last_login</td> + </tr> +</table> +__HTML; + +echo elgg_view_module('info', $title, $content); diff --git a/views/default/core/settings/tools.php b/views/default/core/settings/tools.php new file mode 100644 index 000000000..195db1d61 --- /dev/null +++ b/views/default/core/settings/tools.php @@ -0,0 +1,34 @@ +<?php +/** + * Elgg plugin specific user settings. + * + * @uses array $vars['installed_plugins'] An array of plugins as returned by elgg_get_plugins() + * + * @package Elgg.Core + * @subpackage Plugins.Settings + */ + +// Description of what's going on +echo elgg_view('output/longtext', array( + 'value' => elgg_echo("usersettings:plugins:description"), + 'class' => 'user-settings mtn mbm', +)); + +// Get the installed plugins +$installed_plugins = $vars['installed_plugins']; +$count = count($installed_plugins); + + +// Display all plugins' usersettings forms +foreach ($installed_plugins as $plugin) { + $plugin_id = $plugin->getID(); + if ($plugin->isActive()) { + if (elgg_view_exists("usersettings/$plugin_id/edit") + || elgg_view_exists("plugins/$plugin_id/usersettings")) { + + $title = $plugin->getManifest()->getName(); + $body = elgg_view_form('plugins/usersettings/save', array(), array('entity' => $plugin)); + echo elgg_view_module('info', $title, $body); + } + } +}
\ No newline at end of file diff --git a/views/default/core/walled_garden/login.php b/views/default/core/walled_garden/login.php new file mode 100644 index 000000000..42b79607d --- /dev/null +++ b/views/default/core/walled_garden/login.php @@ -0,0 +1,31 @@ +<?php +/** + * Walled garden login + */ + +$title = elgg_get_site_entity()->name; +$welcome = elgg_echo('walled_garden:welcome'); +$welcome .= ': <br/>' . $title; + +$menu = elgg_view_menu('walled_garden', array( + 'sort_by' => 'priority', + 'class' => 'elgg-menu-general elgg-menu-hz', +)); + +$login_box = elgg_view('core/account/login_box', array('module' => 'walledgarden-login')); + +echo <<<HTML +<div class="elgg-col elgg-col-1of2"> + <div class="elgg-inner"> + <h1 class="elgg-heading-walledgarden"> + $welcome + </h1> + $menu + </div> +</div> +<div class="elgg-col elgg-col-1of2"> + <div class="elgg-inner"> + $login_box + </div> +</div> +HTML; diff --git a/views/default/core/walled_garden/lost_password.php b/views/default/core/walled_garden/lost_password.php new file mode 100644 index 000000000..82f8caf50 --- /dev/null +++ b/views/default/core/walled_garden/lost_password.php @@ -0,0 +1,13 @@ +<?php +/** + * Walled garden lost password + */ + +$title = elgg_echo('user:password:lost'); +$body = elgg_view_form('user/requestnewpassword'); +echo <<<HTML +<div class="elgg-inner"> + <h3>$title</h3> + $body +</div> +HTML; diff --git a/views/default/core/walled_garden/register.php b/views/default/core/walled_garden/register.php new file mode 100644 index 000000000..1ce2f8716 --- /dev/null +++ b/views/default/core/walled_garden/register.php @@ -0,0 +1,17 @@ +<?php +/** + * Walled garden registration + */ + +$title = elgg_echo('register'); +$body = elgg_view_form('register', array(), array( + 'friend_guid' => (int) get_input('friend_guid', 0), + 'invitecode' => get_input('invitecode'), +)); + +echo <<<__HTML +<div class="elgg-inner"> + <h2>$title</h2> + $body +</div> +__HTML; diff --git a/views/default/css.php b/views/default/css.php index f02549c3d..e67c79c36 100644 --- a/views/default/css.php +++ b/views/default/css.php @@ -2,6 +2,6 @@ /** * * This is a deprecated CSS view used in Elgg 1.0-1.7. - * Please use the view 'css/screen' now. + * Please use the view 'css/elgg' now. * */ diff --git a/views/default/css/admin.php b/views/default/css/admin.php index 155907acb..c435621b2 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -2,9 +2,13 @@ /** * Elgg Admin CSS * + * This is a distinct theme from the theme of the site. There are dependencies + * on the HTML created by the views in Elgg core. + * * @package Elgg.Core * @subpackage UI */ + ?> /* *************************************** @@ -21,37 +25,35 @@ table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; - outline: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; } -img { - border-width:0; - border-color:transparent; +<?php // force vertical scroll bar ?> +html, body { + height: 100%; + margin-bottom: 1px; } -:focus { - outline:0 none; - -moz-outline-style: none; +img { + border-width: 0; + border-color: transparent; } ol, ul { - /* list-style:none outside none; */ - margin: 0 0 10px 0; - padding-left: 20px; + list-style: none; } em, i { - font-style:italic; + font-style: italic; } ins { - text-decoration:none; + text-decoration: none; } del { text-decoration:line-through; } -strong { - font-weight:bold; +strong, b { + font-weight: bold; } table { border-collapse: collapse; @@ -70,45 +72,19 @@ blockquote, q { quotes: "" ""; } - - - /* *************************************** BASICS *************************************** */ body { - text-align:left; - margin:0 auto; - padding:0; - background-color: #444444; + background-color: #eee; font-size: 80%; line-height: 1.4em; font-family: "Lucida Grande",Arial,Tahoma,Verdana,sans-serif; } -a { - color:#0054A7; - text-decoration: none; - -moz-outline-style: none; - outline: none; -} -a:hover, -a.selected { - color: black; - text-decoration: underline; -} -p { - margin-bottom:15px; -} -p:last-child { - margin-bottom:0; -} -small { - font-size: 90%; -} h1, h2, h3, h4, h5, h6 { font-weight: bold; line-height: auto; - color:#0054A7; + color: #666; } h1 { font-size: 1.8em; } h2 { font-size: 1.5em; line-height: 1.1em; } @@ -116,719 +92,1586 @@ h3 { font-size: 1.2em; } h4 { font-size: 1.0em; } h5 { font-size: 0.9em; } h6 { font-size: 0.8em; } -dt { - font-weight: bold; + +a { + color: #333; + text-decoration: none; } -dd { - margin: 0 0 1em 1em; +a:hover { + color: black; + text-decoration: underline; } pre, code { - font-family:Monaco,"Courier New",Courier,monospace; - font-size:12px; - background:#EBF5FF; - overflow:auto; - - overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */ - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ -} -code { - padding:2px 3px; -} -pre { - padding:3px 15px; - margin:0px 0 15px 0; - line-height:1.3em; + background-color: #EEE; + border: 1px solid #DDD; + color: #444; + font-family: Monaco, "Courier New", Courier, monospace; + font-size: 13px; + overflow: auto; + margin: 15px 0; + padding: 5px; } blockquote { - padding:3px 15px; - margin:0px 0 15px 0; - line-height:1.3em; - background:#EBF5FF; - border:none; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; + background: #EBF5FF; +} +p { + margin-bottom: 15px; } - -/* *************************************** - GENERIC SELECTORS -*************************************** */ -h2 { - border-bottom:1px solid #CCCCCC; - padding-bottom:5px; +.clearfloat { + clear: both; } -.clearfix:after { + +/* Clearfix! */ +.clearfix:after, +.elgg-grid:after, +.elgg-layout:after, +.elgg-inner:after, +.elgg-page-header:after, +.elgg-page-footer:after, +.elgg-head:after, +.elgg-foot:after, +.elgg-col:after, +.elgg-image-block:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.link { - cursor:pointer; + +.elgg-body { + width: auto; + word-wrap: break-word; + overflow: hidden; } -.small { - font-size: 90%; +.elgg-body:after { + display: block; + visibility: hidden; + height: 0 !important; + line-height: 0; + overflow: hidden; + font-size: xx-large; + content: " x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x "; } -.divider { - border-top:1px solid #cccccc; + +/* *************************************** + PAGE WRAPPER +*************************************** */ +.elgg-page > .elgg-inner { + margin: 0 auto; + padding: 20px 40px 0; + min-width: 800px; + max-width: 1600px; } -.hidden { - display:none; + +/* *************************************** + HEADER +*************************************** */ +.elgg-page-header { + background-color: #111; + border: 1px solid #999; + padding: 20px 20px; } -.radius8 { - -webkit-border-radius: 8px; - -moz-border-radius: 8px; +.elgg-heading-site { + font-size: 1.8em; + float: left; } -.margin-none { - margin:0; +.elgg-heading-site a { + color: #ffffff; + text-decoration: none; +} +.elgg-heading-site a:hover { + color: white; + text-decoration: none; } -.margin-top { - margin-top:10px; +.elgg-menu-user { + float: right; + margin-top: 5px; } -.entity-title a { color:#0054A7; } -.elgg-horizontal-tabbed-nav a:hover { color:#0054A7; } -table.mceLayout { - width:100% !important; +.elgg-menu-user, .elgg-menu-user a { + color: #999999; +} +.elgg-menu-user a { + text-decoration: underline; +} +.elgg-menu-user a:hover { + color: white; +} +.elgg-menu-user li { + display: inline; +} +.elgg-menu-user li:after { + content: "|"; + display: inline-block; + font-weight: normal; + margin-left: 8px; + margin-right: 4px; +} +.elgg-menu-user li:last-child:after { + content: ""; } +/* *************************************** + MESSAGES +*************************************** */ +.elgg-page-messages { + padding: 20px 0 0; + width: 500px; + margin-bottom: -10px; +} +.elgg-system-messages p { + margin: 0; +} +.elgg-message { + padding: 10px; + margin-bottom: 10px; + border: 2px solid #ddd; + cursor: pointer; +} +.elgg-message.elgg-state-error { + background: #fbe3e4; + color: #8a1f11; + border-color: #fbc2c4; + font-weight: bold; +} +.elgg-message.elgg-state-success { + background: #e6efc2; + color: #264409; + border-color: #c6d880; +} +.elgg-admin-notices { + padding-bottom: 15px; +} +.elgg-admin-notices p { + background-color: #BDE5F8; + color: black; + border: 1px solid blue; + font-weight: bold; + padding: 3px 0px 3px 10px; + -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); + -moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.elgg-admin-notices a.elgg-admin-notice { + float: right; + text-decoration: none; +} +.elgg-admin-notices a { + text-decoration: underline; +} - -#admin_header { - background-color:#333333; - border-bottom:1px solid #555555; +/* *************************************** + BODY +*************************************** */ +.elgg-page-body { + padding: 20px 0; } -#admin_footer { - background:#333333; - border-top:1px solid #222222; - clear:both; - height:30px; - width:100%; +.elgg-main { + background-color: #fff; + border: 1px solid #ccc; + padding: 20px; + position: relative; + min-height: 400px; } -#admin_header .network-title h2 { - height:45px; - line-height:45px; - margin:0; - padding:0 0 0 20px; - border:0; +.elgg-sidebar { + width: 210px; + float: right; + margin-left: 30px; } -#admin_header .network-title h2 a { - color:white; +.elgg-main > .elgg-head { + margin-bottom: 10px; } -#admin_header .network-title h2 a:hover { - color:white; - text-decoration: underline; +.elgg-main h2 { + color: #333333; } -#admin_header .network-title h2 a.return_to_network { - font-size:12px; - font-weight: normal; - color:#666666; - float:right; - margin-right:40px; -} -#elgg-content.admin_area { - margin:20px; - min-height:400px; - position:relative; - width:auto; - background-image: none; - background-color: transparent; - -webkit-box-shadow: none; - -moz-box-shadow: none; -} -#elgg-content.admin_area #elgg-page-contents { - float:left; - margin:0; - padding:14px; - width:75%; - background-color: white; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; + +/* *************************************** + FOOTER +*************************************** */ +.elgg-page-footer { + background-color: #111; + border: 1px solid #999; + padding: 10px 20px; + margin-bottom: 10px; +} +.elgg-page-footer a { + color: #ddd; + font-weight: bold; + text-decoration: none; } -#elgg-content.admin_area #elgg-sidebar { - float:left; - margin:0; - min-height:400px; - padding:0 0 0 3%; - position:relative; - width:17%; +.elgg-page-footer a:hover { + text-decoration: underline; } -.admin_area h1, -.admin_area h2, -.admin_area h3, -.admin_area h4, -.admin_area h5, -.admin_area h6 { - color:#666666; +/* *************************************** + MODULES +*************************************** */ +.elgg-module { + overflow: hidden; } -.admin_area #elgg-sidebar .submenu { - margin:0; - padding:0; - list-style: none; - background-color: transparent; - background-image: none; - -webkit-box-shadow: none; - -moz-box-shadow: none; - -webkit-border-radius: 0; - -moz-border-radius: 0; -} -.admin_area .submenu li.selected a, -.admin_area .submenu li.selected li.selected a, -.admin_area .submenu li.selected li.selected li.selected a { - background-color: black; - color:white; -} -.admin_area .submenu li a { - display:block; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - background-color:white; - margin:0 0 3px 0; - padding:2px 4px 2px 8px; - color:#333333; -} -.admin_area .submenu li a:hover { - background-color:black; - color:white; - text-decoration:none; -} -.admin_area #elgg-sidebar .submenu ul.child { - margin-bottom:10px; -} -.admin_area .submenu .child li a { - margin-left:15px; - background-color:#dedede; - color:#333333; -} -.admin_area .submenu .child li a:hover { - background-color:black; - color:white; -} - -.admin_settings h3 { - background:#999999; - color:white; - padding:5px; - margin-top:10px; - margin-bottom:10px; +.elgg-module-main { + background-color: #fff; + border: 1px solid #ccc; + padding: 10px; +} +.elgg-module-main > .elgg-head { + margin-bottom: 5px; +} +.elgg-module-info > .elgg-head { + margin-bottom: 10px; +} +.elgg-module-inline { + margin: 20px 0; +} +.elgg-module-inline > .elgg-head { + background-color: #999; + color: white; + padding: 5px; + margin-bottom: 10px; + -webkit-border-radius: 3px; -moz-border-radius: 3px; + border-radius: 3px; } -.admin_settings label { - color:#333333; - font-size:100%; - font-weight:normal; +.elgg-module-inline > .elgg-head h3 { + color: white; } -.admin_area .input-textarea { - width:98%; + +/* *************************************** + TABLE +*************************************** */ +.elgg-table { + width: 100%; + border-top: 1px solid #ccc; } -.admin_area form#plugin_settings { - margin-top: 10px; +.elgg-table td, .elgg-table th { + background: white; + border: 1px solid #ccc; + padding: 4px 8px; + vertical-align: middle; +} +.elgg-table th { + background-color: #ddd; } -.admin_area form#plugin_settings .action-button.disabled { - margin-top:10px; - float:right; +.elgg-table .alt td { + background: #eee; +} +.elgg-table input[type=checkbox] { + margin-top: 3px; } +.elgg-table-alt { + width: 100%; + border-top: 1px solid #ccc; +} +.elgg-table-alt th { + background-color: #eee; + font-weight: bold; +} +.elgg-table-alt td, th { + padding: 2px 4px; + border-bottom: 1px solid #ccc; +} +.elgg-table-alt td:first-child { + width: 200px; +} +.elgg-table-alt tr:hover { + background: #E4E4E4; +} /* *************************************** - GENERAL FORM ELEMENTS + LISTS AND IMAGE BLOCK *************************************** */ -/* default elgg core input field classes */ -.admin_area .input-text, -.admin_area .input-tags, -.admin_area .input-url, -.admin_area .input-textarea { - width:98%; +.elgg-image-block { + padding: 3px 0; } -.admin_area .input-access { - margin:5px 0 0 0; +.elgg-image-block .elgg-image { + float: left; + margin-right: 5px; } -.admin_area .input-password { - width:200px; +.elgg-image-block .elgg-image-alt { + float: right; + margin-left: 5px; } -.admin_area .input-textarea { - height: 200px; - width:718px; +.elgg-item { + margin: 3px; } -.admin_area input[type="checkbox"], -.admin_area input.input-radio { - margin:0 3px 0 0; - padding:0; - border:none; +.elgg-list-simple li { + margin-bottom: 5px; +} +.elgg-list-distinct { + border-top: 1px dotted #CCCCCC; + margin: 5px 0; + clear: both; +} +.elgg-list-distinct > li { + border-bottom: 1px dotted #CCCCCC; } -.admin_area label { + +/* *************************************** + FORMS AND INPUT +*************************************** */ +label { font-weight: bold; - color:#333333; + color: #333333; font-size: 110%; } -.admin_area input { - font: 120% Arial, Helvetica, sans-serif; - padding: 5px; - border: 1px solid #cccccc; - color:#666666; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; +fieldset > div { + margin-bottom: 15px; +} +fieldset > div:last-child { + margin-bottom: 0; } -.admin_area textarea { +input { font: 120% Arial, Helvetica, sans-serif; - border: solid 1px #cccccc; padding: 5px; - color:#666666; + border: 1px solid #ccc; + color: #666; + -webkit-border-radius: 5px; -moz-border-radius: 5px; + border-radius: 5px; + margin: 0; } -.admin_area textarea:focus, -.admin_area input[type="text"]:focus { - border: solid 1px #666666; - background: #f5f5f5; - color:#333333; + +/* default elgg core input field classes */ +.elgg-input-text, +.elgg-input-tags, +.elgg-input-url, +.elgg-input-plaintext, +.elgg-input-longtext { + width: 98%; } -.admin_area .input-textarea.monospace { - font-family:Monaco,"Courier New",Courier,monospace; - font-size:13px; +textarea { + height: 100px; } -.admin_area a.longtext-control { - float:right; - margin-left:14px; +.elgg-input-thin { + width: 400px; +} +.elgg-input-natural { + width: auto; } -.admin_area .submit-button { + +.elgg-button { font-size: 14px; font-weight: bold; - color: white; - text-shadow:1px 1px 0px black; - text-decoration:none; - border: 1px solid #0054A7; - background-color:#0054A7; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png); - background-repeat: repeat-x; - background-position: left 10px; + text-decoration: none; + -webkit-border-radius: 5px; -moz-border-radius: 5px; + border-radius: 5px; + width: auto; padding: 2px 4px; - margin:0 10px 10px 0; cursor: pointer; - -webkit-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.40); - -moz-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.40); } -.admin_area .submit-button:hover { +a.elgg-button { + padding: 3px 6px; +} + +.elgg-button + .elgg-button { + margin-left: 5px; +} + +.elgg-button-submit, +.elgg-button-action { color: white; - border-color: #333333; - text-decoration:none; - background-color:#333333; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png); - background-repeat: repeat-x; - background-position: left 10px; -} -.admin_area input[type="password"]:focus { - border: solid 1px #666666; - background-color: #f5f5f5; - color:#333333; + border: 1px solid #333; + background-color: #333; + text-shadow: 1px 1px 0px black; } -.admin_area input[type="submit"] { - font-size: 14px; - font-weight: bold; +.elgg-button-submit:hover, +.elgg-button-action:hover { color: white; - text-shadow:1px 1px 0px black; - text-decoration:none; - border: 1px solid #0054A7; - background-color:#0054A7; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png); - background-repeat: repeat-x; - background-position: left 10px; - -webkit-border-radius: 5px; + background-color: #000; + text-decoration: none; +} +.elgg-button-submit.elgg-state-disabled, +.elgg-button-action.elgg-state-disabled { + color: #999; + cursor: default; +} + +.elgg-button-cancel { + color: #333; + background-color: #999; + border: 1px solid #999; +} +.elgg-button-cancel:hover { + color: #222; + background-color: #666; + text-decoration: none; +} + +.elgg-form-useradd input[type=text], +.elgg-form-useradd input[type=password] { + width: 300px; +} + +.elgg-form-settings { + max-width: 800px; +} + +/* ************************************** + DATE PICKER +*************************************** */ +.ui-datepicker { + margin-top: 3px; + padding: 3px 3px 0; + border: 1px solid #ccc; + background-color: white; +} +.ui-datepicker-header { + padding: 2px 0; + border: 1px solid #ccc; + background-color: #eee; + border-radius: 5px; -moz-border-radius: 5px; - width: auto; - padding: 2px 4px; - margin:10px 0 10px 0; - cursor: pointer; - -moz-outline-style: none; - outline: none; - -webkit-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.40); - -moz-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.40); -} -.admin_area input[type="submit"]:hover { - border-color: #333333; - text-decoration:none; - background-color:#333333; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png); - background-repeat: repeat-x; - background-position: left 10px; -} -.admin_area .cancel-button { - font-size: 14px; - font-weight: bold; - text-decoration:none; - color: #333333; - background-color:#dddddd; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png); - background-repeat: repeat-x; - background-position: left 10px; - border: 1px solid #999999; -webkit-border-radius: 5px; - -moz-border-radius: 5px; - width: auto; - padding: 2px 4px; - margin:10px 0 10px 10px; +} +.ui-datepicker-prev, .ui-datepicker-next { + position: absolute; + top: 9px; cursor: pointer; } -.admin_area .cancel-button:hover { - background-color: #999999; - background-position: left 10px; - text-decoration:none; - color:white; +.ui-datepicker-prev { + left: 6px; +} +.ui-datepicker-next { + right: 6px; +} +.ui-datepicker-title { + line-height: 1.8em; + margin: 0 30px; + text-align: center; + font-weight: bold; +} +.ui-datepicker-calendar { + margin-bottom: 2px; +} +.ui-datepicker th { + border: none; + font-weight: bold; + padding: 5px 6px; + text-align: center; +} +.ui-datepicker td { + padding: 1px; +} +.ui-datepicker td span, .ui-datepicker td a { + display: block; + padding: 2px; + line-height: 1.2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker-calendar .ui-state-default { + border: 1px solid #ccc; + color: #555; + background: #fafafa; } -.admin_area .content-header-options .action-button { - margin-top:0; - margin-left:10px; +.ui-datepicker-calendar .ui-state-hover { + border: 1px solid #aaa; + color: #333; + background: #ccc; } -.admin_area input.action-button, -.admin_area a.action-button { +.ui-datepicker-calendar .ui-state-active, +.ui-datepicker-calendar .ui-state-active.ui-state-hover { + font-weight: bold; + border: 1px solid #999; + color: #333; + background: #ddd; +} + +/* *************************************** + AUTOCOMPLETE +*************************************** */ +<?php //autocomplete will expand to fullscreen without max-width ?> +.ui-autocomplete { + position: absolute; + cursor: default; +} +.elgg-autocomplete-item .elgg-body { + max-width: 600px; +} +.ui-autocomplete { + background-color: white; + border: 1px solid #ccc; + overflow: hidden; + -webkit-border-radius: 5px; -moz-border-radius: 5px; - background-color:#cccccc; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_background.gif); - background-repeat: repeat-x; - background-position: 0 0; - border:1px solid #999999; - color:#333333; - padding:2px 15px 2px 15px; - text-align:center; - font-weight:bold; - text-decoration:none; - text-shadow:0 1px 0 white; - cursor:pointer; - -webkit-box-shadow: none; - -moz-box-shadow: none; -} -.admin_area input.action-button:hover, -.admin_area a.action-button:hover, -.admin_area input.action-button:focus, -.admin_area a.action-button:focus { - background-position:0 -15px; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_background.gif); - background-repeat: repeat-x; - color:#111111; + border-radius: 5px; +} +.ui-autocomplete .ui-menu-item { + padding: 0px 4px; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.ui-autocomplete .ui-menu-item:hover { + background-color: #eee; +} +.ui-autocomplete a:hover { text-decoration: none; - background-color:#cccccc; - border:1px solid #999999; + color: #4690D6; } -.admin_area .action-button:active { - background-image:none; +.ui-autocomplete a.ui-state-hover { + background-color: #eee; + display: block; } -.admin_area .action-button.disabled { - color:#999999; - padding:2px 7px 2px 7px; + +/* *************************************** + USER PICKER +*************************************** */ +.elgg-user-picker-list li:first-child { + border-top: 1px dotted #ccc; + margin-top: 5px; } -.admin_area .action-button.disabled:hover { - background-position:0 -15px; - color:#111111; - border:1px solid #999999; +.elgg-user-picker-list > li { + border-bottom: 1px dotted #ccc; } -.admin_area .action-button.disabled:active { - background-image:none; + +/* *************************************** + FRIENDS PICKER +*************************************** */ +.friends-picker-main-wrapper { + margin-bottom: 15px; } -.admin_area .action-button.download { - padding: 5px 9px 5px 6px; +.friends-picker-container h3 { + font-size:4em !important; + text-align: left; + margin:10px 0 20px !important; + color:#999 !important; + background: none !important; + padding:0 !important; } -.admin_area .action-button.download:hover { +.friends-picker .friends-picker-container .panel ul { + text-align: left; + margin: 0; + padding:0; +} +.friends-picker-wrapper { + margin: 0; + padding:0; + position: relative; + width: 730px; +} +.friends-picker { + position: relative; + overflow: hidden; + margin: 0; + padding:0; + width: 730px; + height: auto; + background-color: #dedede; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; } -.admin_area .action-button.download img { - margin-right:6px; - position:relative; - top:5px; +.friendspicker-savebuttons { + background: white; + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + + margin:0 10px 10px; } -.admin_area .action-button.small { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - width: auto; - height:8px; - padding: 4px; - font-size: 0.9em; - line-height: 0.6em; +.friends-picker .friends-picker-container { /* long container used to house end-to-end panels. Width is calculated in JS */ + position: relative; + left: 0; + top: 0; + width: 100%; + list-style-type: none; } -.admin_area .action-button.small:hover { - background-color: #0054A7; - background-image: none; - border-color: #0054A7; - color:white; - text-shadow:0 -1px 0 #999999; +.friends-picker .friends-picker-container .panel { + float:left; + height: 100%; + position: relative; + width: 730px; + margin: 0; + padding:0; } +.friends-picker .friends-picker-container .panel .wrapper { + margin: 0; + padding:4px 10px 10px 10px; + min-height: 230px; +} +.friends-picker-navigation { + margin: 0 0 10px; + padding:0 0 10px; + border-bottom:1px solid #ccc; +} +.friends-picker-navigation ul { + list-style: none; + padding-left: 0; +} +.friends-picker-navigation ul li { + float: left; + margin:0; + background:white; +} +.friends-picker-navigation a { + font-weight: bold; + text-align: center; + background: white; + color: #999; + text-decoration: none; + display: block; + padding: 0; + width:20px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.tabHasContent { + background: white; + color:#333 !important; +} +.friends-picker-navigation li a:hover { + background: #333; + color:white !important; +} +.friends-picker-navigation li a.current { + background: #4690D6; + color:white !important; +} +.friends-picker-navigation-l, .friends-picker-navigation-r { + position: absolute; + top: 46px; + text-indent: -9000em; +} +.friends-picker-navigation-l a, .friends-picker-navigation-r a { + display: block; + height: 40px; + width: 40px; +} +.friends-picker-navigation-l { + right: 48px; + z-index:1; +} +.friends-picker-navigation-r { + right: 0; + z-index:1; +} +.friends-picker-navigation-l { + background: url("<?php echo elgg_get_site_url(); ?>_graphics/friendspicker.png") no-repeat left top; +} +.friends-picker-navigation-r { + background: url("<?php echo elgg_get_site_url(); ?>_graphics/friendspicker.png") no-repeat -60px top; +} +.friends-picker-navigation-l:hover { + background: url("<?php echo elgg_get_site_url(); ?>_graphics/friendspicker.png") no-repeat left -44px; +} +.friends-picker-navigation-r:hover { + background: url("<?php echo elgg_get_site_url(); ?>_graphics/friendspicker.png") no-repeat -60px -44px; +} +.friendspicker-savebuttons .elgg-button-submit, +.friendspicker-savebuttons .elgg-button-cancel { + margin:5px 20px 5px 5px; +} +.friendspicker-members-table { + background: #dedede; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; -/* *************************************** - CONTENT HEADER -**************************************** */ -#content_header { - border-bottom:1px solid #CCCCCC; + margin:10px 0 0; + padding:10px 10px 0; } -#content_header:after { - content: "."; + +/* *************************************** + PAGINATION +*************************************** */ +.elgg-pagination { + margin: 10px 0; display: block; - height: 0; - clear: both; - visibility: hidden; + text-align: center; } -.content-header-title { - float:left; +.elgg-pagination li { + display: inline; + margin: 0 6px 0 0; + text-align: center; } -.content-header-title { - margin-right:10px; - max-width: 530px; +.elgg-pagination a, .elgg-pagination span { + padding: 2px 6px; + color: #333; + border: 1px solid #333; + font-size: 12px; + text-decoration: none; } -.content-header-title h2 { - border:none; - margin-bottom:0; - padding-bottom:5px; +.elgg-pagination a:hover { + background: #333; + color: white; + text-decoration: none; } -.content-header-options { - float:right; +.elgg-pagination .elgg-state-disabled span { + color: #CCC; + border-color: #CCC; } -.content-header-options .action-button { - float:right; - margin:0 0 5px 10px; +.elgg-pagination .elgg-state-selected span { + color: #000; + border-color: #ccc; } -/* ECML */ -.ecml_admin_table { - width:100%; +/* *************************************** + TABS +*************************************** */ +.elgg-tabs { + margin-bottom: 5px; + border-bottom: 1px solid #ccc; + display: table; + width: 100%; +} +.elgg-tabs li { + float: left; + border: 1px solid #ccc; + border-bottom-width: 0; + background: #eee; + margin: 0 0 0 10px; } -.ecml_admin_table td, th { - border: 1px solid gray; +.elgg-tabs a { + text-decoration: none; + display: block; + padding: 3px 10px 0 10px; text-align: center; + height: 21px; + color: #999; +} +.elgg-tabs a:hover { + background: #dedede; + color:#333; +} +.elgg-tabs .elgg-state-selected { + border-color: #ccc; + background: white; +} +.elgg-tabs .elgg-state-selected a { + position: relative; + top: 2px; + background: white; +} + +/* *************************************** + SIDEBAR MENU +*************************************** */ +.elgg-admin-sidebar-menu a { + border: 1px solid red; + display: block; padding: 5px; + color: #333; + cursor: pointer; + text-decoration: none; + margin-bottom: 2px; + border: 1px solid #CCC; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; } -.ecml_admin_table th, .ecml_keyword_desc { - font-weight: bold; +.elgg-admin-sidebar-menu a:hover { + text-decoration: none; + background: black; + color: white; + border: 1px solid black; } -.ecml_row_odd { - background-color: #EEE; +.elgg-admin-sidebar-menu li.elgg-state-selected > a { + background-color: #BBB; +} +.elgg-admin-sidebar-menu .elgg-menu-closed:before { + content: "\25B8"; + padding-right: 4px; +} +.elgg-admin-sidebar-menu .elgg-menu-opened:before { + content: "\25BE"; + padding-right: 4px; +} +.elgg-admin-sidebar-menu .elgg-child-menu { + display: none; + padding-left: 30px; +} +.elgg-admin-sidebar-menu li.elgg-state-selected > ul { + display: block; +} +.elgg-admin-sidebar-menu h2 { + padding-bottom: 5px; +} +.elgg-admin-sidebar-menu ul.elgg-menu-page { + padding-bottom: 15px; } -.ecml_row_even { +/* *************************************** + TITLE MENU +*************************************** */ +.elgg-menu-title { + float: right; } -.ecml_restricted { - color: #555; +.elgg-menu-title > li { + display: inline-block; + margin-left: 4px; } +/* *************************************** + FOOTER MENU +*************************************** */ +.elgg-menu-footer { + color: gray; +} +.elgg-menu-footer li { + float: left; +} +.elgg-menu-footer li:after { + content: "\007C"; + display: inline-block; + padding: 0 4px 0 4px; + font-weight: normal; +} +.elgg-menu-footer li:last-child:after { + content: ""; +} +/* *************************************** + GENERAL MENU +*************************************** */ +.elgg-menu-general > li, +.elgg-menu-general > li > a { + display: inline-block; + color: #999; +} +.elgg-menu-general > li:after { + content: "\007C"; + padding: 0 4px; +} +/* *************************************** + HOVER MENU +*************************************** */ +.elgg-menu-hover { + display: none; + position: absolute; + z-index: 10000; + width: 165px; + border: solid 1px #E5E5E5; + border-color: #E5E5E5 #999 #999 #E5E5E5; + background-color: #FFF; + -webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.50); + -moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.50); + box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.50); +} +.elgg-menu-hover > li { + border-bottom: 1px solid #ddd; +} +.elgg-menu-hover > li:last-child { + border-bottom: none; +} +.elgg-menu-hover .elgg-heading-basic { + display: block; +} +.elgg-menu-hover a { + display: block; + padding: 2px 8px; + font-size: 92%; +} +.elgg-menu-hover a:hover { + background: #ccc; + text-decoration: none; +} +.elgg-menu-hover-admin a { + color: red; +} +.elgg-menu-hover-admin a:hover { + color: white; + background-color: red; +} +/* *************************************** + ENTITY MENU +*************************************** */ +<?php // height depends on line height/font size ?> +.elgg-menu-entity, .elgg-menu-annotation { + float: right; + margin-left: 15px; + font-size: 90%; + color: #666; + line-height: 16px; + height: 16px; +} +.elgg-menu-entity > li, .elgg-menu-annotation > li { + margin-left: 15px; +} +.elgg-menu-entity > li > a, .elgg-menu-annotation > li > a { + color: #aaa; +} +<?php // need to override .elgg-menu-hz ?> +.elgg-menu-entity > li > a, .elgg-menu-annotation > li > a { + display: block; +} +.elgg-menu-entity > li > span, .elgg-menu-annotation > li > span { + vertical-align: baseline; +} -.admin_settings { - margin-bottom:20px; +/* *************************************** + WIDGET MENU +*************************************** */ +.elgg-menu-widget > li { + position: absolute; + top: 4px; + display: inline-block; + width: 18px; + height: 18px; + padding: 2px 2px 0 0; } -.admin_settings table.styled { - width:100%; +.elgg-menu-widget > .elgg-menu-item-collapse { + left: 5px; } -.admin_settings table.styled { - border-top:1px solid #cccccc; +.elgg-menu-widget > .elgg-menu-item-delete { + right: 5px; } -.admin_settings table.styled td { - padding:2px 4px 2px 4px; - border-bottom:1px solid #cccccc; +.elgg-menu-widget > .elgg-menu-item-settings { + right: 25px; } -.admin_settings table.styled td.column-one { - width:200px; + +/* *************************************** + MORE MENUS +*************************************** */ +/* Horizontal menus w/ separator support */ +.elgg-menu-hz > li, +.elgg-menu-hz > li:after, +.elgg-menu-hz > li > a { + display: inline-block; + vertical-align: middle; } -.admin_settings table.styled tr:hover { - background: #E4E4E4; +/* Allow inline image blocks in horizontal menus */ +.elgg-menu-hz .elgg-body:after { + content: '.'; } -.admin_settings.users_online .profile_status { - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - line-height:1.2em; +.elgg-menu > li:last-child::after { + display: none; } -.admin_settings.users_online .profile_status span { - font-size:90%; - color:#666666; +.elgg-menu-admin-footer a { + color: #eee; } -.admin_settings.users_online p.owner_timestamp { - padding-left:3px; +.elgg-menu-admin-footer > li { + padding-right: 25px; } -.admin_plugin_reorder { - float:right; - width:200px; - text-align: right; +.elgg-menu-longtext { + float: right; } -.admin_plugin_reorder a { - padding-left:10px; - font-size:80%; - color:#999999; +.elgg-menu-metadata { + list-style-type: none; + float: right; + margin-left: 15px; + font-size: 90%; } -.admin_area .manifest_file { - background-color:#eeeeee; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - padding:5px 10px 5px 10px; - margin:4px 0 4px 0; +.elgg-menu-metadata > li { + float: left; + margin-left: 15px; } -.admin_area .admin_plugin_enable_disable { - width:150px; - margin:10px 0 0 0; - float:right; - text-align: right; +.elgg-menu-metadata, .elgg-menu-metadata a { + color: #aaa; } -.admin_area .admin_plugin_enable_disable a { - margin:0; + +/* *************************************** + WIDGETS +*************************************** */ +.elgg-widgets { + float: right; + min-height: 30px; } -.pluginsettings { - margin:15px 0 5px 0; - background-color:#eeeeee; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - padding:10px; +.elgg-widget-add-control { + text-align: right; + margin: 5px 5px 15px; } -.pluginsettings h3 { - padding:0 0 5px 0; - margin:0 0 5px 0; - border-bottom:1px solid #999999; +.elgg-widgets-add-panel { + padding: 10px; + margin: 0 5px 15px; + background: #eee; + border: 1px solid #ccc; } -#updateclient_settings h3 { - padding:0; - margin:0; - border:none; +.elgg-widgets-add-panel ul { + padding: 0; + margin: 0; } -.plugin_controls { - padding: 3px 3px 3px 0; +.elgg-widgets-add-panel li { + float: left; + margin: 2px 10px; + list-style: none; + width: 200px; + padding: 4px; + background-color: #eee; + border: 1px solid #ccc; font-weight: bold; +} +.elgg-widgets-add-panel li a { + display: block; +} +.elgg-widget-single.elgg-state-available { + color: #333; + cursor: pointer; +} +.elgg-widget-single.elgg-state-available:hover { + border-color: #aaa; +} +.elgg-widget-single.elgg-state-unavailable { + color: #888; +} + +.elgg-module-widget { + background-color: #dedede; + padding: 1px; + margin: 0 5px 15px; + position: relative; +} +.elgg-module-widget:hover { + background-color: #ccc; +} +.elgg-module-widget > .elgg-head { + background-color: #f5f5f5; + height: 26px; + overflow: hidden; +} +.elgg-module-widget.elgg-state-draggable .elgg-widget-handle { + cursor: move; +} +.elgg-module-widget > .elgg-head h3 { + float: left; + padding: 4px 45px 0 20px; + color: #333; +} + +.elgg-widget-collapse-button { + color: #c5c5c5; + text-decoration: none; +} +a.elgg-widget-collapse-button:hover, +a.elgg-widget-collapsed:hover { + color: #9d9d9d; + text-decoration: none; +} +a.elgg-widget-collapse-button:before { + content: "\25BC"; +} +a.elgg-widget-collapsed:before { + content: "\25BA"; +} +.elgg-module-widget > .elgg-body { + border-top: 1px solid #dedede; + background-color: white; + width: 100%; + overflow: hidden; +} +.elgg-widget-edit { + display: none; + width: 96%; + padding: 2%; + border-bottom: 1px solid #dedede; +} +.elgg-widget-content { + padding: 10px; +} +.elgg-widget-placeholder { + border: 2px dashed #dedede; + margin-bottom: 15px; +} + +/* *************************************** + GRID +*************************************** */ +.elgg-grid {} +.elgg-col { float: left; - width: 150px; } -form.admin_plugins_simpleview .submit-button { - margin-right:20px; +.elgg-col-1of1 { + float: none; } -.plugin_info { - margin: 3px; - padding-left: 150px; +.elgg-col-1of2 { + width: 50%; +} +.elgg-col-1of3 { + width: 33.33%; +} +.elgg-col-2of3 { + width: 66.66%; +} +.elgg-col-1of4 { + width: 25%; +} +.elgg-col-3of4 { + width: 75%; +} +.elgg-col-1of5 { + width: 20%; +} +.elgg-col-2of5 { + width: 40%; +} +.elgg-col-3of5 { + width: 60%; +} +.elgg-col-4of5 { + width: 80%; +} +.elgg-col-1of6 { + width: 16.66%; +} +.elgg-col-5of6 { + width: 83.33%; +} + +/* *************************************** + ICONS +*************************************** */ +.elgg-icon { + background: transparent url(<?php echo elgg_get_site_url(); ?>_graphics/admin_sprites.png) no-repeat left; + width: 16px; + height: 16px; + display: inline-block; + margin: 0 2px; + vertical-align: text-bottom; +} +.elgg-module .elgg-head .elgg-icon { + vertical-align: baseline; +} +.elgg-icon-delete:hover, +.elgg-icon-delete-alt:hover { + background-position: 0 -0px; +} +.elgg-icon-delete, +.elgg-icon-delete-alt { + background-position: 0 -18px; +} +.elgg-icon-drag-arrow:hover { + background-position: 0 -36px; +} +.elgg-icon-drag-arrow { + background-position: 0 -54px; +} +.elgg-icon-hover-menu:hover { + background-position: 0 -72px; +} +.elgg-icon-hover-menu { + background-position: 0 -90px; +} +.elgg-icon-settings-alt:hover { + background-position: 0 -108px; +} +.elgg-icon-settings-alt { + background-position: 0 -126px; +} + +.elgg-ajax-loader { + background: white url(<?php echo elgg_get_site_url(); ?>_graphics/ajax_loader_bw.gif) no-repeat center center; + min-height: 33px; + min-width: 33px; +} + +/* *************************************** + AVATAR ICONS +*************************************** */ +.elgg-avatar { + position: relative; + display: inline-block; +} +.elgg-avatar > a > img { display: block; } -.plugin_metadata { - display:block; - color:#999999; +.elgg-avatar-tiny > a > img { + width: 25px; + height: 25px; + + /* remove the border-radius if you don't want rounded avatars in supported browsers */ + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + + -moz-background-clip: border; + background-clip: border; + + -webkit-background-size: 25px; + -khtml-background-size: 25px; + -moz-background-size: 25px; + -o-background-size: 25px; + background-size: 25px; +} +.elgg-avatar-small > a > img { + width: 40px; + height: 40px; + + /* remove the border-radius if you don't want rounded avatars in supported browsers */ + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + + -moz-background-clip: border; + background-clip: border; + + -webkit-background-size: 40px; + -khtml-background-size: 40px; + -moz-background-size: 40px; + -o-background-size: 40px; + background-size: 40px; +} +.elgg-avatar-medium > a > img { + width: 100px; + height: 100px; +} +.elgg-avatar-large > a > img { + width: 200px; + height: 200px; } -.plugin_name input[type="checkbox"] { - margin-right: 10px; +.elgg-avatar > .elgg-icon-hover-menu { + display: none; + position: absolute; + right: 0; + bottom: 0; + margin: 0; + cursor: pointer; } -ul.admin_plugins { - margin-bottom:0; - padding-left:0; - list-style: none; +.elgg-avatar { + position: relative; +} +.elgg-avatar > a > img { + display: block; } -.plugin_details { - margin:0 0 5px 0; - padding:0 7px 4px 10px; +.elgg-avatar-tiny > a > img { + width: 25px; + height: 25px; + + /* remove the border-radius if you don't want rounded avatars in supported browsers */ + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + + -moz-background-clip: border; + background-clip: border; + + -webkit-background-size: 25px; + -khtml-background-size: 25px; + -moz-background-size: 25px; + -o-background-size: 25px; + background-size: 25px; +} +.elgg-avatar-small > a > img { + width: 40px; + height: 40px; + + /* remove the border-radius if you don't want rounded avatars in supported browsers */ -webkit-border-radius: 5px; -moz-border-radius: 5px; + border-radius: 5px; + + -moz-background-clip: border; + background-clip: border; + + -webkit-background-size: 40px; + -khtml-background-size: 40px; + -moz-background-size: 40px; + -o-background-size: 40px; + background-size: 40px; +} +.elgg-avatar-medium > a > img { + width: 100px; + height: 100px; +} +.elgg-avatar-large > a > img { + width: 200px; + height: 200px; } -.plugin_details p { - margin:0; - padding:0; + +/* *************************************** + PLUGINS +**************************************** */ +.elgg-plugin { + border: 1px solid #999; + margin: 0 0 5px; + padding: 0 7px 4px 10px; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.elgg-plugin.elgg-state-draggable > .elgg-image-block .elgg-head { + cursor: move; } -.plugin_details h3 { - margin-top:-13px; - color:black; +.elgg-plugin p { + margin: 0; +} +.elgg-plugin h3 { + color: black; + padding-bottom: 10px; } -.plugin_settings { +.elgg-plugin-settings { font-weight: normal; + font-size: 0.9em; } -.active { - border:1px solid #999999; - background:white; +.elgg-plugin-screenshot { + display: inline; } -.not_active { - border:1px solid #999999; - background:#dedede; +.elgg-plugin-screenshot img { + border: 1px solid #999; } -.configure_menuitems { - margin-bottom:30px; +.elgg-plugin-screenshot-lightbox { + display: block; + position: absolute; + width: 99%; + text-align: center; + background-color: white; + border: 1px solid #999; + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; } -.admin_settings.menuitems .input-pulldown { - margin-right:15px; - margin-bottom:10px; +.elgg-plugin-screenshot-lightbox h2 { + color: black; } -.admin_settings.menuitems .custom_menuitems { - list-style: none; - padding:0; - margin:0; +.elgg-plugin.elgg-state-active { + background: white; +} +.elgg-plugin.elgg-state-inactive { + background: #dedede; } -.admin_settings.menuitems li.custom_menuitem { - margin-bottom:20px; +.elgg-plugin .elgg-state-error { + background: #fbe3e4; + color: #8a1f11; + border-color: #fbc2c4; + font-weight: bold; } -.admin_notices { - padding-bottom: 15px; +.elgg-plugin .elgg-state-warning { + background: #fbedb5; + color: #000000; + border-color: #fbe58b; + font-weight: bold; } -.admin_notices p { - background-color:#BDE5F8; - color: black; - border: 1px solid blue; +.elgg-plugin-more { + background-color: #eee; + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + + padding: 5px 10px; + margin: 4px 0; +} +ul.elgg-plugin-categories, ul.elgg-plugin-categories > li, +ul.elgg-plugin-resources, ul.elgg-plugin-resources > li { + display: inline; +} +.elgg-plugin-category-bundled { + border-width: 2px; + border-color: #0054A7; +} + +/**************************************** + MARKDOWN +****************************************/ +.elgg-markdown { + margin: 15px; +} +.elgg-markdown h1, +.elgg-markdown h2, +.elgg-markdown h3, +.elgg-markdown h4, +.elgg-markdown h5, +.elgg-markdown h6 { + margin: 1em 0 1em -15px; + color: #333; +} +.elgg-markdown ol { + list-style: decimal; + padding-left: 2em; +} +.elgg-markdown ul { + list-style: disc; + padding-left: 2em; +} +.elgg-markdown p { + margin: 15px 0; +} + +/* *************************************** + MISC +*************************************** */ +.elgg-content-thin { + max-width: 600px; +} + +.elgg-subtext { + color: #666; + font-size: 85%; + line-height: 1.2em; + font-style: italic; + margin-bottom: 5px; +} + +.elgg-text-help { + display: block; + font-size: 85%; + font-style: italic; +} + +.elgg-longtext-control { + margin-left: 14px; + font-size: 80%; + cursor: pointer; +} + +table.mceLayout { + width:100% !important; +} + +.elgg-output dt { font-weight: bold; - padding:3px 10px; - -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); - -moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); - -webkit-border-radius: 4px; - -moz-border-radius: 4px; +} +.elgg-output dd { + margin: 0 0 1em 2em; } /* *************************************** - ELGG TABBED PAGE NAVIGATION + SITE SECRET *************************************** */ -.elgg-horizontal-tabbed-nav { - margin-bottom:5px; - padding: 0; - border-bottom: 2px solid #cccccc; - display:table; - width:100%; +.elgg-form-admin-site-regenerate-secret table { + width: 60%; + margin: 1em auto; } -.elgg-horizontal-tabbed-nav ul { - list-style: none; - padding: 0; - margin: 0; +td.elgg-strength-strong, +td.elgg-strength-strong h4 { + background: #DFF0D8; color: #468847; } -.elgg-horizontal-tabbed-nav li { +td.elgg-strength-moderate, +td.elgg-strength-moderate h4 { + background: #FCF8E3; color: #C09853; +} +td.elgg-strength-weak, +td.elgg-strength-weak h4 { + background: #F2DEDE; color: #B94A48; +} + +/* *************************************** + HELPERS +*************************************** */ +.hidden { + display: none; +} +.centered { + margin: 0 auto; +} +.center { + text-align: center; +} +.float { float: left; - border: 2px solid #cccccc; - border-bottom-width: 0; - background: #eeeeee; - margin: 0 0 0 10px; - -moz-border-radius-topleft:5px; - -moz-border-radius-topright:5px; - -webkit-border-top-left-radius:5px; - -webkit-border-top-right-radius:5px; } -.elgg-horizontal-tabbed-nav a { - text-decoration: none; +.float-alt { + float: right; +} +.elgg-toggle { + cursor: pointer; +} +.elgg-discover .elgg-discoverable { + display: none; +} +.elgg-discover:hover .elgg-discoverable { display: block; - padding:3px 10px 0 10px; - text-align: center; - height:21px; - color:#999999; } -.elgg-horizontal-tabbed-nav a:hover { - background: #dedede; - color:#4690D6; +.elgg-transition:hover { + opacity: .7; } -.elgg-horizontal-tabbed-nav .selected { - border-color: #cccccc; - background: white; + +/* *************************************** + BORDERS AND SEPARATORS +*************************************** */ +.elgg-border-plain { + border: 1px solid #eeeeee; } -.elgg-horizontal-tabbed-nav .selected a { - position: relative; - top: 2px; - background: white; +.elgg-border-transition { + border: 1px solid #eeeeee; +} +.elgg-divide-top { + border-top: 1px solid #CCCCCC; +} +.elgg-divide-bottom { + border-bottom: 1px solid #CCCCCC; +} +.elgg-divide-left { + border-left: 1px solid #CCCCCC; } +.elgg-divide-right { + border-right: 1px solid #CCCCCC; +} + +/* *************************************** + SPACING (from OOCSS) +*************************************** */ +.pan{padding:0} +.pas{padding:5px} +.pam{padding:10px} +.pal{padding:20px} +.ptn{padding-top:0} +.pts{padding-top:5px} +.ptm{padding-top:10px} +.ptl{padding-top:20px} +.prn{padding-right:0} +.prs{padding-right:5px} +.prm{padding-right:10px} +.prl{padding-right:20px} +.pbn{padding-bottom:0} +.pbs{padding-bottom:5px} +.pbm{padding-bottom:10px} +.pbl{padding-bottom:20px} +.pln{padding-left:0} +.pls{padding-left:5px} +.plm{padding-left:10px} +.pll{padding-left:20px} +.phn{padding-left:0;padding-right:0} +.phs{padding-left:5px;padding-right:5px} +.phm{padding-left:10px;padding-right:10px} +.phl{padding-left:20px;padding-right:20px} +.pvn{padding-top:0;padding-bottom:0} +.pvs{padding-top:5px;padding-bottom:5px} +.pvm{padding-top:10px;padding-bottom:10px} +.pvl{padding-top:20px;padding-bottom:20px} +.man{margin:0} +.mas{margin:5px} +.mam{margin:10px} +.mal{margin:20px} +.mtn{margin-top:0} +.mts{margin-top:5px} +.mtm{margin-top:10px} +.mtl{margin-top:20px} +.mrn{margin-right:0} +.mrs{margin-right:5px} +.mrm{margin-right:10px} +.mrl{margin-right:20px} +.mbn{margin-bottom:0} +.mbs{margin-bottom:5px} +.mbm{margin-bottom:10px} +.mbl{margin-bottom:20px} +.mln{margin-left:0} +.mls{margin-left:5px} +.mlm{margin-left:10px} +.mll{margin-left:20px} +.mhn{margin-left:0;margin-right:0} +.mhs{margin-left:5px;margin-right:5px} +.mhm{margin-left:10px;margin-right:10px} +.mhl{margin-left:20px;margin-right:20px} +.mvn{margin-top:0;margin-bottom:0} +.mvs{margin-top:5px;margin-bottom:5px} +.mvm{margin-top:10px;margin-bottom:10px} +.mvl{margin-top:20px;margin-bottom:20px} diff --git a/views/default/css/components/forms.php b/views/default/css/components/forms.php deleted file mode 100644 index e54685f86..000000000 --- a/views/default/css/components/forms.php +++ /dev/null @@ -1,261 +0,0 @@ -<?php -/** - * CSS form elements - * - * @package Elgg.Core - * @subpackage UI - */ -?> -/* *************************************** - Form Elements -*************************************** */ -/* default elgg core input field classes */ -.input-text, -.input-tags, -.input-url, -.input-textarea { - width:98%; -} -.input-access { - margin:5px 0 0 0; -} -.input-password { - width:200px; -} -.input-textarea { - height: 200px; - width:718px; -} -input[type="checkbox"], -input.input-radio { - margin:0 3px 0 0; - padding:0; - border:none; -} -label { - font-weight: bold; - color:#333333; - font-size: 110%; -} -input { - font: 120% Arial, Helvetica, sans-serif; - padding: 5px; - border: 1px solid #cccccc; - color:#666666; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; -} -textarea { - font: 120% Arial, Helvetica, sans-serif; - border: solid 1px #cccccc; - padding: 5px; - color:#666666; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; -} -textarea:focus, -input[type="text"]:focus { - border: solid 1px #4690d6; - background: #e4ecf5; - color:#333333; -} -.input-textarea.monospace { - font-family:Monaco,"Courier New",Courier,monospace; - font-size:13px; -} -a.longtext-control { - float:right; - margin-left:14px; -} -.submit-button { - font-size: 14px; - font-weight: bold; - color: white; - text-shadow:1px 1px 0px black; - text-decoration:none; - border: 1px solid #4690d6; - background-color:#4690d6; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png); - background-repeat: repeat-x; - background-position: left 10px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - width: auto; - padding: 2px 4px; - margin:0 10px 10px 0; - cursor: pointer; - -webkit-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.40); - -moz-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.40); -} -.submit-button:hover { - color: white; - border-color: #0054a7; - text-decoration:none; - background-color:#0054a7; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png); - background-repeat: repeat-x; - background-position: left 10px; -} -.submit-button.disabled { - background-color:#999999; - border-color:#999999; - color:#dedede; -} -.submit-button.disabled:hover { - background-color:#999999; - border-color:#999999; - color:#dedede; -} -input[type="password"]:focus { - border: solid 1px #4690d6; - background-color: #e4ecf5; - color:#333333; -} -input[type="submit"] { - font-size: 14px; - font-weight: bold; - color: white; - text-shadow:1px 1px 0px black; - text-decoration:none; - border: 1px solid #4690d6; - background-color:#4690d6; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png); - background-repeat: repeat-x; - background-position: left 10px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - width: auto; - padding: 2px 4px; - margin:10px 0 10px 0; - cursor: pointer; - -moz-outline-style: none; - outline: none; - -webkit-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.40); - -moz-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.40); -} -input[type="submit"]:hover { - border-color: #0054a7; - text-decoration:none; - background-color:#0054a7; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png); - background-repeat: repeat-x; - background-position: left 10px; -} -.cancel-button { - font-size: 14px; - font-weight: bold; - text-decoration:none; - color: #333333; - background-color:#dddddd; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png); - background-repeat: repeat-x; - background-position: left 10px; - border: 1px solid #999999; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - width: auto; - padding: 2px 4px; - margin:10px 0 10px 10px; - cursor: pointer; -} -.cancel-button:hover { - background-color: #999999; - background-position: left 10px; - text-decoration:none; - color:white; -} -.action-button { - margin-left: 10px; -} -input.action-button, -a.action-button { - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - background-color:#cccccc; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_background.gif); - background-repeat: repeat-x; - background-position: 0 0; - border:1px solid #999999; - color:#333333; - padding:2px 15px 2px 15px; - text-align:center; - font-weight:bold; - text-decoration:none; - text-shadow:0 1px 0 white; - cursor:pointer; - -webkit-box-shadow: none; - -moz-box-shadow: none; -} -input.action-button:hover, -a.action-button:hover, -input.action-button:focus, -a.action-button:focus { - background-position:0 -15px; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_background.gif); - background-repeat: repeat-x; - color:#111111; - text-decoration: none; - background-color:#cccccc; - border:1px solid #999999; -} -.action-button:active { - background-image:none; -} -.action-button.disabled { - color:#999999; - padding:2px 7px 2px 7px; -} -.action-button.disabled:hover { - background-position:0 -15px; - color:#111111; - border:1px solid #999999; -} -.action-button.disabled:active { - background-image:none; -} -.action-button.download { - padding: 5px 9px 5px 6px; -} -.action-button.download:hover { - -} -.action-button.download img { - margin-right:6px; - position:relative; - top:5px; -} -.action-button.small { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - width: auto; - height:8px; - padding: 4px; - font-size: 0.9em; - line-height: 0.6em; -} -.action-button.small:hover { - background-color: #4690d6; - background-image: none; - border-color: #4690d6; - color:white; - text-shadow:0 -1px 0 black; -} -/* small round delete button */ -.delete-button { - width:14px; - height:14px; - margin:0; - float:right; -} -.delete-button a { - display:block; - cursor: pointer; - width:14px; - height:14px; - background: url("<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png") no-repeat -200px top; - text-indent: -9000px; - text-align: left; -} -.delete-button a:hover { - background-position: -200px -16px; -} diff --git a/views/default/css/components/heading.php b/views/default/css/components/heading.php deleted file mode 100644 index 206264f03..000000000 --- a/views/default/css/components/heading.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * CSS headings - * - * @package Elgg.Core - * @subpackage UI - */ -?> -/* *************************************** - Headings -*************************************** */ diff --git a/views/default/css/components/spacing.php b/views/default/css/components/spacing.php deleted file mode 100644 index d65e2fc09..000000000 --- a/views/default/css/components/spacing.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php -/** - * CSS spacing - * - * @package Elgg.Core - * @subpackage UI - */ -?> -/* *************************************** - Spacing (from OOCSS) -*************************************** */ -/** -* Spacing classes -* Should be used to modify the default spacing between objects (not between nodes of the same object) -* Please use judiciously. You want to be using defaults most of the time, these are exceptions! -* <type><location><size> -*/ -/* ====== Default spacing ====== */ -/* comment out for now -h1, h2, h3, h4, h5, h6, ul, ol, dl, p, blockquote, .media {margin:10px;} -h1, h2, h3, h4, h5, h6, img{padding-bottom:0px;} -pre{margin: 10px;} -table h1,table h2,table h3, table h4, table h5, table h6, table p, table ul, table ol, table dl{padding:0;} -*/ - -.pan{padding:0} -.pas{padding:5px} -.pam{padding:10px} -.pal{padding:20px} -.ptn{padding-top:0} -.pts{padding-top:5px} -.ptm{padding-top:10px} -.ptl{padding-top:20px} -.prn{padding-right:0} -.prs{padding-right:5px} -.prm{padding-right:10px} -.prl{padding-right:20px} -.pbn{padding-bottom:0} -.pbs{padding-bottom:5px} -.pbm{padding-bottom:10px} -.pbl{padding-bottom:20px} -.pln{padding-left:0} -.pls{padding-left:5px} -.plm{padding-left:10px} -.pll{padding-left:20px} -.phn{padding-left:0;padding-right:0} -.phs{padding-left:5px;padding-right:5px} -.phm{padding-left:10px;padding-right:10px} -.phl{padding-left:20px;padding-right:20px} -.pvn{padding-top:0;padding-bottom:0} -.pvs{padding-top:5px;padding-bottom:5px} -.pvm{padding-top:10px;padding-bottom:10px} -.pvl{padding-top:20px;padding-bottom:20px} -.man{margin:0} -.mas{margin:5px} -.mam{margin:10px} -.mal{margin:20px} -.mtn{margin-top:0} -.mts{margin-top:5px} -.mtm{margin-top:10px} -.mtl{margin-top:20px} -.mrn{margin-right:0} -.mrs{margin-right:5px} -.mrm{margin-right:10px} -.mrl{margin-right:20px} -.mbn{margin-bottom:0} -.mbs{margin-bottom:5px} -.mbm{margin-bottom:10px} -.mbl{margin-bottom:20px} -.mln{margin-left:0} -.mls{margin-left:5px} -.mlm{margin-left:10px} -.mll{margin-left:20px} -.mhn{margin-left:0;margin-right:0} -.mhs{margin-left:5px;margin-right:5px} -.mhm{margin-left:10px;margin-right:10px} -.mhl{margin-left:20px;margin-right:20px} -.mvn{margin-top:0;margin-bottom:0} -.mvs{margin-top:5px;margin-bottom:5px} -.mvm{margin-top:10px;margin-bottom:10px} -.mvl{margin-top:20px;margin-bottom:20px} diff --git a/views/default/css/components/typography.php b/views/default/css/components/typography.php deleted file mode 100644 index 869b74bf8..000000000 --- a/views/default/css/components/typography.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * CSS typography - * - * @package Elgg.Core - * @subpackage UI - */ -?> -/* *************************************** - Typography -*************************************** */ diff --git a/views/default/css/components/OOCSS_LICENSE b/views/default/css/elements/OOCSS_LICENSE index c09c45873..c09c45873 100644 --- a/views/default/css/components/OOCSS_LICENSE +++ b/views/default/css/elements/OOCSS_LICENSE diff --git a/views/default/css/elements/buttons.php b/views/default/css/elements/buttons.php new file mode 100644 index 000000000..e9c99cf96 --- /dev/null +++ b/views/default/css/elements/buttons.php @@ -0,0 +1,156 @@ +<?php +/** + * CSS buttons + * + * @package Elgg.Core + * @subpackage UI + */ +?> +/* ************************** + BUTTONS +************************** */ + +/* Base */ +.elgg-button { + font-size: 14px; + font-weight: bold; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + + width: auto; + padding: 2px 4px; + cursor: pointer; + outline: none; + + -webkit-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.40); + -moz-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.40); + box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.40); +} +a.elgg-button { + padding: 3px 6px; +} + +/* Submit: This button should convey, "you're about to take some definitive action" */ +.elgg-button-submit { + color: white; + text-shadow: 1px 1px 0px black; + text-decoration: none; + border: 1px solid #4690d6; + background: #4690d6 url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png) repeat-x left 10px; +} + +.elgg-button-submit:hover { + border-color: #0054a7; + text-decoration: none; + color: white; + background: #0054a7 url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png) repeat-x left 10px; +} + +.elgg-button-submit.elgg-state-disabled { + background: #999; + border-color: #999; + cursor: default; +} + +/* Cancel: This button should convey a negative but easily reversible action (e.g., turning off a plugin) */ +.elgg-button-cancel { + color: #333; + background: #ddd url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png) repeat-x left 10px; + border: 1px solid #999; +} +.elgg-button-cancel:hover { + color: #444; + background-color: #999; + background-position: left 10px; + text-decoration: none; +} + +/* Action: This button should convey a normal, inconsequential action, such as clicking a link */ +.elgg-button-action { + background: #ccc url(<?php echo elgg_get_site_url(); ?>_graphics/button_background.gif) repeat-x 0 0; + border:1px solid #999; + color: #333; + padding: 2px 15px; + text-align: center; + font-weight: bold; + text-decoration: none; + text-shadow: 0 1px 0 white; + cursor: pointer; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +.elgg-button-action:hover, +.elgg-button-action:focus { + background: #ccc url(<?php echo elgg_get_site_url(); ?>_graphics/button_background.gif) repeat-x 0 -15px; + color: #111; + text-decoration: none; + border: 1px solid #999; +} + +/* Delete: This button should convey "be careful before you click me" */ +.elgg-button-delete { + color: #bbb; + text-decoration: none; + border: 1px solid #333; + background: #555 url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png) repeat-x left 10px; + text-shadow: 1px 1px 0px black; +} +.elgg-button-delete:hover { + color: #999; + background-color: #333; + background-position: left 10px; + text-decoration: none; +} + +.elgg-button-dropdown { + padding:3px 6px; + text-decoration:none; + display:block; + font-weight:bold; + position:relative; + margin-left:0; + color: white; + border:1px solid #71B9F7; + + -webkit-border-radius:4px; + -moz-border-radius:4px; + border-radius:4px; + + -webkit-box-shadow: 0 0 0; + -moz-box-shadow: 0 0 0; + box-shadow: 0 0 0; + + /*background-image:url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png); + background-position:-150px -51px; + background-repeat:no-repeat;*/ +} + +.elgg-button-dropdown:after { + content: " \25BC "; + font-size:smaller; +} + +.elgg-button-dropdown:hover { + background-color:#71B9F7; + text-decoration:none; +} + +.elgg-button-dropdown.elgg-state-active { + background: #ccc; + outline: none; + color: #333; + border:1px solid #ccc; + + -webkit-border-radius:4px 4px 0 0; + -moz-border-radius:4px 4px 0 0; + border-radius:4px 4px 0 0; +} diff --git a/views/default/css/elements/components.php b/views/default/css/elements/components.php new file mode 100644 index 000000000..7fe535d57 --- /dev/null +++ b/views/default/css/elements/components.php @@ -0,0 +1,286 @@ +<?php +/** + * Layout Object CSS + * + * Image blocks, lists, tables, gallery, messages + * + * @package Elgg.Core + * @subpackage UI + */ +?> + +/* *************************************** + Image Block +*************************************** */ +.elgg-image-block { + padding: 3px 0; +} +.elgg-image-block .elgg-image { + float: left; + margin-right: 5px; +} +.elgg-image-block .elgg-image-alt { + float: right; + margin-left: 5px; +} + +/* *************************************** + List +*************************************** */ +.elgg-list { + border-top: 1px dotted #CCCCCC; + margin: 5px 0; + clear: both; +} +.elgg-list > li { + border-bottom: 1px dotted #CCCCCC; +} + +.elgg-item .elgg-subtext { + margin-bottom: 5px; +} +.elgg-item .elgg-content { + margin: 10px 5px; +} + +/* *************************************** + Gallery +*************************************** */ +.elgg-gallery { + border: none; + margin-right: auto; + margin-left: auto; +} +.elgg-gallery td { + padding: 5px; +} +.elgg-gallery-fluid > li { + float: left; +} +.elgg-gallery-users > li { + margin: 0 2px; +} + +/* *************************************** + Tables +*************************************** */ +.elgg-table { + width: 100%; + border-top: 1px solid #ccc; +} +.elgg-table td, .elgg-table th { + padding: 4px 8px; + border: 1px solid #ccc; +} +.elgg-table th { + background-color: #ddd; +} +.elgg-table tr:nth-child(odd), .elgg-table tr.odd { + background-color: #fff; +} +.elgg-table tr:nth-child(even), .elgg-table tr.even { + background-color: #f0f0f0; +} +.elgg-table-alt { + width: 100%; + border-top: 1px solid #ccc; +} +.elgg-table-alt th { + background-color: #eee; + font-weight: bold; +} +.elgg-table-alt td, .elgg-table-alt th { + padding: 2px 4px 2px 4px; + border-bottom: 1px solid #ccc; +} +.elgg-table-alt td:first-child { + width: 200px; +} +.elgg-table-alt tr:hover { + background: #E4E4E4; +} + +/* *************************************** + Owner Block +*************************************** */ +.elgg-owner-block { + margin-bottom: 20px; +} + +/* *************************************** + Messages +*************************************** */ +.elgg-message { + color: white; + font-weight: bold; + display: block; + padding: 3px 10px; + cursor: pointer; + opacity: 0.9; + + -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); + -moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; +} +.elgg-state-success { + background-color: black; +} +.elgg-state-error { + background-color: red; +} +.elgg-state-notice { + background-color: #4690D6; +} + +/* *************************************** + River +*************************************** */ +.elgg-list-river { + border-top: 1px solid #CCC; +} +.elgg-list-river > li { + border-bottom: 1px solid #CCC; +} +.elgg-river-item { + padding: 7px 0; +} +.elgg-river-item .elgg-pict { + margin-right: 20px; +} +.elgg-river-timestamp { + color: #666; + font-size: 85%; + font-style: italic; + line-height: 1.2em; +} + +.elgg-river-attachments, +.elgg-river-message, +.elgg-river-content { + border-left: 1px solid #CCC; + font-size: 85%; + line-height: 1.5em; + margin: 8px 0 5px 0; + padding-left: 5px; +} +.elgg-river-attachments .elgg-avatar, +.elgg-river-attachments .elgg-icon { + float: left; +} +.elgg-river-layout .elgg-input-dropdown { + float: right; + margin: 10px 0; +} + +.elgg-river-comments-tab { + display: block; + background-color: #EEE; + color: #4690D6; + margin-top: 5px; + width: auto; + float: right; + font-size: 85%; + padding: 1px 7px; + + -webkit-border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + border-radius: 5px 5px 0 0; +} + +<?php //@todo components.php ?> +.elgg-river-comments { + margin: 0; + border-top: none; +} +.elgg-river-comments li:first-child { + -webkit-border-radius: 5px 0 0; + -moz-border-radius: 5px 0 0; + border-radius: 5px 0 0; +} +.elgg-river-comments li:last-child { + -webkit-border-radius: 0 0 5px 5px; + -moz-border-radius-bottomleft: 0 0 5px 5px; + border-radius-bottomleft: 0 0 5px 5px; +} +.elgg-river-comments li { + background-color: #EEE; + border-bottom: none; + padding: 4px; + margin-bottom: 2px; +} +.elgg-river-comments .elgg-media { + padding: 0; +} +.elgg-river-more { + background-color: #EEE; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + + padding: 2px 4px; + font-size: 85%; + margin-bottom: 2px; +} + +<?php //@todo location-dependent styles ?> +.elgg-river-item form { + background-color: #EEE; + padding: 4px; + + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + + height: 30px; +} +.elgg-river-item input[type=text] { + width: 80%; +} +.elgg-river-item input[type=submit] { + margin: 0 0 0 10px; +} + + +/* ************************************** + Comments (from elgg_view_comments) +************************************** */ +.elgg-comments { + margin-top: 25px; +} +.elgg-comments > form { + margin-top: 15px; +} + +/* *************************************** + Image-related +*************************************** */ +.elgg-photo { + border: 1px solid #ccc; + padding: 3px; + background-color: white; +} + +/* *************************************** + Tags +*************************************** */ +.elgg-tags { + font-size: 85%; +} +.elgg-tags > li { + float:left; + margin-right: 5px; +} +.elgg-tags li.elgg-tag:after { + content: ","; +} +.elgg-tags li.elgg-tag:last-child:after { + content: ""; +} +.elgg-tagcloud { + text-align: justify; +} diff --git a/views/default/css/elements/core.php b/views/default/css/elements/core.php new file mode 100644 index 000000000..74f21ee59 --- /dev/null +++ b/views/default/css/elements/core.php @@ -0,0 +1,117 @@ +<?php +/** + * Core CSS + * + * This file holds all the complicated/hacky stuff that you really + * shouldn't touch or override unless you're sure you know what you're doing. + * + * Provides classes that implement cross-browser support for the following features: + * * clearfix + * * fluid-width content area that doesn't wrap around floats + * * menu's with separators + * * inline-block + * * horizontal menus + * * fluid gallery without using tables + */ +?> + +/* Clearfix */ +.clearfix:after, +.elgg-grid:after, +.elgg-layout:after, +.elgg-inner:after, +.elgg-page-header:after, +.elgg-page-footer:after, +.elgg-head:after, +.elgg-foot:after, +.elgg-col:after, +.elgg-image-block:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +/* Fluid width container that does not wrap floats */ +.elgg-body, +.elgg-col-last { + display: block; + width: auto; + word-wrap: break-word; + overflow: hidden; + + /* IE 6, 7 */ + zoom:1; + *overflow:visible; +} + +<?php +/** + * elgg-body fills the space available to it. + * It uses hidden text to expand itself. The combination of auto width, overflow + * hidden, and the hidden text creates this effect. + * + * This allows us to float fixed width divs to either side of an .elgg-body div + * without having to specify the body div's width. + * + * @todo check what happens with long <pre> tags or large images + * @todo Move this to its own file -- it is very complicated and should not have to be overridden. + */ + +//@todo isn't this only needed if we use display:table-cell? +?> +.elgg-body:after, +.elgg-col-last:after { + display: block; + visibility: hidden; + height: 0 !important; + line-height: 0; + overflow: hidden; + + /* Stretch to fill up available space */ + font-size: xx-large; + content: " x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x "; +} + +/* *************************************** + * MENUS + * + * To add separators to a menu: + * .elgg-menu-$menu > li:after {content: '|'; background: ...;} + *************************************** */ +/* Enabled nesting of dropdown/flyout menus */ +.elgg-menu > li { position: relative; } + +.elgg-menu > li:last-child::after { + display: none; +} + +/* Maximize click target */ +.elgg-menu > li > a { display: block } + +/* Horizontal menus w/ separator support */ +.elgg-menu-hz > li, +.elgg-menu-hz > li:after, +.elgg-menu-hz > li > a, +.elgg-menu-hz > li > span { + vertical-align: middle; +} + +/* Allow inline image blocks in horizontal menus */ +.elgg-menu-hz .elgg-body:after { content: '.'; } + +<?php //@todo This isn't going to work as-is. Needs testing ?> +/* Inline block */ +.elgg-gallery > li, +.elgg-button, +.elgg-icon, +.elgg-menu-hz > li, +.elgg-menu-hz > li:after, +.elgg-menu-hz > li > a, +.elgg-menu-hz > li > span { + /* Google says do this, but why? */ + position: relative; + + display: inline-block; +} diff --git a/views/default/css/elements/forms.php b/views/default/css/elements/forms.php new file mode 100644 index 000000000..068cc8fd6 --- /dev/null +++ b/views/default/css/elements/forms.php @@ -0,0 +1,375 @@ +<?php +/** + * CSS form/input elements + * + * @package Elgg.Core + * @subpackage UI + */ +?> + +/* *************************************** + Form Elements +*************************************** */ +fieldset > div { + margin-bottom: 15px; +} +fieldset > div:last-child { + margin-bottom: 0; +} +.elgg-form-alt > fieldset > .elgg-foot { + border-top: 1px solid #CCC; + padding: 10px 0; +} + +label { + font-weight: bold; + color: #333; + font-size: 110%; +} + +input, textarea { + border: 1px solid #ccc; + color: #666; + font: 120% Arial, Helvetica, sans-serif; + padding: 5px; + width: 100%; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +input[type=text]:focus, textarea:focus { + border: solid 1px #4690d6; + background: #e4ecf5; + color:#333; +} + +textarea { + height: 200px; +} + + +.elgg-longtext-control { + float: right; + margin-left: 14px; + font-size: 80%; + cursor: pointer; +} + + +.elgg-input-access { + margin:5px 0 0 0; +} + +input[type="checkbox"], +input[type="radio"] { + margin:0 3px 0 0; + padding:0; + border:none; + border-radius:0; + width:auto; +} +.elgg-input-checkboxes.elgg-horizontal li, +.elgg-input-radios.elgg-horizontal li { + display: inline; + padding-right: 10px; +} + +.elgg-form-login, .elgg-form-account { + max-width: 450px; +} + +/* *************************************** + FRIENDS PICKER +*************************************** */ +.friends-picker-main-wrapper { + margin-bottom: 15px; +} +.friends-picker-container h3 { + font-size:4em !important; + text-align: left; + margin:10px 0 20px !important; + color:#999 !important; + background: none !important; + padding:0 !important; +} +.friends-picker .friends-picker-container .panel ul { + text-align: left; + margin: 0; + padding:0; +} +.friends-picker-wrapper { + margin: 0; + padding:0; + position: relative; + width: 730px; +} +.friends-picker { + position: relative; + overflow: hidden; + margin: 0; + padding:0; + width: 730px; + height: auto; + background-color: #dedede; + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; +} +.friendspicker-savebuttons { + background: white; + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + + margin:0 10px 10px; +} +.friends-picker .friends-picker-container { /* long container used to house end-to-end panels. Width is calculated in JS */ + position: relative; + left: 0; + top: 0; + width: 100%; + list-style-type: none; +} +.friends-picker .friends-picker-container .panel { + float:left; + height: 100%; + position: relative; + width: 730px; + margin: 0; + padding:0; +} +.friends-picker .friends-picker-container .panel .wrapper { + margin: 0; + padding:4px 10px 10px 10px; + min-height: 230px; +} +.friends-picker-navigation { + margin: 0 0 10px; + padding:0 0 10px; + border-bottom:1px solid #ccc; +} +.friends-picker-navigation ul { + list-style: none; + padding-left: 0; +} +.friends-picker-navigation ul li { + float: left; + margin:0; + background:white; +} +.friends-picker-navigation a { + font-weight: bold; + text-align: center; + background: white; + color: #999; + text-decoration: none; + display: block; + padding: 0; + width:20px; + + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.tabHasContent { + background: white; + color:#333 !important; +} +.friends-picker-navigation li a:hover { + background: #333; + color:white !important; +} +.friends-picker-navigation li a.current { + background: #4690D6; + color:white !important; +} +.friends-picker-navigation-l, .friends-picker-navigation-r { + position: absolute; + top: 46px; + text-indent: -9000em; +} +.friends-picker-navigation-l a, .friends-picker-navigation-r a { + display: block; + height: 40px; + width: 40px; +} +.friends-picker-navigation-l { + right: 48px; + z-index:1; +} +.friends-picker-navigation-r { + right: 0; + z-index:1; +} +.friends-picker-navigation-l { + background: url("<?php echo elgg_get_site_url(); ?>_graphics/friendspicker.png") no-repeat left top; +} +.friends-picker-navigation-r { + background: url("<?php echo elgg_get_site_url(); ?>_graphics/friendspicker.png") no-repeat -60px top; +} +.friends-picker-navigation-l:hover { + background: url("<?php echo elgg_get_site_url(); ?>_graphics/friendspicker.png") no-repeat left -44px; +} +.friends-picker-navigation-r:hover { + background: url("<?php echo elgg_get_site_url(); ?>_graphics/friendspicker.png") no-repeat -60px -44px; +} +.friendspicker-savebuttons .elgg-button-submit, +.friendspicker-savebuttons .elgg-button-cancel { + margin:5px 20px 5px 5px; +} +.friendspicker-members-table { + background: #dedede; + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + + margin:10px 0 0; + padding:10px 10px 0; +} + +/* *************************************** + AUTOCOMPLETE +*************************************** */ +<?php //autocomplete will expand to fullscreen without max-width ?> +.ui-autocomplete { + position: absolute; + cursor: default; +} +.elgg-autocomplete-item .elgg-body { + max-width: 600px; +} +.ui-autocomplete { + background-color: white; + border: 1px solid #ccc; + overflow: hidden; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.ui-autocomplete .ui-menu-item { + padding: 0px 4px; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.ui-autocomplete .ui-menu-item:hover { + background-color: #eee; +} +.ui-autocomplete a:hover { + text-decoration: none; + color: #4690D6; +} +.ui-autocomplete a.ui-state-hover { + background-color: #eee; + display: block; +} + +/* *************************************** + USER PICKER +*************************************** */ +.elgg-user-picker-list li:first-child { + border-top: 1px dotted #ccc; + margin-top: 5px; +} +.elgg-user-picker-list > li { + border-bottom: 1px dotted #ccc; +} + +/* *************************************** + DATE PICKER +**************************************** */ +.ui-datepicker { + display: none; + + margin-top: 3px; + width: 208px; + background-color: white; + border: 1px solid #0054A7; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + overflow: hidden; + + -webkit-box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5); + -moz-box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5); + box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5); +} +.ui-datepicker-inline { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +.ui-datepicker-header { + position: relative; + background: #4690D6; + color: white; + padding: 2px 0; + border-bottom: 1px solid #0054A7; +} +.ui-datepicker-header a { + color: white; +} +.ui-datepicker-prev, .ui-datepicker-next { + position: absolute; + top: 5px; + cursor: pointer; +} +.ui-datepicker-prev { + left: 6px; +} +.ui-datepicker-next { + right: 6px; +} +.ui-datepicker-title { + line-height: 1.8em; + margin: 0 30px; + text-align: center; + font-weight: bold; +} +.ui-datepicker-calendar { + margin: 4px; +} +.ui-datepicker th { + color: #0054A7; + border: none; + font-weight: bold; + padding: 5px 6px; + text-align: center; +} +.ui-datepicker td { + padding: 1px; +} +.ui-datepicker td span, .ui-datepicker td a { + display: block; + padding: 2px; + line-height: 1.2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker-calendar .ui-state-default { + border: 1px solid #ccc; + color: #4690D6;; + background: #fafafa; +} +.ui-datepicker-calendar .ui-state-hover { + border: 1px solid #aaa; + color: #0054A7; + background: #eee; +} +.ui-datepicker-calendar .ui-state-active, +.ui-datepicker-calendar .ui-state-active.ui-state-hover { + font-weight: bold; + border: 1px solid #0054A7; + color: #0054A7; + background: #E4ECF5; +} diff --git a/views/default/css/components/grid.php b/views/default/css/elements/grid.php index 522f9fbc0..fdbaf4aca 100644 --- a/views/default/css/components/grid.php +++ b/views/default/css/elements/grid.php @@ -4,13 +4,15 @@ * * @package Elgg.Core * @subpackage UI + * + * To work around subpixel rounding discrepancies, apply .elgg-col-last to + * the last column (@todo we need broswer-specific test cases for this). */ ?> + /* *************************************** GRID *************************************** */ -.elgg-grid { -} .elgg-col { float: left; } diff --git a/views/default/css/elements/helpers.php b/views/default/css/elements/helpers.php new file mode 100644 index 000000000..e9a9e0a30 --- /dev/null +++ b/views/default/css/elements/helpers.php @@ -0,0 +1,144 @@ +<?php +/** + * Helpers CSS + * + * Contains generic elements that can be used throughout the site. + * + * @package Elgg.Core + * @subpackage UI + */ +?> + +.clearfloat { + clear: both; +} + +.hidden { + display: none; +} + +.centered { + margin: 0 auto; +} + +.center { + text-align: center; +} + +.float { + float: left; +} + +.float-alt { + float: right; +} + +.link { + cursor: pointer; +} + +.elgg-discover .elgg-discoverable { + display: none; +} + +.elgg-discover:hover .elgg-discoverable { + display: block; +} + +.elgg-transition:hover { + opacity: .7; +} + +/* *************************************** + BORDERS AND SEPARATORS +*************************************** */ +.elgg-border-plain { + border: 1px solid #eeeeee; +} +.elgg-border-transition { + border: 1px solid #eeeeee; +} +.elgg-divide-top { + border-top: 1px solid #CCCCCC; +} +.elgg-divide-bottom { + border-bottom: 1px solid #CCCCCC; +} +.elgg-divide-left { + border-left: 1px solid #CCCCCC; +} +.elgg-divide-right { + border-right: 1px solid #CCCCCC; +} + +/* *************************************** + Spacing (from OOCSS) +*************************************** */ +<?php +/** + * Spacing classes + * Should be used to modify the default spacing between objects (not between nodes of the same object) + * Please use judiciously. You want to be using defaults most of the time, these are exceptions! + * <type><location><size> + * <type>: m = margin, p = padding + * <location>: a = all, t = top, r = right, b = bottom, l = left, h = horizontal, v = vertical + * <size>: n = none, s = small, m = medium, l = large + */ + +$none = '0'; +$small = '5px'; +$medium = '10px'; +$large = '20px'; + +echo <<<CSS +/* Padding */ +.pan{padding:$none} +.prn, .phn{padding-right:$none} +.pln, .phn{padding-left:$none} +.ptn, .pvn{padding-top:$none} +.pbn, .pvn{padding-bottom:$none} + +.pas{padding:$small} +.prs, .phs{padding-right:$small} +.pls, .phs{padding-left:$small} +.pts, .pvs{padding-top:$small} +.pbs, .pvs{padding-bottom:$small} + +.pam{padding:$medium} +.prm, .phm{padding-right:$medium} +.plm, .phm{padding-left:$medium} +.ptm, .pvm{padding-top:$medium} +.pbm, .pvm{padding-bottom:$medium} + +.pal{padding:$large} +.prl, .phl{padding-right:$large} +.pll, .phl{padding-left:$large} +.ptl, .pvl{padding-top:$large} +.pbl, .pvl{padding-bottom:$large} + +/* Margin */ +.man{margin:$none} +.mrn, .mhn{margin-right:$none} +.mln, .mhn{margin-left:$none} +.mtn, .mvn{margin-top:$none} +.mbn, .mvn{margin-bottom:$none} + +.mas{margin:$small} +.mrs, .mhs{margin-right:$small} +.mls, .mhs{margin-left:$small} +.mts, .mvs{margin-top:$small} +.mbs, .mvs{margin-bottom:$small} + +.mam{margin:$medium} +.mrm, .mhm{margin-right:$medium} +.mlm, .mhm{margin-left:$medium} +.mtm, .mvm{margin-top:$medium} +.mbm, .mvm{margin-bottom:$medium} + +.mal{margin:$large} +.mrl, .mhl{margin-right:$large} +.mll, .mhl{margin-left:$large} +.mtl, .mvl{margin-top:$large} +.mbl, .mvl{margin-bottom:$large} +CSS; +?>
\ No newline at end of file diff --git a/views/default/css/elements/icons.php b/views/default/css/elements/icons.php new file mode 100644 index 000000000..9b12e0a57 --- /dev/null +++ b/views/default/css/elements/icons.php @@ -0,0 +1,348 @@ +<?php +/** + * Elgg icons + * + * @package Elgg.Core + * @subpackage UI + */ + +?> + +/* *************************************** + ICONS +*************************************** */ + +.elgg-icon { + background: transparent url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat left; + width: 16px; + height: 16px; + margin: 0 2px; +} +.elgg-icon-arrow-left { + background-position: 0 -0px; +} +.elgg-icon-arrow-right { + background-position: 0 -18px; +} +.elgg-icon-arrow-two-head { + background-position: 0 -36px; +} +.elgg-icon-attention:hover { + background-position: 0 -54px; +} +.elgg-icon-attention { + background-position: 0 -72px; +} +.elgg-icon-calendar { + background-position: 0 -90px; +} +.elgg-icon-cell-phone { + background-position: 0 -108px; +} +.elgg-icon-checkmark:hover { + background-position: 0 -126px; +} +.elgg-icon-checkmark { + background-position: 0 -144px; +} +.elgg-icon-clip:hover { + background-position: 0 -162px; +} +.elgg-icon-clip { + background-position: 0 -180px; +} +.elgg-icon-cursor-drag-arrow { + background-position: 0 -198px; +} +.elgg-icon-delete-alt:hover { + background-position: 0 -216px; +} +.elgg-icon-delete-alt { + background-position: 0 -234px; +} +.elgg-icon-delete:hover { + background-position: 0 -252px; +} +.elgg-icon-delete { + background-position: 0 -270px; +} +.elgg-icon-download:hover { + background-position: 0 -288px; +} +.elgg-icon-download { + background-position: 0 -306px; +} +.elgg-icon-eye { + background-position: 0 -324px; +} +.elgg-icon-facebook { + background-position: 0 -342px; +} +.elgg-icon-grid:hover { + background-position: 0 -360px; +} +.elgg-icon-grid { + background-position: 0 -378px; +} +.elgg-icon-home:hover { + background-position: 0 -396px; +} +.elgg-icon-home { + background-position: 0 -414px; +} +.elgg-icon-hover-menu:hover { + background-position: 0 -432px; +} +.elgg-icon-hover-menu { + background-position: 0 -450px; +} +.elgg-icon-info:hover { + background-position: 0 -468px; +} +.elgg-icon-info { + background-position: 0 -486px; +} +.elgg-icon-link:hover { + background-position: 0 -504px; +} +.elgg-icon-link { + background-position: 0 -522px; +} +.elgg-icon-list { + background-position: 0 -540px; +} +.elgg-icon-lock-closed { + background-position: 0 -558px; +} +.elgg-icon-lock-open { + background-position: 0 -576px; +} +.elgg-icon-mail-alt:hover { + background-position: 0 -594px; +} +.elgg-icon-mail-alt { + background-position: 0 -612px; +} +.elgg-icon-mail:hover { + background-position: 0 -630px; +} +.elgg-icon-mail { + background-position: 0 -648px; +} +.elgg-icon-photo { + background-position: 0 -666px; +} +.elgg-icon-print-alt { + background-position: 0 -684px; +} +.elgg-icon-print { + background-position: 0 -702px; +} +.elgg-icon-push-pin-alt { + background-position: 0 -720px; +} +.elgg-icon-push-pin { + background-position: 0 -738px; +} +.elgg-icon-redo { + background-position: 0 -756px; +} +.elgg-icon-refresh:hover { + background-position: 0 -774px; +} +.elgg-icon-refresh { + background-position: 0 -792px; +} +.elgg-icon-round-arrow-left { + background-position: 0 -810px; +} +.elgg-icon-round-arrow-right { + background-position: 0 -828px; +} +.elgg-icon-round-checkmark { + background-position: 0 -846px; +} +.elgg-icon-round-minus { + background-position: 0 -864px; +} +.elgg-icon-round-plus { + background-position: 0 -882px; +} +.elgg-icon-rss { + background-position: 0 -900px; +} +.elgg-icon-search-focus { + background-position: 0 -918px; +} +.elgg-icon-search { + background-position: 0 -936px; +} +.elgg-icon-settings-alt:hover { + background-position: 0 -954px; +} +.elgg-icon-settings-alt { + background-position: 0 -972px; +} +.elgg-icon-settings { + background-position: 0 -990px; +} +.elgg-icon-share:hover { + background-position: 0 -1008px; +} +.elgg-icon-share { + background-position: 0 -1026px; +} +.elgg-icon-shop-cart:hover { + background-position: 0 -1044px; +} +.elgg-icon-shop-cart { + background-position: 0 -1062px; +} +.elgg-icon-speech-bubble-alt:hover { + background-position: 0 -1080px; +} +.elgg-icon-speech-bubble-alt { + background-position: 0 -1098px; +} +.elgg-icon-speech-bubble:hover { + background-position: 0 -1116px; +} +.elgg-icon-speech-bubble { + background-position: 0 -1134px; +} +.elgg-icon-star-alt { + background-position: 0 -1152px; +} +.elgg-icon-star-empty:hover { + background-position: 0 -1170px; +} +.elgg-icon-star-empty { + background-position: 0 -1188px; +} +.elgg-icon-star:hover { + background-position: 0 -1206px; +} +.elgg-icon-star { + background-position: 0 -1224px; +} +.elgg-icon-tag:hover { + background-position: 0 -1242px; +} +.elgg-icon-tag { + background-position: 0 -1260px; +} +.elgg-icon-thumbs-down-alt:hover { + background-position: 0 -1278px; +} +.elgg-icon-thumbs-down:hover, +.elgg-icon-thumbs-down-alt { + background-position: 0 -1296px; +} +.elgg-icon-thumbs-down { + background-position: 0 -1314px; +} +.elgg-icon-thumbs-up-alt:hover { + background-position: 0 -1332px; +} +.elgg-icon-thumbs-up:hover, +.elgg-icon-thumbs-up-alt { + background-position: 0 -1350px; +} +.elgg-icon-thumbs-up { + background-position: 0 -1368px; +} +.elgg-icon-trash { + background-position: 0 -1386px; +} +.elgg-icon-twitter { + background-position: 0 -1404px; +} +.elgg-icon-undo { + background-position: 0 -1422px; +} +.elgg-icon-user:hover { + background-position: 0 -1440px; +} +.elgg-icon-user { + background-position: 0 -1458px; +} +.elgg-icon-users:hover { + background-position: 0 -1476px; +} +.elgg-icon-users { + background-position: 0 -1494px; +} +.elgg-icon-video { + background-position: 0 -1512px; +} + + +.elgg-avatar > .elgg-icon-hover-menu { + display: none; + position: absolute; + right: 0; + bottom: 0; + margin: 0; + cursor: pointer; +} + +.elgg-ajax-loader { + background: white url(<?php echo elgg_get_site_url(); ?>_graphics/ajax_loader_bw.gif) no-repeat center center; + min-height: 31px; + min-width: 31px; +} + +/* *************************************** + AVATAR ICONS +*************************************** */ +.elgg-avatar { + position: relative; + display: inline-block; +} +.elgg-avatar > a > img { + display: block; +} +.elgg-avatar-tiny > a > img { + width: 25px; + height: 25px; + + /* remove the border-radius if you don't want rounded avatars in supported browsers */ + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + + -moz-background-clip: border; + background-clip: border; + + -webkit-background-size: 25px; + -khtml-background-size: 25px; + -moz-background-size: 25px; + -o-background-size: 25px; + background-size: 25px; +} +.elgg-avatar-small > a > img { + width: 40px; + height: 40px; + + /* remove the border-radius if you don't want rounded avatars in supported browsers */ + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + + -moz-background-clip: border; + background-clip: border; + + -webkit-background-size: 40px; + -khtml-background-size: 40px; + -moz-background-size: 40px; + -o-background-size: 40px; + background-size: 40px; +} +.elgg-avatar-medium > a > img { + width: 100px; + height: 100px; +} +.elgg-avatar-large > a > img { + width: 200px; + height: 200px; +} diff --git a/views/default/css/elements/layout.php b/views/default/css/elements/layout.php new file mode 100644 index 000000000..9d92752b4 --- /dev/null +++ b/views/default/css/elements/layout.php @@ -0,0 +1,121 @@ +<?php +/** + * Page Layout + * + * Contains CSS for the page shell and page layout + * + * Default layout: 990px wide, centered. Used in default page shell + * + * @package Elgg.Core + * @subpackage UI + */ +?> + +/* *************************************** + PAGE LAYOUT +*************************************** */ +/***** DEFAULT LAYOUT ******/ +<?php // the width is on the page rather than topbar to handle small viewports ?> +.elgg-page-default { + min-width: 998px; +} +.elgg-page-default .elgg-page-header > .elgg-inner { + width: 990px; + margin: 0 auto; + height: 90px; +} +.elgg-page-default .elgg-page-body > .elgg-inner { + width: 990px; + margin: 0 auto; +} +.elgg-page-default .elgg-page-footer > .elgg-inner { + width: 990px; + margin: 0 auto; + padding: 5px 0; + border-top: 1px solid #DEDEDE; +} + +/***** TOPBAR ******/ +.elgg-page-topbar { + background: #333333 url(<?php echo elgg_get_site_url(); ?>_graphics/toptoolbar_background.gif) repeat-x top left; + border-bottom: 1px solid #000000; + position: relative; + height: 24px; + z-index: 9000; +} +.elgg-page-topbar > .elgg-inner { + padding: 0 10px; +} + +/***** PAGE MESSAGES ******/ +.elgg-system-messages { + position: fixed; + top: 24px; + right: 20px; + max-width: 500px; + z-index: 2000; +} +.elgg-system-messages li { + margin-top: 10px; +} +.elgg-system-messages li p { + margin: 0; +} + +/***** PAGE HEADER ******/ +.elgg-page-header { + position: relative; + background: #4690D6 url(<?php echo elgg_get_site_url(); ?>_graphics/header_shadow.png) repeat-x bottom left; +} +.elgg-page-header > .elgg-inner { + position: relative; +} + +/***** PAGE BODY LAYOUT ******/ +.elgg-layout { + min-height: 360px; +} +.elgg-layout-one-sidebar { + background: transparent url(<?php echo elgg_get_site_url(); ?>_graphics/sidebar_background.gif) repeat-y right top; +} +.elgg-layout-two-sidebar { + background: transparent url(<?php echo elgg_get_site_url(); ?>_graphics/two_sidebar_background.gif) repeat-y right top; +} +.elgg-layout-error { + margin-top: 20px; +} +.elgg-sidebar { + position: relative; + padding: 20px 10px; + float: right; + width: 210px; + margin: 0 0 0 10px; +} +.elgg-sidebar-alt { + position: relative; + padding: 20px 10px; + float: left; + width: 160px; + margin: 0 10px 0 0; +} +.elgg-main { + position: relative; + min-height: 360px; + padding: 10px; +} +.elgg-main > .elgg-head { + padding-bottom: 3px; + border-bottom: 1px solid #CCCCCC; + margin-bottom: 10px; +} + +/***** PAGE FOOTER ******/ +.elgg-page-footer { + position: relative; +} +.elgg-page-footer { + color: #999; +} +.elgg-page-footer a:hover { + color: #666; +} diff --git a/views/default/css/elements/misc.php b/views/default/css/elements/misc.php new file mode 100644 index 000000000..d9622d34a --- /dev/null +++ b/views/default/css/elements/misc.php @@ -0,0 +1,62 @@ +/* *************************************** + MISC +*************************************** */ +#login-dropdown { + position: absolute; + top:10px; + right:0; + z-index: 100; +} + +/* *************************************** + AVATAR UPLOADING & CROPPING +*************************************** */ + +#current-user-avatar { + border-right:1px solid #ccc; +} +#avatar-croppingtool { + border-top: 1px solid #ccc; +} +#user-avatar-cropper { + float: left; +} +#user-avatar-preview { + float: left; + position: relative; + overflow: hidden; + width: 100px; + height: 100px; +} + +/* *************************************** + FRIENDS COLLECTIONS +*************************************** */ + +#friends_collections_accordian li { + color: #666; +} +#friends_collections_accordian li h2 { + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + + background: none repeat scroll 0 0 #4690D6; + color: white; + cursor: pointer; + font-size: 1.2em; + margin: 10px 0; + padding: 4px 2px 4px 6px; +} +#friends_collections_accordian li h2:hover { + background-color: #333; +} +#friends_collections_accordian .friends_collections_controls { + float: right; + font-size: 70%; +} +#friends_collections_accordian .friends-picker-main-wrapper { + background: none repeat scroll 0 0 white; + display: none; + padding: 0; +} diff --git a/views/default/css/elements/modules.php b/views/default/css/elements/modules.php new file mode 100644 index 000000000..a37ae094b --- /dev/null +++ b/views/default/css/elements/modules.php @@ -0,0 +1,194 @@ +/* *************************************** + Modules +*************************************** */ +.elgg-module { + overflow: hidden; + margin-bottom: 20px; +} + +/* Aside */ +.elgg-module-aside .elgg-head { + border-bottom: 1px solid #CCC; + + margin-bottom: 5px; + padding-bottom: 5px; +} + +/* Info */ +.elgg-module-info > .elgg-head { + background: #e4e4e4; + padding: 5px; + margin-bottom: 10px; + + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.elgg-module-info > .elgg-head * { + color: #333; +} + +/* Popup */ +.elgg-module-popup { + background-color: white; + border: 1px solid #ccc; + + z-index: 9999; + margin-bottom: 0; + padding: 5px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + + -webkit-box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5); + -moz-box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5); + box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5); +} +.elgg-module-popup > .elgg-head { + margin-bottom: 5px; +} +.elgg-module-popup > .elgg-head * { + color: #0054A7; +} + +/* Dropdown */ +.elgg-module-dropdown { + background-color:white; + border:5px solid #CCC; + + -webkit-border-radius: 5px 0 5px 5px; + -moz-border-radius: 5px 0 5px 5px; + border-radius: 5px 0 5px 5px; + + display:none; + + width: 210px; + padding: 12px; + margin-right: 0px; + z-index:100; + + -webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.45); + -moz-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.45); + box-shadow: 0 3px 3px rgba(0, 0, 0, 0.45); + + position:absolute; + right: 0px; + top: 100%; +} + +/* Featured */ +.elgg-module-featured { + border: 1px solid #4690D6; + + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.elgg-module-featured > .elgg-head { + padding: 5px; + background-color: #4690D6; +} +.elgg-module-featured > .elgg-head * { + color: white; +} +.elgg-module-featured > .elgg-body { + padding: 10px; +} + +/* *************************************** + Widgets +*************************************** */ +.elgg-widgets { + float: right; + min-height: 30px; +} +.elgg-widget-add-control { + text-align: right; + margin: 5px 5px 15px; +} +.elgg-widgets-add-panel { + padding: 10px; + margin: 0 5px 15px; + background: #dedede; + border: 2px solid #ccc; +} +<?php //@todo location-dependent style: make an extension of elgg-gallery ?> +.elgg-widgets-add-panel li { + float: left; + margin: 2px 10px; + width: 200px; + padding: 4px; + background-color: #ccc; + border: 2px solid #b0b0b0; + font-weight: bold; +} +.elgg-widgets-add-panel li a { + display: block; +} +.elgg-widgets-add-panel .elgg-state-available { + color: #333; + cursor: pointer; +} +.elgg-widgets-add-panel .elgg-state-available:hover { + background-color: #bcbcbc; +} +.elgg-widgets-add-panel .elgg-state-unavailable { + color: #888; +} + +.elgg-module-widget { + background-color: #dedede; + padding: 2px; + margin: 0 5px 15px; + position: relative; +} +.elgg-module-widget:hover { + background-color: #ccc; +} +.elgg-module-widget > .elgg-head { + background-color: #eeeeee; + height: 26px; + overflow: hidden; +} +.elgg-module-widget > .elgg-head h3 { + float: left; + padding: 4px 45px 0 20px; + color: #666; +} +.elgg-module-widget.elgg-state-draggable .elgg-widget-handle { + cursor: move; +} +a.elgg-widget-collapse-button { + color: #c5c5c5; +} +a.elgg-widget-collapse-button:hover, +a.elgg-widget-collapsed:hover { + color: #9d9d9d; + text-decoration: none; +} +a.elgg-widget-collapse-button:before { + content: "\25BC"; +} +a.elgg-widget-collapsed:before { + content: "\25BA"; +} +.elgg-module-widget > .elgg-body { + background-color: white; + width: 100%; + overflow: hidden; + border-top: 2px solid #dedede; +} +.elgg-widget-edit { + display: none; + width: 96%; + padding: 2%; + border-bottom: 2px solid #dedede; + background-color: #f9f9f9; +} +.elgg-widget-content { + padding: 10px; +} +.elgg-widget-placeholder { + border: 2px dashed #dedede; + margin-bottom: 15px; +} diff --git a/views/default/css/elements/navigation.php b/views/default/css/elements/navigation.php new file mode 100644 index 000000000..6b29e4c19 --- /dev/null +++ b/views/default/css/elements/navigation.php @@ -0,0 +1,560 @@ +<?php +/** + * Navigation + * + * @package Elgg.Core + * @subpackage UI + */ +?> + +/* *************************************** + PAGINATION +*************************************** */ +.elgg-pagination { + margin: 10px 0; + display: block; + text-align: center; +} +.elgg-pagination li { + display: inline-block; + margin: 0 6px 0 0; + text-align: center; +} +.elgg-pagination a, .elgg-pagination span { + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + + display: block; + padding: 2px 6px; + color: #4690d6; + border: 1px solid #4690d6; + font-size: 12px; +} +.elgg-pagination a:hover { + background: #4690d6; + color: white; + text-decoration: none; +} +.elgg-pagination .elgg-state-disabled span { + color: #CCCCCC; + border-color: #CCCCCC; +} +.elgg-pagination .elgg-state-selected span { + color: #555555; + border-color: #555555; +} + +/* *************************************** + TABS +*************************************** */ +.elgg-tabs { + margin-bottom: 5px; + border-bottom: 2px solid #cccccc; + display: table; + width: 100%; +} +.elgg-tabs li { + float: left; + border: 2px solid #ccc; + border-bottom: 0; + background: #eee; + margin: 0 0 0 10px; + + -webkit-border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + border-radius: 5px 5px 0 0; +} +.elgg-tabs a { + text-decoration: none; + display: block; + padding: 3px 10px 0 10px; + text-align: center; + height: 21px; + color: #999; +} +.elgg-tabs a:hover { + background: #dedede; + color: #4690D6; +} +.elgg-tabs .elgg-state-selected { + border-color: #ccc; + background: white; +} +.elgg-tabs .elgg-state-selected a { + position: relative; + top: 2px; + background: white; +} + +/* *************************************** + BREADCRUMBS +*************************************** */ +.elgg-breadcrumbs { + font-size: 80%; + font-weight: bold; + line-height: 1.2em; + color: #bababa; +} +.elgg-breadcrumbs > li { + display: inline-block; +} +.elgg-breadcrumbs > li:after { + content: "\003E"; + padding: 0 4px; + font-weight: normal; +} +.elgg-breadcrumbs > li > a { + display: inline-block; + color: #999; +} +.elgg-breadcrumbs > li > a:hover { + color: #0054a7; + text-decoration: underline; +} + +.elgg-main .elgg-breadcrumbs { + position: relative; + top: -6px; + left: 0; +} + +/* *************************************** + TOPBAR MENU +*************************************** */ +.elgg-menu-topbar { + float: left; +} + +.elgg-menu-topbar > li { + float: left; +} + +.elgg-menu-topbar > li > a { + padding-top: 2px; + color: #eee; + margin: 1px 15px 0; +} + +.elgg-menu-topbar > li > a:hover { + color: #4690D6; + text-decoration: none; +} + +.elgg-menu-topbar-alt { + float: right; +} + +.elgg-menu-topbar .elgg-icon { + vertical-align: middle; + margin-top: -1px; +} + +.elgg-menu-topbar > li > a.elgg-topbar-logo { + margin-top: 0; + padding-left: 5px; + width: 38px; + height: 20px; +} + +.elgg-menu-topbar > li > a.elgg-topbar-avatar { + width: 18px; + height: 18px; +} + +/* *************************************** + SITE MENU +*************************************** */ +.elgg-menu-site { + z-index: 1; +} + +.elgg-menu-site > li > a { + font-weight: bold; + padding: 3px 13px 0px 13px; + height: 20px; +} + +.elgg-menu-site > li > a:hover { + text-decoration: none; +} + +.elgg-menu-site-default { + position: absolute; + bottom: 0; + left: 0; + height: 23px; +} + +.elgg-menu-site-default > li { + float: left; + margin-right: 1px; +} + +.elgg-menu-site-default > li > a { + color: white; +} + +.elgg-menu-site > li > ul { + display: none; + background-color: white; +} + +.elgg-menu-site > li:hover > ul { + display: block; +} + +.elgg-menu-site-default > .elgg-state-selected > a, +.elgg-menu-site-default > li:hover > a { + background: white; + color: #555; + + -webkit-box-shadow: 2px -1px 1px rgba(0, 0, 0, 0.25); + -moz-box-shadow: 2px -1px 1px rgba(0, 0, 0, 0.25); + box-shadow: 2px -1px 1px rgba(0, 0, 0, 0.25); + + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} + +.elgg-menu-site-more { + position: relative; + left: -1px; + width: 100%; + min-width: 150px; + border: 1px solid #999; + border-top: 0; + + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; + + -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.25); + -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.25); + box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.25); +} + +.elgg-menu-site-more > li > a { + background-color: white; + color: #555; + + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +.elgg-menu-site-more > li > a:hover { + background: #4690D6; + color: white; +} + +.elgg-menu-site-more > li:last-child > a, +.elgg-menu-site-more > li:last-child > a:hover { + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} + +.elgg-more > a:before { + content: "\25BC"; + font-size: smaller; + margin-right: 4px; +} + +/* *************************************** + TITLE +*************************************** */ +.elgg-menu-title { + float: right; +} + +.elgg-menu-title > li { + display: inline-block; + margin-left: 4px; +} + +/* *************************************** + FILTER MENU +*************************************** */ +.elgg-menu-filter { + margin-bottom: 5px; + border-bottom: 2px solid #ccc; + display: table; + width: 100%; +} +.elgg-menu-filter > li { + float: left; + border: 2px solid #ccc; + border-bottom: 0; + background: #eee; + margin: 0 0 0 10px; + + -webkit-border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + border-radius: 5px 5px 0 0; +} +.elgg-menu-filter > li:hover { + background: #dedede; +} +.elgg-menu-filter > li > a { + text-decoration: none; + display: block; + padding: 3px 10px 0; + text-align: center; + height: 21px; + color: #999; +} +.elgg-menu-filter > li > a:hover { + background: #dedede; + color: #4690D6; +} +.elgg-menu-filter > .elgg-state-selected { + border-color: #ccc; + background: white; +} +.elgg-menu-filter > .elgg-state-selected > a { + position: relative; + top: 2px; + background: white; +} + +/* *************************************** + PAGE MENU +*************************************** */ +.elgg-menu-page { + margin-bottom: 15px; +} + +.elgg-menu-page a { + display: block; + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + + background-color: white; + margin: 0 0 3px; + padding: 2px 4px 2px 8px; +} +.elgg-menu-page a:hover { + background-color: #0054A7; + color: white; + text-decoration: none; +} +.elgg-menu-page li.elgg-state-selected > a { + background-color: #4690D6; + color: white; +} +.elgg-menu-page .elgg-child-menu { + display: none; + margin-left: 15px; +} +.elgg-menu-page .elgg-menu-closed:before, .elgg-menu-opened:before { + display: inline-block; + padding-right: 4px; +} +.elgg-menu-page .elgg-menu-closed:before { + content: "\002B"; +} +.elgg-menu-page .elgg-menu-opened:before { + content: "\002D"; +} + +/* *************************************** + HOVER MENU +*************************************** */ +.elgg-menu-hover { + display: none; + position: absolute; + z-index: 10000; + + overflow: hidden; + + min-width: 165px; + max-width: 250px; + border: solid 1px; + border-color: #E5E5E5 #999 #999 #E5E5E5; + background-color: #FFF; + + -webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.50); + -moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.50); + box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.50); +} +.elgg-menu-hover > li { + border-bottom: 1px solid #ddd; +} +.elgg-menu-hover > li:last-child { + border-bottom: none; +} +.elgg-menu-hover .elgg-heading-basic { + display: block; +} +.elgg-menu-hover a { + padding: 2px 8px; + font-size: 92%; +} +.elgg-menu-hover a:hover { + background: #ccc; + text-decoration: none; +} +.elgg-menu-hover-admin a { + color: red; +} +.elgg-menu-hover-admin a:hover { + color: white; + background-color: red; +} + +/* *************************************** + SITE FOOTER +*************************************** */ +.elgg-menu-footer > li, +.elgg-menu-footer > li > a { + display: inline-block; + color: #999; +} + +.elgg-menu-footer > li:after { + content: "\007C"; + padding: 0 4px; +} + +.elgg-menu-footer-default { + float: right; +} + +.elgg-menu-footer-alt { + float: left; +} + +/* *************************************** + GENERAL MENU +*************************************** */ +.elgg-menu-general > li, +.elgg-menu-general > li > a { + display: inline-block; + color: #999; +} + +.elgg-menu-general > li:after { + content: "\007C"; + padding: 0 4px; +} + +/* *************************************** + ENTITY AND ANNOTATION +*************************************** */ +<?php // height depends on line height/font size ?> +.elgg-menu-entity, .elgg-menu-annotation { + float: right; + margin-left: 15px; + font-size: 90%; + color: #aaa; + line-height: 16px; + height: 16px; +} +.elgg-menu-entity > li, .elgg-menu-annotation > li { + margin-left: 15px; +} +.elgg-menu-entity > li > a, .elgg-menu-annotation > li > a { + color: #aaa; +} +<?php // need to override .elgg-menu-hz ?> +.elgg-menu-entity > li > a, .elgg-menu-annotation > li > a { + display: block; +} +.elgg-menu-entity > li > span, .elgg-menu-annotation > li > span { + vertical-align: baseline; +} + +/* *************************************** + OWNER BLOCK +*************************************** */ +.elgg-menu-owner-block li a { + display: block; + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + + background-color: white; + margin: 3px 0 5px 0; + padding: 2px 4px 2px 8px; +} +.elgg-menu-owner-block li a:hover { + background-color: #0054A7; + color: white; + text-decoration: none; +} +.elgg-menu-owner-block li.elgg-state-selected > a { + background-color: #4690D6; + color: white; +} + +/* *************************************** + LONGTEXT +*************************************** */ +.elgg-menu-longtext { + float: right; +} + +/* *************************************** + RIVER +*************************************** */ +.elgg-menu-river { + float: right; + margin-left: 15px; + font-size: 90%; + color: #aaa; + line-height: 16px; + height: 16px; +} +.elgg-menu-river > li { + display: inline-block; + margin-left: 5px; +} +.elgg-menu-river > li > a { + color: #aaa; + height: 16px; +} +<?php // need to override .elgg-menu-hz ?> +.elgg-menu-river > li > a { + display: block; +} +.elgg-menu-river > li > span { + vertical-align: baseline; +} + +/* *************************************** + SIDEBAR EXTRAS (rss, bookmark, etc) +*************************************** */ +.elgg-menu-extras { + margin-bottom: 15px; +} + +/* *************************************** + WIDGET MENU +*************************************** */ +.elgg-menu-widget > li { + position: absolute; + top: 4px; + display: inline-block; + width: 18px; + height: 18px; + padding: 2px 2px 0 0; +} + +.elgg-menu-widget > .elgg-menu-item-collapse { + left: 5px; +} +.elgg-menu-widget > .elgg-menu-item-delete { + right: 5px; +} +.elgg-menu-widget > .elgg-menu-item-settings { + right: 25px; +} diff --git a/views/default/css/components/reset.php b/views/default/css/elements/reset.php index 13f750de8..44bf2fac9 100644 --- a/views/default/css/components/reset.php +++ b/views/default/css/elements/reset.php @@ -6,6 +6,7 @@ * @subpackage UI */ ?> + /* *************************************** RESET CSS *************************************** */ @@ -27,13 +28,20 @@ table, caption, tbody, tfoot, thead, tr, th, td { font-family: inherit; vertical-align: baseline; } +body { + background-color: white; +} +<?php // force vertical scroll bar ?> +html, body { + height: 100%; + margin-bottom: 1px; +} img { border-width:0; border-color:transparent; } :focus { - outline:0 none; - -moz-outline-style: none; + outline: 0 none; } ol, ul { list-style: none; @@ -47,7 +55,7 @@ ins { del { text-decoration:line-through; } -strong { +strong, b { font-weight:bold; } table { @@ -66,3 +74,6 @@ q:before, q:after { blockquote, q { quotes: "" ""; } +a { + text-decoration: none; +} diff --git a/views/default/css/elements/typography.php b/views/default/css/elements/typography.php new file mode 100644 index 000000000..c044cb1cc --- /dev/null +++ b/views/default/css/elements/typography.php @@ -0,0 +1,162 @@ +<?php +/** + * CSS typography + * + * @package Elgg.Core + * @subpackage UI + */ +?> + +/* *************************************** + Typography +*************************************** */ +body { + font-size: 80%; + line-height: 1.4em; + font-family: "Lucida Grande", Arial, Tahoma, Verdana, sans-serif; +} + +a { + color: #4690D6; +} + +a:hover, +a.selected { <?php //@todo remove .selected ?> + color: #555555; + text-decoration: underline; +} + +p { + margin-bottom: 15px; +} + +p:last-child { + margin-bottom: 0; +} + +pre, code { + font-family: Monaco, "Courier New", Courier, monospace; + font-size: 12px; + + background:#EBF5FF; + color:#000000; + overflow:auto; + + overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */ + + white-space: pre-wrap; + word-wrap: break-word; /* IE 5.5-7 */ + +} + +pre { + padding:3px 15px; + margin:0px 0 15px 0; + line-height:1.3em; +} + +code { + padding:2px 3px; +} + +.elgg-monospace { + font-family: Monaco, "Courier New", Courier, monospace; +} + +blockquote { + line-height: 1.3em; + padding:3px 15px; + margin:0px 0 15px 0; + background:#EBF5FF; + border:none; + + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +h1, h2, h3, h4, h5, h6 { + font-weight: bold; + color: #0054A7; +} + +h1 { font-size: 1.8em; } +h2 { font-size: 1.5em; line-height: 1.1em; padding-bottom:5px} +h3 { font-size: 1.2em; } +h4 { font-size: 1.0em; } +h5 { font-size: 0.9em; } +h6 { font-size: 0.8em; } + +.elgg-heading-site, .elgg-heading-site:hover { + font-size: 2em; + line-height: 1.4em; + color: white; + font-style: italic; + font-family: Georgia, times, serif; + text-shadow: 1px 2px 4px #333333; + text-decoration: none; +} + +.elgg-heading-main { + float: left; + max-width: 530px; + margin-right: 10px; +} +.elgg-heading-basic { + color: #0054A7; + font-size: 1.2em; + font-weight: bold; +} + +.elgg-subtext { + color: #666666; + font-size: 85%; + line-height: 1.2em; + font-style: italic; +} + +.elgg-text-help { + display: block; + font-size: 85%; + font-style: italic; +} + +.elgg-quiet { + color: #666; +} + +.elgg-loud { + color: #0054A7; +} + +/* *************************************** + USER INPUT DISPLAY RESET +*************************************** */ +.elgg-output { + margin-top: 10px; +} + +.elgg-output dt { font-weight: bold } +.elgg-output dd { margin: 0 0 1em 1em } + +.elgg-output ul, .elgg-output ol { + margin: 0 1.5em 1.5em 0; + padding-left: 1.5em; +} +.elgg-output ul { + list-style-type: disc; +} +.elgg-output ol { + list-style-type: decimal; +} +.elgg-output table { + border: 1px solid #ccc; +} +.elgg-output table td { + border: 1px solid #ccc; + padding: 3px 5px; +} +.elgg-output img { + max-width: 100%; + height: auto; +} diff --git a/views/default/css/elgg.php b/views/default/css/elgg.php new file mode 100644 index 000000000..4960e6ade --- /dev/null +++ b/views/default/css/elgg.php @@ -0,0 +1,68 @@ +<?php +/** + * Elgg primary CSS view + * + * @package Elgg.Core + * @subpackage UI + */ + +/* + * Colors: + * #4690D6 - elgg light blue + * #0054A7 - elgg dark blue + * #e4ecf5 - elgg very light blue + */ + +// check if there is a theme overriding the old css view and use it, if it exists +$old_css_view = elgg_get_view_location('css'); +if ($old_css_view != elgg_get_config('viewpath')) { + echo elgg_view('css', $vars); + return true; +} + + +/******************************************************************************* + +Base CSS + * CSS reset + * core + * helpers (moved to end to have a higher priority) + * grid + +*******************************************************************************/ +echo elgg_view('css/elements/reset', $vars); +echo elgg_view('css/elements/core', $vars); +echo elgg_view('css/elements/grid', $vars); + + +/******************************************************************************* + +Skin CSS + * typography - fonts, line spacing + * forms - forms, inputs + * buttons - action, cancel, delete, submit, dropdown, special + * navigation - menus, breadcrumbs, pagination + * icons - icons, sprites, graphics + * modules - modules, widgets + * layout_objects - lists, content blocks, notifications, avatars + * layout - page layout + * misc - to be removed/redone + +*******************************************************************************/ +echo elgg_view('css/elements/typography', $vars); +echo elgg_view('css/elements/forms', $vars); +echo elgg_view('css/elements/buttons', $vars); +echo elgg_view('css/elements/icons', $vars); +echo elgg_view('css/elements/navigation', $vars); +echo elgg_view('css/elements/modules', $vars); +echo elgg_view('css/elements/components', $vars); +echo elgg_view('css/elements/layout', $vars); +echo elgg_view('css/elements/misc', $vars); + + +// included last to have higher priority +echo elgg_view('css/elements/helpers', $vars); + + +// in case plugins are still extending the old 'css' view, display it +echo elgg_view('css', $vars); diff --git a/views/default/css/ie.php b/views/default/css/ie.php index 94407fdc8..34ececa89 100644 --- a/views/default/css/ie.php +++ b/views/default/css/ie.php @@ -1,78 +1,16 @@ /** - * elgg_layout css for Internet Explorer > ie6 - * @uses $vars['wwwroot'] The site URL -*/ -* {zoom: 1;} /* trigger hasLayout in IE */ + * CSS for IE8 and above + */ -/* tools drop-down menu */ -#elgg-header {z-index:1;} -.navigation li a:hover ul {display:block; position:absolute; top:21px; left:0;} -.navigation li a:hover ul li a {display:block;} -.navigation li.navigation-more ul li a {width:150px;background-color: #dedede;} - -.clearfix { display: block; } -.hidden.clearfix { display: none; } -#elgg-page-contents {overflow: hidden;} /* remove horizontal scroll on riverdash */ -#breadcrumbs {top:-2px; margin-bottom: 5px;} - -/* entity list views */ -.entity-metadata {max-width: 300px;} -.entity-edit {float:right;} -.access_level {float:left;} -.entity-listing .entity-metadata { - min-width:400px; - text-align: right; +/* ie8 does not like shrink wrapping this div with inline-block */ +.elgg-avatar { + display: block; } -.likes-list {display:none;} -.likes-list-holder .likes-list {top:20px !important;} /* position likes list below link in IE to prevent clipping */ -.elgg-likes-user .entity-metadata .delete-button {float:none;} - -/* profile */ -.elgg-horizontal-tabbed-nav.profile .profile_name {margin-left: -260px;} -#profile_content .river_comment_form.hidden .input-text { width:510px; } - -/* notifications */ -.friends-picker-navigation {margin:0;padding:0;} -.friends-picker-container h3 {margin:0;padding:0;line-height: 1em;} - -/* private messages */ -#elgg-topbar-contents a.privatemessages.new span { - display:block; - padding:1px; - position:relative; - text-align:center; - float:left; - top:-1px; - right:auto; -} -#elgg-topbar-contents a.privatemessages.new {padding:0 0 0 20px;} -#elgg-topbar-contents a.privatemessages:hover {background-position:left 2px;} -#elgg-topbar-contents a.privatemessages.new:hover {background-position: left 2px;} - -/* riverdashboard mod rules */ -#riverdashboard_updates {clear:both;} -#riverdashboard_updates a.update_link {margin:0 0 9px 0;} -.riverdashboard_filtermenu {margin:10px 0 0 0;} -.river_comment_form.hidden .input-text { - width:530px; - float:left; -} -.river_link_divider { - width:10px; - text-align: center; -} - -/* shared access */ -.shared_access_collection h2.shared_access_name {margin-top:-15px;} - -/* dropdown login */ -*:first-child+html #login-dropdown #signin-button { - line-height:10px; +/* ie8 adds space to the top of .elgg-gallery which causes jumpiness if this is display: block; */ +.elgg-gallery .elgg-avatar > a > img { + display: inline-block; } -*:first-child+html #login-dropdown #signin-button a.signin span { - background-position:-150px -54px; +.elgg-gallery .elgg-avatar > .elgg-icon-hover-menu { + bottom: 4px; } -*:first-child+html #login-dropdown #signin-button a.signin.menu-open span { - background-position:-150px -74px; -}
\ No newline at end of file diff --git a/views/default/css/ie6.php b/views/default/css/ie6.php index d1fdb750c..cf49d33f2 100644 --- a/views/default/css/ie6.php +++ b/views/default/css/ie6.php @@ -1,16 +1,12 @@ /** - * elgg_layout css for Internet Explorer6 - * @uses $vars['wwwroot'] The site URL -*/ + * CSS for IE6 + */ * {zoom: 1;} /* trigger hasLayout in IE */ /* main nav drop-down */ #elgg-header {z-index:1;} -.navigation li a:hover ul {display:block; position:absolute; top:21px; left:0;} -.navigation li a:hover ul li a {display:block;} -.navigation li.navigation-more ul li a {width:150px;background-color: #dedede;} /* @todo check this one */ -.delete-button a { background-position-y: 2px; } -.delete-button a:hover { background-position-y: -14px; }
\ No newline at end of file +.elgg-button-delete a { background-position-y: 2px; } +.elgg-button-delete a:hover { background-position-y: -14px; }
\ No newline at end of file diff --git a/views/default/css/ie7.php b/views/default/css/ie7.php new file mode 100644 index 000000000..90274797d --- /dev/null +++ b/views/default/css/ie7.php @@ -0,0 +1,75 @@ +/** + * CSS for IE7 + */ + +/* trigger hasLayout in IE */ +* { + zoom: 1; +} + +/* site menu drop-down z-index fix for IE7 */ +.elgg-page-header { + z-index: 1; +} + +/* inline-block fixes */ +.elgg-gallery > li, +.elgg-button, +.elgg-icon, +.elgg-menu-hz > li, +.elgg-menu-hz > li:after, +.elgg-menu-hz > li > a, +.elgg-menu-hz > li > span, +.elgg-breadcrumbs > li, +.elgg-menu-footer > li > a, +.elgg-menu-footer li, +.elgg-menu-general > li > a, +.elgg-pagination li, +.elgg-menu-general li { + display: inline; +} + +/* IE7 does not support :after */ +.elgg-breadcrumbs > li > a { + display: inline; + padding-right: 4px; + margin-right: 4px; + border-right: 1px solid #bababa; +} +.elgg-menu-footer li, +.elgg-menu-user li, +.elgg-menu-general li { + padding-left: 4px; + padding-right: 4px; +} + +/* longtext menu would not display horizontally without this */ +.elgg-menu-longtext { + width: 100%; +} +.elgg-menu-longtext li { + width: 100px; + float: right; +} + +.elgg-avatar { + display: inline; +} + +.elgg-body-walledgarden .elgg-col-1of2 { + width: 255px; +} + +.elgg-module-walledgarden > .elgg-head, +.elgg-module-walledgarden > .elgg-foot { + width: 530px; +} + +input, textarea { + width: 98%; +} + +.elgg-tag a { + /* IE7 had a weird wrapping issue for tags */ + word-wrap: normal; +} diff --git a/views/default/css/lightbox.php b/views/default/css/lightbox.php new file mode 100644 index 000000000..7d5917cc3 --- /dev/null +++ b/views/default/css/lightbox.php @@ -0,0 +1,371 @@ +<?php +/** + * Fancybox lightbox CSS. + * + * Used as a view because we need to pass a full URL to AlphaImageLoader. + * + * @package Elgg.Core + * @subpackage UI + */ + +$jquery_path = elgg_get_site_url() . 'vendors/jquery/'; +?> + +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +#fancybox-loading { + position: fixed; + top: 50%; + left: 50%; + width: 40px; + height: 40px; + margin-top: -20px; + margin-left: -20px; + cursor: pointer; + overflow: hidden; + z-index: 1104; + display: none; +} + +#fancybox-loading div { + position: absolute; + top: 0; + left: 0; + width: 40px; + height: 480px; + background-image: url('<?php echo $jquery_path; ?>fancybox/fancybox.png'); +} + +#fancybox-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 1100; + display: none; +} + +#fancybox-tmp { + padding: 0; + margin: 0; + border: 0; + overflow: auto; + display: none; +} + +#fancybox-wrap { + position: absolute; + top: 0; + left: 0; + padding: 20px; + z-index: 1101; + outline: none; + display: none; +} + +#fancybox-outer { + position: relative; + width: 100%; + height: 100%; + background: #fff; +} + +#fancybox-content { + width: 0; + height: 0; + padding: 0; + outline: none; + position: relative; + overflow: hidden; + z-index: 1102; + border: 0px solid #fff; +} + +#fancybox-hide-sel-frame { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: transparent; + z-index: 1101; +} + +#fancybox-close { + position: absolute; + top: -15px; + right: -15px; + width: 30px; + height: 30px; + background: transparent url('<?php echo $jquery_path; ?>fancybox/fancybox.png') -40px 0px; + cursor: pointer; + z-index: 1103; + display: none; +} + +#fancybox-error { + color: #444; + font: normal 12px/20px Arial; + padding: 14px; + margin: 0; +} + +#fancybox-img { + width: 100%; + height: 100%; + padding: 0; + margin: 0; + border: none; + outline: none; + line-height: 0; + vertical-align: top; +} + +#fancybox-frame { + width: 100%; + height: 100%; + border: none; + display: block; +} + +#fancybox-left, #fancybox-right { + position: absolute; + bottom: 0px; + height: 100%; + width: 35%; + cursor: pointer; + outline: none; + background: transparent url('<?php echo $jquery_path; ?>fancybox/blank.gif'); + z-index: 1102; + display: none; +} + +#fancybox-left { + left: 0px; +} + +#fancybox-right { + right: 0px; +} + +#fancybox-left-ico, #fancybox-right-ico { + position: absolute; + top: 50%; + left: -9999px; + width: 30px; + height: 30px; + margin-top: -15px; + cursor: pointer; + z-index: 1102; + display: block; +} + +#fancybox-left-ico { + background-image: url('<?php echo $jquery_path; ?>fancybox/fancybox.png'); + background-position: -40px -30px; +} + +#fancybox-right-ico { + background-image: url('<?php echo $jquery_path; ?>fancybox/fancybox.png'); + background-position: -40px -60px; +} + +#fancybox-left:hover, #fancybox-right:hover { + visibility: visible; /* IE6 */ +} + +#fancybox-left:hover span { + left: 20px; +} + +#fancybox-right:hover span { + left: auto; + right: 20px; +} + +.fancybox-bg { + position: absolute; + padding: 0; + margin: 0; + border: 0; + width: 20px; + height: 20px; + z-index: 1001; +} + +#fancybox-bg-n { + top: -20px; + left: 0; + width: 100%; + background-image: url('<?php echo $jquery_path; ?>fancybox/fancybox-x.png'); +} + +#fancybox-bg-ne { + top: -20px; + right: -20px; + background-image: url('<?php echo $jquery_path; ?>fancybox/fancybox.png'); + background-position: -40px -162px; +} + +#fancybox-bg-e { + top: 0; + right: -20px; + height: 100%; + background-image: url('<?php echo $jquery_path; ?>fancybox/fancybox-y.png'); + background-position: -20px 0px; +} + +#fancybox-bg-se { + bottom: -20px; + right: -20px; + background-image: url('<?php echo $jquery_path; ?>fancybox/fancybox.png'); + background-position: -40px -182px; +} + +#fancybox-bg-s { + bottom: -20px; + left: 0; + width: 100%; + background-image: url('<?php echo $jquery_path; ?>fancybox/fancybox-x.png'); + background-position: 0px -20px; +} + +#fancybox-bg-sw { + bottom: -20px; + left: -20px; + background-image: url('<?php echo $jquery_path; ?>fancybox/fancybox.png'); + background-position: -40px -142px; +} + +#fancybox-bg-w { + top: 0; + left: -20px; + height: 100%; + background-image: url('<?php echo $jquery_path; ?>fancybox/fancybox-y.png'); +} + +#fancybox-bg-nw { + top: -20px; + left: -20px; + background-image: url('<?php echo $jquery_path; ?>fancybox/fancybox.png'); + background-position: -40px -122px; +} + +#fancybox-title { + font-family: Helvetica; + font-size: 12px; + z-index: 1102; +} + +.fancybox-title-inside { + padding-bottom: 10px; + text-align: center; + color: #333; + background: #fff; + position: relative; +} + +.fancybox-title-outside { + padding-top: 10px; + color: #fff; +} + +.fancybox-title-over { + position: absolute; + bottom: 0; + left: 0; + color: #FFF; + text-align: left; +} + +#fancybox-title-over { + padding: 10px; + background-image: url('<?php echo $jquery_path; ?>fancybox/fancy_title_over.png'); + display: block; +} + +.fancybox-title-float { + position: absolute; + left: 0; + bottom: -20px; + height: 32px; +} + +#fancybox-title-float-wrap { + border: none; + border-collapse: collapse; + width: auto; +} + +#fancybox-title-float-wrap td { + border: none; + white-space: nowrap; +} + +#fancybox-title-float-left { + padding: 0 0 0 15px; + background: url('<?php echo $jquery_path; ?>fancybox/fancybox.png') -40px -90px no-repeat; +} + +#fancybox-title-float-main { + color: #FFF; + line-height: 29px; + font-weight: bold; + padding: 0 0 3px 0; + background: url('<?php echo $jquery_path; ?>fancybox/fancybox-x.png') 0px -40px; +} + +#fancybox-title-float-right { + padding: 0 0 0 15px; + background: url('<?php echo $jquery_path; ?>fancybox/fancybox.png') -55px -90px no-repeat; +} + +/* IE6 */ + +.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_close.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_nav_left.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_nav_right.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; } +.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_title_left.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_title_main.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_title_right.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame { + height: expression(this.parentNode.clientHeight + "px"); +} + +#fancybox-loading.fancybox-ie6 { + position: absolute; margin-top: 0; + top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'); +} + +#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_loading.png', sizingMethod='scale'); } + +/* IE6, IE7, IE8 */ +.fancybox-ie .fancybox-bg { background: transparent !important; } + +.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_shadow_n.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_shadow_ne.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_shadow_e.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_shadow_se.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_shadow_s.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_shadow_sw.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_shadow_w.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $jquery_path; ?>fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }
\ No newline at end of file diff --git a/views/default/css/screen.php b/views/default/css/screen.php deleted file mode 100644 index a41736190..000000000 --- a/views/default/css/screen.php +++ /dev/null @@ -1,1603 +0,0 @@ -<?php -/** - * Elgg primary CSS view - * - * @package Elgg.Core - * @subpackage UI - */ - -// check if there is a theme overriding the old css view and use it, if it exists -$old_css_view = elgg_get_view_location('css'); -if ($old_css_view != "{$CONFIG->viewpath}") { - echo elgg_view('css', $vars); - return true; -} - - -echo elgg_view('css/components/reset', $vars); -echo elgg_view('css/components/grid', $vars); -echo elgg_view('css/components/typography', $vars); -echo elgg_view('css/components/spacing', $vars); -echo elgg_view('css/components/heading', $vars); -echo elgg_view('css/components/forms', $vars); - - -?> - -/** - * ELGG DEFAULT CSS - */ - -/* Table of Contents: - - RESET CSS reduce browser inconsistencies in line height, margins, font size... - CSS BASICS <body> <p> <a> <h1> - PAGE LAYOUT main page content blocks: header, sidebar, footer... - GENERIC SELECTORS reusable generic classes - ELGG TOPBAR elgg topbar - HEADER CONTENTS - ELGG SITE NAVIGATION Primary site navigation in header - FOOTER CONTENTS - SYSTEM MESSAGES system messages overlay - BREADCRUMBS - SUBMENU current page/tool submenu in sidebar - PAGINATION re-usable default page navigation - ELGG TABBED NAVIGATION re-usable tabbed navigation - WIDGETS - LOGIN / REGISTER login box, register, and lost password page styles - CONTENT HEADER - DEFAULT COMMENTS - ENTITY LISTINGS elgg's default entity listings - USER SETTINGS styles for user settings - GENERAL FORM ELEMENTS default styles for all elgg input/form elements - FRIENDS PICKER - LIKES - MISC - -*/ -/* Colors: - - #4690D6 - elgg light blue - #0054A7 - elgg dark blue - #e4ecf5 - elgg v light blue -*/ - - - -/* *************************************** - BASICS -*************************************** */ -body { - text-align:left; - margin:0 auto; - padding:0; - background-color: white; - font-size: 80%; - line-height: 1.4em; - font-family: "Lucida Grande",Arial,Tahoma,Verdana,sans-serif; -} -a { - color: #4690D6; - text-decoration: none; - -moz-outline-style: none; - outline: none; -} -a:hover, -a.selected { - color: #555555; - text-decoration: underline; -} -p { - margin-bottom:15px; -} -p:last-child { - margin-bottom:0; -} -small { - font-size: 90%; -} -h1, h2, h3, h4, h5, h6 { - font-weight: bold; - line-height: auto; - color:#0054A7; -} -h1 { font-size: 1.8em; } -h2 { font-size: 1.5em; line-height: 1.1em; } -h3 { font-size: 1.2em; } -h4 { font-size: 1.0em; } -h5 { font-size: 0.9em; } -h6 { font-size: 0.8em; } -dt { - font-weight: bold; -} -dd { - margin: 0 0 1em 1em; -} -pre, code { - font-family:Monaco,"Courier New",Courier,monospace; - font-size:12px; - background:#EBF5FF; - color:#000000; - overflow:auto; - - overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */ - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ -} -code { - padding:2px 3px; -} -pre { - padding:3px 15px; - margin:0px 0 15px 0; - line-height:1.3em; -} -blockquote { - padding:3px 15px; - margin:0px 0 15px 0; - line-height:1.3em; - background:#EBF5FF; - border:none; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; -} - - -/* *************************************** - GENERIC SELECTORS -*************************************** */ -h2 { -/* border-bottom:1px solid #CCCCCC; */ - padding-bottom:5px; -} - -.clearfloat { clear:both; } - -/* Clearfix! */ -.clearfix:after, -.listing:after, -.listing .info:after { - content:"."; - display:block; - height:0; - clear:both; - visibility:hidden; -} - -.listing .icon { float: left; margin-right: 10px; } -.listing .icon img { width: auto } -.listing .info { display: table-cell; } - -.link { - cursor:pointer; -} -.small { - font-size: 90%; -} -.divider { - border-top:1px solid #cccccc; -} -.hidden { - display:none; -} -.radius8 { - -webkit-border-radius: 8px; - -moz-border-radius: 8px; -} -.margin-none { - margin:0; -} -.margin-top { - margin-top:10px; -} -.rss-link { - margin-top:-10px; - margin-bottom:10px; -} -.rss-link a { - display:block; - width:14px; - height:14px; - float:right; - background-image:url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png); - background-repeat: no-repeat; - background-position: -250px top; - text-indent: -1000em; -} -.elgg-tags { - background-image:url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png); - background-repeat: no-repeat; - background-position: left -196px; - padding:1px 0 0 14px; - font-size: 85%; -} -.elgg-tagcloud { - text-align:justify; -} -.ajax-loader { - background-color: white; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/ajax_loader_bw.gif); - background-repeat: no-repeat; - background-position: center center; - min-height:33px; - min-width:33px; -} -.ajax-loader.left { - background-position: left center; -} - -.right { - float: right; -} - -.left { - float: left; -} - -.elgg_hrt { - border-top: 1px solid #CCCCCC; -} - -.elgg_hrb { - border-bottom: 1px solid #CCCCCC; -} - - -/* *************************************** - PAGE LAYOUT - MAIN BLOCKS POSITIONING -*************************************** */ -.elgg-page-topbar { - background: #333333 url(<?php echo elgg_get_site_url(); ?>_graphics/toptoolbar_background.gif) repeat-x top left; - color: #eeeeee; - border-bottom: 1px solid #000000; - min-width: 998px; - position: relative; - height: 24px; - z-index: 9000; -} -.elgg-page-header { - x-overflow: hidden; - position: relative; - background-color: #4690D6; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/header_shadow.png); - background-repeat: repeat-x; - background-position: bottom left; -} -.elgg-page-footer { - position: relative; - z-index: 999; -} - -.elgg-layout-one_column { - padding: 10px 0; -} -.elgg-layout-sidebar { - background-image:url(<?php echo elgg_get_site_url(); ?>_graphics/sidebar_background.gif); - background-repeat:repeat-y; - background-position: right top; -} -.elgg-layout-two-sidebar { - background-image:url(<?php echo elgg_get_site_url(); ?>_graphics/two_sidebar_background.gif); - background-repeat:repeat-y; - background-position: right top; -} -.elgg-main { - position: relative; - min-height: 360px; - padding: 10px; -} -.elgg-aside { - padding: 20px 10px; - position: relative; - min-height: 360px; -} -.elgg-sidebar { - float: right; - width: 210px; - margin-left: 10px; -} -.elgg-sidebar-alt { - float: left; - width: 160px; - margin-right: 10px; -} - -/* move elgg-body to one of the css components */ -/** - * elgg-body fills the space available to it. - * It uses hidden text to expand itself. The combination of auto width, overflow - * hidden, and the hidden text creates this effect. - * - * This allows us to float fixed width divs to either side of an .elgg-body div - * without having to specify the body div's width. - * - * @todo check what happens with long <pre> tags or large images - */ -.elgg-body { - width: auto; - word-wrap: break-word; - overflow: hidden; -} -.elgg-body:after { - display: block; - visibility: hidden; - height: 0 !important; - line-height: 0; - font-size: xx-large; - content: " x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x "; -} - - - -.elgg-module { - margin-top: 20px; -} - -.elgg_inner { -} - -.elgg-header { - border-bottom: 1px solid #CCCCCC; - margin-bottom: 5px; - padding-bottom: 5px; -} - -.elgg-footer { -} - -.elgg-media { - padding: 3px 0; -} - -.elgg-media .elgg-icon { - float: left; - margin-right: 5px; -} - - -.elgg-main-header { - border-bottom: 1px solid #CCCCCC; - padding-bottom: 3px; -} - -.elgg-main-heading { - float: left; - max-width: 530px; - margin-right: 10px; -} - -.elgg-list { - border-top: 1px dotted #CCCCCC; - margin: 5px 0; -} - -.elgg-list li { - border-bottom: 1px dotted #CCCCCC; -} - - -.elgg-center { - margin: 0 auto; -} - -.elgg-width-classic { - width: 990px; -} - - -#elgg-search { - bottom:5px; - height:23px; - position:absolute; - right:0; -} -#elgg-main-nav { - z-index: 7000; - position: absolute; - height:23px; - bottom:0; - left:0; - width:auto; -} - - -/* *************************************** - ELGG TOPBAR -*************************************** */ -.elgg-page-topbar a { - margin-right:30px; - padding-top:2px; - display:inline; - float:left; - text-align: left; - color:#eeeeee; -} -.elgg-page-topbar a:hover { - color:#71cbff; - text-decoration: none; -} -.elgg-page-topbar a img.user-mini-avatar { - border:1px solid #eeeeee; - margin:1px 0 0 10px; - display: block; -} -.elgg-page-topbar a img.site-logo { - display: block; - margin-left:5px; - margin-top: -1px; -} -.elgg-page-topbar .log-out { - float:right; -} -.elgg-page-topbar .log-out a { - display: inline; - text-align: right; - margin-right:10px; - color:#999999; -} -.elgg-page-topbar .log-out a:hover { - color:#71cbff; -} -.elgg-page-topbar a.myfriends { - background:transparent url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat left -297px; - margin-right:30px; - text-indent: -900em; - width:36px; -} -.elgg-page-topbar a.myfriends:hover { - background-position: left -337px; -} -.elgg-page-topbar a.settings { - background:transparent url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat -300px -41px; - padding-left:20px !important; - float:right; - margin-right:30px; -} -.elgg-page-topbar a.admin { - background:transparent url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat -300px -41px; - padding-left:20px !important; - float:right; - margin-right:30px; -} -.elgg-page-topbar a.help { - background:transparent url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat -300px -133px; - padding-left:18px !important; - float:right; - margin-right:30px; -} - - -/* *************************************** - HEADER CONTENTS -*************************************** */ -.elgg-page-header-inner { - position: relative; - height: 90px; -} - -.elgg-page-header h1 a span.network-title { - font-size: 2em; - line-height:1.4em; - color: white; - font-style: italic; - font-family: Georgia, times, serif; - display: block; - text-decoration: none; - text-shadow:1px 2px 4px #333333; -} -.elgg-page-header #elgg-search input.search-input { - -webkit-border-radius: 10px; - -moz-border-radius: 10px; - background-color:transparent; - border:1px solid #71b9f7; - color:white; - font-size:12px; - font-weight:bold; - margin:0; - padding:2px 4px 2px 26px; - width:198px; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png); - background-position: 2px -220px; - background-repeat: no-repeat; -} -.elgg-page-header #elgg-search input.search-input:focus { - background-color:white; - color:#0054A7; - border:1px solid white; - background-position: 2px -257px; -} -.elgg-page-header #elgg-search input.search-input:active { - background-color:white; - color:#0054A7; - border:1px solid white; - background-position: 2px -257px; -} -.elgg-page-header #elgg-search input.search-submit-button { - display:none; -} - - -/* *************************************** - ELGG SITE NAVIGATION in header -*************************************** */ -.navigation, -.navigation ul { - margin:0; - padding:0; - display:inline; - float:left; - list-style-type: none; - z-index: 7000; - position: relative; -} -.navigation li { - list-style: none; - font-weight: bold; - position: relative; - display:block; - height:23px; - float:left; - margin:0; - padding:0; -} -.navigation a { - color:white; - margin:0 1px 0 0px; - text-decoration:none; - font-weight: bold; - font-size: 1em; - padding:3px 13px 0px 13px; - height:20px; - cursor: pointer; - display:block; -} -.navigation li a:hover { - background:white; - color:#555555; - -moz-border-radius-topleft:4px; - -moz-border-radius-topright:4px; - -webkit-border-top-left-radius:4px; - -webkit-border-top-right-radius:4px; - -webkit-box-shadow: 2px -1px 1px rgba(0, 0, 0, 0.25); - -moz-box-shadow: 2px -1px 1px rgba(0, 0, 0, 0.25); -} -.navigation li.selected a { - background:white; - color:#555555; - -moz-border-radius-topleft:4px; - -moz-border-radius-topright:4px; - -webkit-border-top-left-radius:4px; - -webkit-border-top-right-radius:4px; - margin-top:1px; - -webkit-box-shadow: 2px -1px 1px rgba(0, 0, 0, 0.25); - -moz-box-shadow: 2px -1px 1px rgba(0, 0, 0, 0.25); -} -li.navigation-more { - overflow:hidden; -} -li.navigation-more:hover { - overflow:visible; -} -li.navigation-more:hover a { - background:white; - color:#555555; - -moz-border-radius-topleft:4px; - -moz-border-radius-topright:4px; - -webkit-border-top-left-radius:4px; - -webkit-border-top-right-radius:4px; - -webkit-box-shadow: 2px -1px 1px rgba(0, 0, 0, 0.25); - -moz-box-shadow: 2px -1px 1px rgba(0, 0, 0, 0.25); -} -li.navigation-more a.subnav span { - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png); - background-repeat: no-repeat; - background-position: -150px -56px; - padding-left: 12px; -} -li.navigation-more:hover a.subnav span, -li.navigation-more a.subnav:hover span { - background-position: -150px -76px; -} -li.navigation-more ul { - z-index: 7000; - min-width: 150px; - margin-left:-1px; - background-color:white; - border-left:1px solid #999999; - border-right:1px solid #999999; - border-bottom:1px solid #999999; - -moz-border-radius-bottomleft:4px; - -moz-border-radius-bottomright:4px; - -webkit-border-bottom-left-radius:4px; - -webkit-border-bottom-right-radius:4px; - -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.25); - -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.25); -} -li.navigation-more ul li { - float:none; -} -.navigation li.navigation-more ul li a { - background:white; - color:#555555; - margin:0; - -webkit-border-radius: 0; - -moz-border-radius: 0; - -webkit-box-shadow: none; - -moz-box-shadow: none; -} -.navigation li.navigation-more ul li:last-child a, -.navigation li.navigation-more ul li:last-child a:hover { - -moz-border-radius-bottomleft:4px; - -moz-border-radius-bottomright:4px; - -webkit-border-bottom-left-radius:4px; - -webkit-border-bottom-right-radius:4px; -} -.navigation li.navigation-more ul li a:hover { - background:#4690D6; - color:white; - margin:0; - -webkit-border-radius: 0; - -moz-border-radius: 0; - -webkit-box-shadow: none; - -moz-box-shadow: none; -} -.navigation li.navigation-more ul li.selected a { - background:#4690D6; - color:white; -} - -/* *************************************** - FOOTER CONTENTS -*************************************** */ - -.elgg-page-footer-inner { - padding: 5px 0; - border-top:1px solid #DEDEDE; -} - -#elgg-footer-contents, -#elgg-footer-contents a, -#elgg-footer-contents p { - color:#999999; -} -#elgg-footer-contents a:hover { - color:#666666; -} -.#elgg-footer-contents p { - margin:0; -} -.powered-by-elgg-badge { - float:right; -} - - -/* *************************************** - SYSTEM MESSAGES -*************************************** */ -.elgg-system-messages { - position:fixed; - top:24px; - right:20px; - max-width:500px; - z-index:9600; -} -.elgg-system-messages li { - color:white; - font-weight:bold; - display:block; - padding:3px 10px; - margin-top:10px; - cursor:pointer; - opacity:0.9; - -webkit-box-shadow:0 2px 5px rgba(0, 0, 0, 0.45); - -moz-box-shadow:0 2px 5px rgba(0, 0, 0, 0.45); -} -.elgg-state-success { - background-color:black; -} -.elgg-state-error { - background-color:red; -} - -.elgg-system-message p { - margin:0; -} - - -/* *************************************** - BREADCRUMBS -*************************************** */ -.elgg-breadcrumbs { - font-size: 80%; - font-weight: bold; - line-height: 1.2em; - color: #bababa; -} -.elgg-breadcrumbs li { - display: inline; -} -.elgg-breadcrumbs li:after{ - content: "\003E"; - display: inline-block; - padding: 0 4px 0 4px; - font-weight: normal; -} -.elgg-breadcrumbs li:last-child:after { - content: ""; -} -.elgg-breadcrumbs a { - color: #999999; -} -.elgg-breadcrumbs a:hover { - color: #0054a7; - text-decoration: underline; -} -.elgg-main .elgg-breadcrumbs { - position: relative; - top:-6px; - left:0; -} - -/* *************************************** - SUBMENU -*************************************** */ -.submenu { - margin:0; - padding:0; - list-style: none; -} -.submenu ul { - margin-bottom:0; - padding-left:0; - list-style: none; -} -.submenu li.selected a, -.submenu li.selected li.selected a, -.submenu li.selected li.selected li.selected a { - background: #4690D6; - color:white; -} -.submenu li a { - display:block; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - background-color:white; - margin:0 0 3px 0; - padding:2px 4px 2px 8px; -} -.submenu li a:hover { - background:#0054A7; - color:white; - text-decoration:none; -} -.submenu .child li a { - margin-left:15px; - background-color:white; - color:#4690D6; -} -.submenu .child li a:hover { - background:#0054A7; - color:white; - text-decoration:none; -} - - - -/* *************************************** - PAGINATION -*************************************** */ -.pagination { - margin:5px 0 5px 0; - padding:5px 0; -} -.pagination .pagination-number { - display:block; - float:left; - background:#ffffff; - border:1px solid #4690d6; - text-align: center; - color:#4690d6; - font-size: 12px; - font-weight: normal; - margin:0 6px 0 0; - padding:0px 4px; - cursor: pointer; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; -} -.pagination .pagination-number:hover { - background:#4690d6; - color:white; - text-decoration: none; -} -.pagination .pagination-more { - display:block; - float:left; - background:#ffffff; - border:1px solid #ffffff; - text-align: center; - color:#4690d6; - font-size: 12px; - font-weight: normal; - margin:0 6px 0 0; - padding:0px 4px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; -} -.pagination .pagination-previous, -.pagination .pagination-next { - display:block; - float:left; - border:1px solid #cccccc; - color:#4690d6; - text-align: center; - font-size: 12px; - font-weight: normal; - margin:0 6px 0 0; - padding:0px 4px; - cursor: pointer; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; -} -.pagination .pagination-previous:hover, -.pagination .pagination-next:hover { - background:#4690d6; - border:1px solid #4690d6; - color:white; - text-decoration: none; -} -.pagination .pagination-currentpage { - display:block; - float:left; - background:#4690d6; - border:1px solid #4690d6; - text-align: center; - color:white; - font-size: 12px; - font-weight: bold; - margin:0 6px 0 0; - padding:0px 4px; - cursor: pointer; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; -} - - -/* *************************************** - ELGG TABBED PAGE NAVIGATION -*************************************** */ -.elgg-horizontal-tabbed-nav { - margin-bottom:5px; - padding: 0; - border-bottom: 2px solid #cccccc; - display:table; - width:100%; -} -.elgg-horizontal-tabbed-nav ul { - list-style: none; - padding: 0; - margin: 0; -} -.elgg-horizontal-tabbed-nav li { - float: left; - border: 2px solid #cccccc; - border-bottom-width: 0; - background: #eeeeee; - margin: 0 0 0 10px; - -moz-border-radius-topleft:5px; - -moz-border-radius-topright:5px; - -webkit-border-top-left-radius:5px; - -webkit-border-top-right-radius:5px; -} -.elgg-horizontal-tabbed-nav a { - text-decoration: none; - display: block; - padding:3px 10px 0 10px; - text-align: center; - height:21px; - color:#999999; -} -.elgg-horizontal-tabbed-nav a:hover { - background: #dedede; - color:#4690D6; -} -.elgg-horizontal-tabbed-nav .selected { - border-color: #cccccc; - background: white; -} -.elgg-horizontal-tabbed-nav .selected a { - position: relative; - top: 2px; - background: white; -} - -/* *************************************** - WIDGETS -*************************************** */ -.widget-column { - float: right; - min-height: 30px; -} -.widget-1-columns { - width: 100%; -} -.widget-2-columns { - width: 50%; -} -.widget-3-columns { - width: 33%; -} -.widget-4-columns { - width: 25%; -} -#widget-add-button { - padding: 0px; - text-align: right; - margin-bottom: 15px; - margin-right: 5px; -} -.widgets-add-panel { - padding: 10px; - margin: 0 5px 15px; - background: #dedede; -} -.widgets-add-panel ul { - padding: 0; - margin: 0; -} -.widgets-add-panel li { - float: left; - margin: 2px 10px; - list-style: none; - width: 200px; - padding: 4px; - background-color: #cccccc; -} -.widgets-add-panel li a { - display: block; -} -.widget-available { - cursor: pointer; -} -.widget-unavailable { - color: #888888; -} -.widget { - background-color: #dedede; - padding: 2px; - margin: 0 5px 15px; - position: relative; -} -.widget:hover { - background-color: #cccccc; -} -.widget-title { - background-color: #dedede; - height: 30px; - line-height: 30px; - overflow: hidden; -} -.widget-title h3 { - float: left; - padding: 0 45px 0 20px; - color: #333333; -} -.widget-controls a { - position: absolute; - top: 5px; - display: block; - width: 18px; - height: 18px; - border: 1px solid transparent; -} -a.widget-collapse-button { - left: 5px; - background:transparent url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat 0px -385px; -} -.widget-controls a.widget-collapsed { - background-position: 0px -365px; -} -a.widget-delete-button { - right: 5px; - background:transparent url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat -198px 3px; -} -a.widget-edit-button { - right: 25px; - background:transparent url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat -300px -1px; -} -a.widget-edit-button:hover, a.widget-delete-button:hover { - border: 1px solid #cccccc; -} -.widget-container { - background-color: white; - width: 100%; - overflow: hidden; -} -.widget-edit { - display: none; - width: 96%; - padding: 2%; - border-bottom: 2px solid #dedede; -} -.widget-content { - padding: 10px; -} -.drag-handle { - cursor: move; -} -.widget-placeholder { - border: 2px dashed #dedede; - margin-bottom: 15px; -} - -/* *************************************** - LOGIN / REGISTER -*************************************** */ -/* login in sidebar */ -.elgg-aside #login { - width:auto; -} -.elgg-aside #login form { - width:auto; -} -.elgg-aside #login .login-textarea { - width:196px; -} -/* default login and register forms */ -#login input[type="text"], -#login input[type="password"], -.register input[type="text"], -.register input[type="password"] { - margin:0 0 10px 0; -} -.register input[type="text"], -.register input[type="password"] { - width:380px; -} -.rememberme label { - font-weight:normal; - font-size:100%; -} -.loginbox .submit-button { - margin-right: 15px; -} -#login .persistent-login { - float:right; - display:block; - margin-top:-34px; - margin-left:80px; -} -#login .persistent-login label { - font-size:1.0em; - font-weight: normal; - cursor: pointer; -} -#login-dropdown { - float:right; - position: absolute; - top:10px; - right:0; - z-index: 9599; -} -#login-dropdown #signin-button { - padding:10px 0px 12px; - line-height:23px; - text-align:right; -} -#login-dropdown #signin-button a.signin { - padding:2px 6px 3px 6px; - text-decoration:none; - font-weight:bold; - position:relative; - margin-left:0; - color:white; - border:1px solid #71B9F7; - -webkit-border-radius:4px; - -moz-border-radius:4px; - border-radius:4px; -} -#login-dropdown #signin-button a.signin span { - padding:4px 0 6px 12px; - background-image:url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png); - background-position:-150px -51px; - background-repeat:no-repeat; -} -#login-dropdown #signin-button a.signin:hover { - background-color:#71B9F7; - /* color:black; */ -} -#login-dropdown #signin-button a.signin:hover span { - /* background-position:-150px -71px; */ -} -#login-dropdown #signin-button a.signin.menu-open { - background:#cccccc !important; - color:#666666 !important; - border:1px solid #cccccc; - outline:none; -} -#login-dropdown #signin-button a.signin.menu-open span { - background-position:-150px -71px; - color:#333333; -} -#login-dropdown #signin-menu { - -moz-border-radius-topleft:5px; - -moz-border-radius-bottomleft:5px; - -moz-border-radius-bottomright:5px; - -webkit-border-top-left-radius:5px; - -webkit-border-bottom-left-radius:5px; - -webkit-border-bottom-right-radius:5px; - display:none; - background-color:white; - position:absolute; - width:210px; - z-index:100; - border:5px solid #CCCCCC; - text-align:left; - padding:12px; - top: 26px; - right: 0px; - margin-top:5px; - margin-right: 0px; - color:#333333; - -webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.45); - -moz-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.45); -} -#login-dropdown #signin-menu input[type=text], -#login-dropdown #signin-menu input[type=password] { - width:203px; - margin:0 0 5px; -} -#login-dropdown #signin-menu p { - margin:0; -} -#login-dropdown #signin-menu label { - font-weight:normal; - font-size: 100%; -} -#login-dropdown #signin-menu .submit-button { - margin-right:15px; -} - -/* *************************************** - CONTENT HEADER -**************************************** */ -#content-header { - border-bottom:1px solid #CCCCCC; -} -#content-header:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} -.content-header-title { - float:left; -} -.content-header-title { - margin-right:10px; - max-width: 530px; -} -.content-header-title h2 { - border:none; - margin-bottom:0; - padding-bottom:5px; -} -.content-header-options { - float:right; -} -.content-header-options .action-button { - float:right; - margin:0 0 5px 10px; -} - - -/* *************************************** - DEFAULT COMMENTS -**************************************** */ -.generic-comment { - border-bottom:1px dotted #cccccc; - clear:both; - display:block; - margin:0; - padding:5px 0 7px; - position:relative; -} -.generic-comment:first-child { - border-top:1px dotted #cccccc; -} -.generic-comment-icon { - float:left; - margin-left:3px; - margin-top:3px; -} -.generic-comment-icon img { - width: auto; -} -.generic-comment-details { - float:left; - margin-left:7px; - min-height:28px; - width:693px; -} -.generic-comment-details p { - margin:0; -} -.generic-comment-owner { - line-height:1.2em; -} -.generic-comment-owner a { - color:#0054A7; -} -.generic-comment-body { - margin:3px 0 5px 0; -} -.generic-comment-body p { - margin-bottom: 10px; -} -/* latest comments in sidebar */ -.elgg-aside .generic-comment.latest { - padding:2px 0; -} -.elgg-aside .generic-comment.latest .generic-comment-icon { - margin-left:1px; - margin-top:5px; -} -.elgg-aside .generic-comment.latest .generic-comment-details { - width:177px; - line-height:1.1em; - overflow:hidden; -} -.elgg-aside .generic-comment.latest .entity-title { - font-size: inherit; - line-height: inherit; -} - - -/* *************************************** - DEFAULT ENTITY LISTINGS -**************************************** */ -.entity-listing { - border-bottom:1px dotted #cccccc; - padding:4px 0; - position:relative; -} -.entity-listing:first-child { - border-top:1px dotted #cccccc; -} -.entity-listing:hover { - background-color: #eeeeee; -} -.entity-listing .icon { - margin-left:3px; - margin-top:3px; -} -.entity-listing .info { - min-height:28px; - width:693px; -} -.entity-listing-info p { - margin:0; - /* line-height:1.2em; */ -} -.entity-title { - font-weight: bold; - font-size: 1.1em; - line-height:1.2em; - color:#666666; - padding-bottom:4px; -} -.entity-title a { - color:#0054A7; -} -.entity-subtext { - color:#666666; - font-size: 85%; - font-style: italic; - line-height:1.2em; -} -/* entity metadata block */ -.elgg-metadata { - float:right; - margin-left:15px; - color:#aaaaaa; - font-size: 90%; -} -.entity-metadata { - float:right; - margin:0 3px 0 15px; - color:#aaaaaa; - font-size: 90%; -} -.entity-metadata span, .elgg-metadata span { - margin-left:14px; - text-align:right; -} -.entity-metadata .entity-edit a, .elgg-metadata .entity-edit a { - color:#aaaaaa; -} -.entity-metadata .entity-edit a:hover, .elgg-metadata .entity-edit a:hover { - color:#555555; -} -.entity-metadata .delete-button, .elgg-metadata .delete-button { - margin-top:3px; -} - -/* override hover for lists of site users/members */ -.members-list .entity-listing:hover { - background-color:white; -} - - -/* *************************************** - USER SETTINGS -*************************************** */ -.user-settings { - margin-bottom:20px; -} -.user-settings h3 { - background:#e4e4e4; - color:#333333; - padding:5px; - margin-top:10px; - margin-bottom:10px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; -} -.user-settings label { - color:#333333; - font-size:100%; - font-weight:normal; -} -.user-settings table.styled { - width:100%; -} -.user-settings table.styled { - border-top:1px solid #cccccc; -} -.user-settings table.styled td { - padding:2px 4px 2px 4px; - border-bottom:1px solid #cccccc; -} -.user-settings table.styled td.column-one { - width:200px; -} -.user-settings table.styled tr:hover { - background: #E4E4E4; -} -.add-user form { - width:300px; -} - -/* *************************************** - FRIENDS PICKER -*************************************** */ -.friends-picker-container h3 { - font-size:4em !important; - text-align: left; - margin:10px 0 20px 0 !important; - color:#999999 !important; - background: none !important; - padding:0 !important; -} -.friends-picker .friends-picker-container .panel ul { - text-align: left; - margin: 0; - padding:0; -} -.friends-picker-wrapper { - margin: 0; - padding:0; - position: relative; - width: 100%; -} -.friends-picker { - position: relative; - overflow: hidden; - margin: 0; - padding:0; - width: 730px; - height: auto; -} -.friendspicker-savebuttons { - background: white; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - margin:0 10px 10px 10px; -} -.friends-picker .friends-picker-container { /* long container used to house end-to-end panels. Width is calculated in JS */ - position: relative; - left: 0; - top: 0; - width: 100%; - list-style-type: none; -} -.friends-picker .friends-picker-container .panel { - float:left; - height: 100%; - position: relative; - width: 730px; - margin: 0; - padding:0; -} -.friends-picker .friends-picker-container .panel .wrapper { - margin: 0; - padding:4px 10px 10px 10px; - min-height: 230px; -} -.friends-picker-navigation { - margin: 0 0 10px 0; - padding:0 0 10px 0; - border-bottom:1px solid #cccccc; -} -.friends-picker-navigation ul { - list-style: none; - padding-left: 0; -} -.friends-picker-navigation ul li { - float: left; - margin:0; - background:white; -} -.friends-picker-navigation a { - font-weight: bold; - text-align: center; - background: white; - color: #999999; - text-decoration: none; - display: block; - padding: 0; - width:20px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; -} -.tabHasContent { - background: white; - color:#333333 !important; -} -.friends-picker-navigation li a:hover { - background: #333333; - color:white !important; -} -.friends-picker-navigation li a.current { - background: #4690D6; - color:white !important; -} -.friends-picker-navigation-l, .friends-picker-navigation-r { - position: absolute; - top: 46px; - text-indent: -9000em; -} -.friends-picker-navigation-l a, .friends-picker-navigation-r a { - display: block; - height: 43px; - width: 43px; -} -.friends-picker-navigation-l { - right: 48px; - z-index:1; -} -.friends-picker-navigation-r { - right: 0; - z-index:1; -} -.friends-picker-navigation-l { - background: url("<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png") no-repeat left top; -} -.friends-picker-navigation-r { - background: url("<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png") no-repeat -60px top; -} -.friends-picker-navigation-l:hover { - background: url("<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png") no-repeat left -44px; -} -.friends-picker-navigation-r:hover { - background: url("<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png") no-repeat -60px -44px; -} -.friendspicker-savebuttons .submit-button, -.friendspicker-savebuttons .cancel-button { - margin:5px 20px 5px 5px; -} -#collectionMembersTable { - background: #dedede; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - margin:10px 0 0 0; - padding:10px 10px 0 10px; -} - - -/* *************************************** - LIKES -*************************************** */ -.likes-list-holder { - position: relative; - float:right; -} -.likes-list-holder a.user-like { - cursor:pointer; - background: url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat left -101px; - text-indent: -9000em; - text-align: left; - display:block; - width:20px; - height:20px; - margin:0; - float:left; -} -.likes-list-holder a.user-like:hover { - background-position: left -131px; -} -.likes-list-holder .likes-list-button.link { - float:left; - text-align: left; - background: url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat left -131px; - padding-left:21px; - height:20px; -} -.likes-list-holder .likes-list-button.link.not-liked { - background:none; - padding-left:0; -} -.likes-list-holder .likes-list { - background-color: white; - border:1px solid #cccccc; - width: 345px; - height: auto; - position: absolute; - text-align: left; - z-index: 9999; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - -webkit-box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5); - -moz-box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5); -} -.likes-list-holder .elgg-likes-user { - border-bottom:1px solid #cccccc; - padding:3px; -} -.likes-list-holder .elgg-likes-user .entity-listing-info { - width:305px; -} -.entity-listing .elgg-likes-user .entity-metadata { - min-width:20px !important; -} -.elgg-likes-user .entity-listing-icon { - margin:3px 0 4px 2px; -} -.elgg-likes-user .entity-metadata { - margin-top:3px; -} -p.elgg-likes-owner { - padding-top:4px; -} - -.user-picker .user-picker-entry { - clear:both; - height:25px; - padding:5px; - margin-top:5px; - border-bottom:1px solid #cccccc; -} -.user-picker-entry .delete-button { - margin-right:10px; -} - -/* *************************************** - MISC -*************************************** */ -#dashboard-info { - float: left; - width: 625px; - margin: 0 5px 15px; - padding: 5px; - border: 2px solid #dedede; -} - - -<?php - -// in case plugins are still extending the old 'css' view, display it -echo elgg_view('css', $vars); diff --git a/views/default/css/walled_garden.php b/views/default/css/walled_garden.php new file mode 100644 index 000000000..f6f7f97dc --- /dev/null +++ b/views/default/css/walled_garden.php @@ -0,0 +1,81 @@ +<?php +/** + * Walled garden CSS + */ + +$url = elgg_get_site_url(); + +?> +.elgg-body-walledgarden { + margin: 100px auto 0 auto; + position: relative; + width: 530px; +} +.elgg-module-walledgarden { + position: absolute; + top: 0; + left: 0; +} +.elgg-module-walledgarden > .elgg-head { + height: 17px; +} +.elgg-module-walledgarden > .elgg-body { + padding: 0 10px; +} +.elgg-module-walledgarden > .elgg-foot { + height: 17px; +} +.elgg-walledgarden-double > .elgg-head { + background: url(<?php echo $url; ?>_graphics/walled_garden/two_column_top.png) no-repeat left top; +} +.elgg-walledgarden-double > .elgg-body { + background: url(<?php echo $url; ?>_graphics/walled_garden/two_column_middle.png) repeat-y left top; +} +.elgg-walledgarden-double > .elgg-foot { + background: url(<?php echo $url; ?>_graphics/walled_garden/two_column_bottom.png) no-repeat left top; +} +.elgg-walledgarden-single > .elgg-head { + background: url(<?php echo $url; ?>_graphics/walled_garden/one_column_top.png) no-repeat left top; +} +.elgg-walledgarden-single > .elgg-body { + background: url(<?php echo $url; ?>_graphics/walled_garden/one_column_middle.png) repeat-y left top; +} +.elgg-walledgarden-single > .elgg-foot { + background: url(<?php echo $url; ?>_graphics/walled_garden/one_column_bottom.png) no-repeat left top; +} + +.elgg-col > .elgg-inner { + margin: 0 0 0 5px; +} +.elgg-col:first-child > .elgg-inner { + margin: 0 5px 0 0; +} +.elgg-col > .elgg-inner { + padding: 0 8px; +} + +.elgg-walledgarden-single > .elgg-body { + padding: 0 18px; +} + +.elgg-module-walledgarden-login { + margin: 0; +} +.elgg-body-walledgarden h3 { + font-size: 1.5em; + line-height: 1.1em; + padding-bottom: 5px; +} + +.elgg-heading-walledgarden { + margin-top: 60px; + line-height: 1.1em; +} + +h1, h2, h3, h4, h5, h6 { + color: #666; +} + +a { + color: #999; +}
\ No newline at end of file diff --git a/views/default/dashboard/blurb.php b/views/default/dashboard/blurb.php deleted file mode 100644 index 821c617f5..000000000 --- a/views/default/dashboard/blurb.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php -/** - * Elgg dashboard blurb - * - */ -?> - -<div id="dashboard-info"> - <p> - <?php echo elgg_echo("dashboard:nowidgets"); ?> - </p> -</div>
\ No newline at end of file diff --git a/views/default/entities/entity_list.php b/views/default/entities/entity_list.php deleted file mode 100644 index fd6ea27bb..000000000 --- a/views/default/entities/entity_list.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * View a list of entities - * - * @package Elgg - * - */ - -$context = $vars['context']; -$offset = $vars['offset']; -$entities = $vars['entities']; -$limit = $vars['limit']; -$count = $vars['count']; -$baseurl = $vars['baseurl']; -$context = $vars['context']; -$listtype = $vars['listtype']; -$pagination = $vars['pagination']; -$fullview = $vars['fullview']; - -$html = ""; -$nav = ""; - -if (isset($vars['listtypetoggle'])) { - $listtypetoggle = $vars['listtypetoggle']; -} else { - $listtypetoggle = true; -} - -if ($context == "search" && $count > 0 && $listtypetoggle) { - $nav .= elgg_view('navigation/listtype', array( - 'baseurl' => $baseurl, - 'offset' => $offset, - 'count' => $count, - 'listtype' => $listtype, - )); -} - -if ($pagination) { - $nav .= elgg_view('navigation/pagination',array( - 'baseurl' => $baseurl, - 'offset' => $offset, - 'count' => $count, - 'limit' => $limit, - )); -} - -if ($listtype == 'list') { - if (is_array($entities) && sizeof($entities) > 0) { - foreach($entities as $entity) { - $html .= elgg_view_entity($entity, $fullview); - } - } -} else { - if (is_array($entities) && sizeof($entities) > 0) { - $html .= elgg_view('entities/gallery', array('entities' => $entities)); - } -} - -if ($count) { - $html .= $nav; -} - -echo $html;
\ No newline at end of file diff --git a/views/default/entities/entity_listing.php b/views/default/entities/entity_listing.php deleted file mode 100644 index 4b6636db7..000000000 --- a/views/default/entities/entity_listing.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Generic display for a single entity in list view. - * - * @package Elgg - * @subpackage Core - * - * @uses string $vars['icon'] Full icon HTML to display. - * @uses string $vars['info'] Info about the entity. - */ -?> -<div class="listing entity-listing"> - <div class="icon"> - <?php echo $vars['icon']; ?> - </div> - <div class="info"> - <?php echo $vars['info']; ?> - </div> -</div> diff --git a/views/default/entities/gallery.php b/views/default/entities/gallery.php deleted file mode 100644 index bfdd4d4d8..000000000 --- a/views/default/entities/gallery.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * Elgg gallery view - * - * @package Elgg - * @subpackage Core - */ - -$entities = $vars['entities']; -if (is_array($entities) && sizeof($entities) > 0) { - -?> - -<table class="entity_gallery"> - -<?php - - $col = 0; - foreach($entities as $entity) { - if ($col == 0) { - - echo "<tr>"; - - } - echo "<td class='entity_gallery_item'>"; - echo elgg_view_entity($entity); - echo "</td>"; - $col++; - if ($col > 3) { - echo "</tr>"; - $col = 0; - } - } - if ($col > 0) echo "</tr>"; - -?> - -</table> - -<?php - -}
\ No newline at end of file diff --git a/views/default/entities/gallery_listing.php b/views/default/entities/gallery_listing.php deleted file mode 100644 index 58fa5e26b..000000000 --- a/views/default/entities/gallery_listing.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -/** - * Generic display for a single entity in gallery view. - * - * @package Elgg - * @subpackage Core - * - * @uses string $vars['icon'] Full icon HTML to display. - * @uses string $vars['info'] Info about the entity. - */ - -?> - -<div class="gallery_listing clearfix"> - <div class="gallery_listing_icon"> - <?php echo $vars['icon']; ?> - </div> - <div class="gallery_listing_info"> - <?php echo $vars['info']; ?> - </div> -</div> diff --git a/views/default/entities/list.php b/views/default/entities/list.php deleted file mode 100644 index 2ddd96ee9..000000000 --- a/views/default/entities/list.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * View a list of entities - * - * @package Elgg - * - */ - -$context = $vars['context']; -$offset = $vars['offset']; -$entities = $vars['entities']; -$limit = $vars['limit']; -$count = $vars['count']; -$base_url = $vars['baseurl']; -$context = $vars['context']; -$list_type = $vars['listtype']; -$pagination = $vars['pagination']; -$full_view = $vars['fullview']; - -$html = ""; -$nav = ""; - -$list_type_toggle = elgg_get_array_value('listtypetoggle', $vars, true); - -if ($context == "search" && $count > 0 && $list_type_toggle) { - $nav .= elgg_view('navigation/listtype', array( - 'baseurl' => $base_url, - 'offset' => $offset, - 'count' => $count, - 'listtype' => $list_type, - )); -} - -if ($pagination) { - $nav .= elgg_view('navigation/pagination', array( - 'baseurl' => $base_url, - 'offset' => $offset, - 'count' => $count, - 'limit' => $limit, - )); -} - -if ($list_type == 'list') { - if (is_array($entities) && sizeof($entities) > 0) { - $html .= '<ul class="elgg-entity-list elgg-list">'; - foreach ($entities as $entity) { - $html .= '<li>'; - $html .= elgg_view_entity($entity, $full_view); - $html .= '</li>'; - } - $html .= '</ul>'; - } -} else { - if (is_array($entities) && sizeof($entities) > 0) { - $html .= elgg_view('entities/gallery', array('entities' => $entities)); - } -} - -if ($count) { - $html .= $nav; -} - -echo $html; diff --git a/views/default/entities/list_item.php b/views/default/entities/list_item.php deleted file mode 100644 index 4b6636db7..000000000 --- a/views/default/entities/list_item.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Generic display for a single entity in list view. - * - * @package Elgg - * @subpackage Core - * - * @uses string $vars['icon'] Full icon HTML to display. - * @uses string $vars['info'] Info about the entity. - */ -?> -<div class="listing entity-listing"> - <div class="icon"> - <?php echo $vars['icon']; ?> - </div> - <div class="info"> - <?php echo $vars['info']; ?> - </div> -</div> diff --git a/views/default/errors/404.php b/views/default/errors/404.php new file mode 100644 index 000000000..8bc35acdd --- /dev/null +++ b/views/default/errors/404.php @@ -0,0 +1,8 @@ +<?php +/** + * Page not found error + */ + +$message = elgg_echo('error:404'); + +echo "<h2>$message</h2>"; diff --git a/views/default/errors/default.php b/views/default/errors/default.php new file mode 100644 index 000000000..a0582eba2 --- /dev/null +++ b/views/default/errors/default.php @@ -0,0 +1,8 @@ +<?php +/** + * General error + */ + +$message = elgg_echo('error:default'); + +echo "<h2>$message</h2>"; diff --git a/views/default/export/entity.php b/views/default/export/entity.php index 333179fbb..3064f1288 100644 --- a/views/default/export/entity.php +++ b/views/default/export/entity.php @@ -11,9 +11,12 @@ $entity = $vars['entity']; if (!$entity) { throw new InvalidParameterException(elgg_echo('InvalidParameterException:NoEntityFound')); } - -$metadata = get_metadata_for_entity($entity->guid); -$annotations = get_annotations($entity->guid); +$options = array( + 'guid' => $entity->guid, + 'limit' => 0 +); +$metadata = elgg_get_metadata($options); +$annotations = elgg_get_annotations($options); $relationships = get_entity_relationships($entity->guid); $exportable_values = $entity->getExportableValues(); @@ -22,7 +25,7 @@ $exportable_values = $entity->getExportableValues(); <h2><?php echo elgg_echo('Entity'); ?></h2> <?php foreach ($entity as $k => $v) { - if ((in_array($k, $exportable_values)) || (isadminloggedin())) { + if ((in_array($k, $exportable_values)) || (elgg_is_admin_logged_in())) { ?> <p class="margin-none"><b><?php echo $k; ?>: </b><?php echo strip_tags($v); ?></p> <?php @@ -32,7 +35,7 @@ $exportable_values = $entity->getExportableValues(); </div> <?php if ($metadata) { ?> -<div id="metadata" class="margin-top"> +<div id="metadata" class="mtm"> <h2><?php echo elgg_echo('metadata'); ?></h2> <?php foreach ($metadata as $m) { @@ -46,7 +49,7 @@ $exportable_values = $entity->getExportableValues(); <?php } ?> <?php if ($annotations) { ?> -<div id="annotations" class="margin-top"> +<div id="annotations" class="mtm"> <h2><?php echo elgg_echo('annotations'); ?></h2> <?php foreach ($annotations as $a) { @@ -61,7 +64,7 @@ $exportable_values = $entity->getExportableValues(); <?php } ?> <?php if ($relationships) { ?> -<div id="relationship" class="margin-top"> +<div id="relationship" class="mtm"> <h2><?php echo elgg_echo('relationships'); ?></h2> <?php foreach ($relationships as $r) { diff --git a/views/default/forms/account/settings.php b/views/default/forms/account/settings.php new file mode 100644 index 000000000..3967207ce --- /dev/null +++ b/views/default/forms/account/settings.php @@ -0,0 +1,10 @@ +<?php +/** + * Account settings form used for user settings + * + * This form is extended by Elgg with the views in core/settings/account. + * Plugins can additionally extend it and then register for the + * 'usersettings:save', 'user' plugin hook. + * + * This view is included by "forms/usersettings/save" + */ diff --git a/views/default/forms/admin/menu/save.php b/views/default/forms/admin/menu/save.php new file mode 100644 index 000000000..1a67ffcc4 --- /dev/null +++ b/views/default/forms/admin/menu/save.php @@ -0,0 +1,102 @@ +<?php +/** + * Form body for setting up site menu + */ + +// @todo Could probably make this number configurable +$num_featured_items = 6; + +// get site menu items +$menu = elgg_get_config('menus'); +$menu = $menu['site']; +$builder = new ElggMenuBuilder($menu); +$menu = $builder->getMenu('name'); +$menu_items = $menu['default']; + +$featured_menu_names = elgg_get_config('site_featured_menu_names'); + +$dropdown_values = array(); +foreach ($menu_items as $item) { + $dropdown_values[$item->getName()] = $item->getText(); +} +$dropdown_values[' '] = elgg_echo('none'); + +?> +<div class="elgg-module elgg-module-inline"> + <div class="elgg-head"> + <h3><?php echo elgg_echo('admin:menu_items:configure'); ?></h3> + </div> + <div class="elgg-body"> +<?php +echo elgg_view('output/longtext', array( + 'value' => elgg_echo("admin:menu_items:description") +)); + +for ($i=0; $i<$num_featured_items; $i++) { + if ($featured_menu_names && array_key_exists($i, $featured_menu_names)) { + $current_value = $featured_menu_names[$i]; + } else { + $current_value = ' '; + } + + echo elgg_view('input/dropdown', array( + 'options_values' => $dropdown_values, + 'name' => 'featured_menu_names[]', + 'value' => $current_value + )); +} +?> + </div> +</div> + +<div class="elgg-module elgg-module-inline"> + <div class="elgg-head"> + <h3><?php echo elgg_echo('admin:add_menu_item'); ?></h3> + </div> + <div class="elgg-body"> +<?php +echo elgg_view('output/longtext', array( + 'value' => elgg_echo("admin:add_menu_item:description") +)); + +$custom_items = elgg_get_config('site_custom_menu_items'); + +$name_str = elgg_echo('name'); +$url_str = elgg_echo('admin:plugins:label:website'); + +echo '<ul class="elgg-list elgg-list-simple">'; + +if (is_array($custom_items)) { + foreach ($custom_items as $title => $url) { + $name_input = elgg_view('input/text', array( + 'name' => 'custom_menu_titles[]', + 'value' => $title + )); + + $url_input = elgg_view('input/text', array( + 'name' => 'custom_menu_urls[]', + 'value' => $url + )); + + echo "<li>$name_str: $name_input $url_str: $url_input $delete</li>"; + } +} + +$new = elgg_echo('new'); +$name_input = elgg_view('input/text', array( + 'name' => 'custom_menu_titles[]', +)); + +$url_input = elgg_view('input/text', array( + 'name' => 'custom_menu_urls[]', +)); + +echo "<li class='custom_menuitem'>$name_str: $name_input $url_str: $url_input</li> +</ul>"; + +?> + </div> +</div> +<?php + +echo elgg_view('input/submit', array('value' => elgg_echo('save'))); diff --git a/views/default/forms/admin/plugins/change_state.php b/views/default/forms/admin/plugins/change_state.php new file mode 100644 index 000000000..730c8ff32 --- /dev/null +++ b/views/default/forms/admin/plugins/change_state.php @@ -0,0 +1,22 @@ +<?php +/** + * Activate/deactive all plugins specified by guids array + * + * @uses $vars['guids'] Array of GUIDs + * @uses $vars['action'] 'activate' or 'deactivate' + */ + +$guids = elgg_extract('guids', $vars, array()); +$guids = implode(',', $guids); + +echo '<div>'; +echo elgg_view('input/hidden', array( + 'name' => 'guids', + 'value' => $guids, +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo("admin:plugins:{$vars['action']}_all"), + 'class' => 'elgg-button elgg-button-action mrm' +)); +echo '</div>'; diff --git a/views/default/forms/admin/plugins/filter.php b/views/default/forms/admin/plugins/filter.php new file mode 100644 index 000000000..fd1b618bc --- /dev/null +++ b/views/default/forms/admin/plugins/filter.php @@ -0,0 +1,26 @@ +<?php +/** + * Category filter for plugins + * + * @uses $vars['category'] + * @uses $vars['category_options'] + * @uses $vvars['sort'] + */ + +echo '<div>'; +echo elgg_view('input/dropdown', array( + 'name' => 'category', + 'options_values' => $vars['category_options'], + 'value' => $vars['category'], +)); + +echo elgg_view('input/hidden', array( + 'name' => 'sort', + 'value' => $vars['sort'], +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo('filter'), + 'class' => 'elgg-button elgg-button-action', +)); +echo '</div>'; diff --git a/views/default/forms/admin/plugins/sort.php b/views/default/forms/admin/plugins/sort.php new file mode 100644 index 000000000..7f2246bad --- /dev/null +++ b/views/default/forms/admin/plugins/sort.php @@ -0,0 +1,26 @@ +<?php +/** + * Sort plugins form body + * + * @uses $vars['sort'] + * @uses $vars['sort_options'] + * @uses $vars['category'] + */ + +echo '<div class="mtm">'; +echo elgg_view('input/dropdown', array( + 'name' => 'sort', + 'options_values' => $vars['sort_options'], + 'value' => $vars['sort'], +)); + +echo elgg_view('input/hidden', array( + 'name' => 'category', + 'value' => $vars['category'], +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo('sort'), + 'class' => 'elgg-button elgg-button-action' +)); +echo '</div>'; diff --git a/views/default/forms/admin/site/regenerate_secret.php b/views/default/forms/admin/site/regenerate_secret.php new file mode 100644 index 000000000..af269b801 --- /dev/null +++ b/views/default/forms/admin/site/regenerate_secret.php @@ -0,0 +1,24 @@ +<?php + +$strength = $vars['strength']; + +?> +<p><?php echo elgg_echo('admin:site:secret:intro'); ?></p> + +<table class="elgg-table"> + <tr> + <th><?php echo elgg_echo('site_secret:current_strength'); ?></th> + <td class="elgg-strength-<?php echo $strength; ?>"> + <h4><?php echo elgg_echo("site_secret:strength:$strength"); ?></h4> + <div><?php echo elgg_echo("site_secret:strength_msg:$strength"); ?></div> + </td> + </tr> +</table> + +<div class="elgg-foot"> + <?php echo elgg_view('input/submit', array( + 'value' => elgg_echo('admin:site:secret:regenerate'), + 'class' => 'elgg-requires-confirmation elgg-button elgg-button-submit', + )); ?> + <p class="elgg-text-help mts"><?php echo elgg_echo('admin:site:secret:regenerate:help'); ?></p> +</div> diff --git a/views/default/forms/admin/site/update_advanced.php b/views/default/forms/admin/site/update_advanced.php new file mode 100644 index 000000000..14b74e4f9 --- /dev/null +++ b/views/default/forms/admin/site/update_advanced.php @@ -0,0 +1,101 @@ +<?php +/** + * @todo cleanup + */ +$form_body = ""; + +foreach (array('wwwroot', 'path', 'dataroot') as $field) { + $form_body .= "<div>"; + $form_body .= elgg_echo('installation:' . $field) . "<br />"; + $warning = elgg_echo('installation:warning:' . $field); + if ($warning != 'installation:warning:' . $field) { + echo "<b>" . $warning . "</b><br />"; + } + $value = elgg_get_config($field); + $form_body .= elgg_view("input/text",array('name' => $field, 'value' => $value)); + $form_body .= "</div>"; +} + +$form_body .= "<div>" . elgg_echo('admin:site:access:warning') . "<br />"; +$form_body .= "<label>" . elgg_echo('installation:sitepermissions') . "</label>"; +$form_body .= elgg_view('input/access', array( + 'options_values' => array( + ACCESS_PRIVATE => elgg_echo("PRIVATE"), + ACCESS_FRIENDS => elgg_echo("access:friends:label"), + ACCESS_LOGGED_IN => elgg_echo("LOGGED_IN"), + ACCESS_PUBLIC => elgg_echo("PUBLIC") + ), + 'name' => 'default_access', + 'value' => elgg_get_config('default_access'), +)) . "</div>"; +$form_body .= "<div>" . elgg_echo('installation:allow_user_default_access:description') . "<br />"; +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:allow_user_default_access:label') => 1), + 'name' => 'allow_user_default_access', + 'value' => (elgg_get_config('allow_user_default_access') ? 1 : 0), +)) . "</div>"; +$form_body .= "<div>" . elgg_echo('installation:simplecache:description') . "<br />"; +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:simplecache:label') => 1), + 'name' => 'simplecache_enabled', + 'value' => (elgg_get_config('simplecache_enabled') ? 1 : 0), +)) . "</div>"; +$form_body .= "<div>" . elgg_echo('installation:systemcache:description') . "<br />"; +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:systemcache:label') => 1), + 'name' => 'system_cache_enabled', + 'value' => (elgg_get_config('system_cache_enabled') ? 1 : 0), +)) . "</div>"; + +$debug_options = array('0' => elgg_echo('installation:debug:none'), 'ERROR' => elgg_echo('installation:debug:error'), 'WARNING' => elgg_echo('installation:debug:warning'), 'NOTICE' => elgg_echo('installation:debug:notice')); +$form_body .= "<div>" . elgg_echo('installation:debug'); +$form_body .= elgg_view('input/dropdown', array( + 'options_values' => $debug_options, + 'name' => 'debug', + 'value' => elgg_get_config('debug'), +)); +$form_body .= '</div>'; + +// control new user registration +$options = array( + 'options' => array(elgg_echo('installation:registration:label') => 1), + 'name' => 'allow_registration', + 'value' => elgg_get_config('allow_registration') ? 1 : 0, +); +$form_body .= '<div>' . elgg_echo('installation:registration:description'); +$form_body .= '<br />' .elgg_view('input/checkboxes', $options) . '</div>'; + +// control walled garden +$walled_garden = elgg_get_config(walled_garden); +$options = array( + 'options' => array(elgg_echo('installation:walled_garden:label') => 1), + 'name' => 'walled_garden', + 'value' => $walled_garden ? 1 : 0, +); +$form_body .= '<div>' . elgg_echo('installation:walled_garden:description'); +$form_body .= '<br />' . elgg_view('input/checkboxes', $options) . '</div>'; + +$form_body .= "<div>" . elgg_echo('installation:httpslogin') . "<br />"; +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:httpslogin:label') => 1), + 'name' => 'https_login', + 'value' => (elgg_get_config('https_login') ? 1 : 0) +)) . "</div>"; + +$form_body .= "<div>" . elgg_echo('installation:disableapi') . "<br />"; +$disable_api = elgg_get_config('disable_api'); +$on = $disable_api ? 0 : 1; +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:disableapi:label') => 1), + 'name' => 'api', + 'value' => $on, +)); +$form_body .= "</div>"; + +$form_body .= elgg_view('input/hidden', array('name' => 'settings', 'value' => 'go')); + +$form_body .= '<div class="elgg-foot">'; +$form_body .= elgg_view('input/submit', array('value' => elgg_echo("save"))); +$form_body .= '</div>'; + +echo $form_body; diff --git a/views/default/forms/admin/site/update_basic.php b/views/default/forms/admin/site/update_basic.php new file mode 100644 index 000000000..88870bc60 --- /dev/null +++ b/views/default/forms/admin/site/update_basic.php @@ -0,0 +1,31 @@ +<?php +/** + * @todo cleanup + */ +$form_body = ""; + +foreach (array('sitename','sitedescription', 'siteemail') as $field) { + $form_body .= "<div>"; + $form_body .= elgg_echo('installation:' . $field) . "<br />"; + $warning = elgg_echo('installation:warning:' . $field); + if ($warning != 'installation:warning:' . $field) { + echo "<b>" . $warning . "</b><br />"; + } + $value = elgg_get_config($field); + $form_body .= elgg_view("input/text",array('name' => $field, 'value' => $value)); + $form_body .= "</div>"; +} + +$languages = get_installed_translations(); +$form_body .= "<div>" . elgg_echo('installation:language'); +$form_body .= elgg_view("input/dropdown", array( + 'name' => 'language', + 'value' => elgg_get_config('language'), + 'options_values' => $languages, +)) . "</div>"; + +$form_body .= '<div class="elgg-foot">'; +$form_body .= elgg_view('input/submit', array('value' => elgg_echo("save"))); +$form_body .= '</div>'; + +echo $form_body;
\ No newline at end of file diff --git a/views/default/forms/avatar/crop.php b/views/default/forms/avatar/crop.php new file mode 100644 index 000000000..3e798cb27 --- /dev/null +++ b/views/default/forms/avatar/crop.php @@ -0,0 +1,42 @@ +<?php +/** + * Avatar crop form + * + * @uses $vars['entity'] + */ + +elgg_load_js('jquery.imgareaselect'); +elgg_load_js('elgg.avatar_cropper'); +elgg_load_css('jquery.imgareaselect'); + +$master_img = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('master'), + 'alt' => elgg_echo('avatar'), + 'class' => 'mrl', + 'id' => 'user-avatar-cropper', +)); + +$preview_img = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('master'), + 'alt' => elgg_echo('avatar'), +)); + +?> +<div class="clearfix"> + <?php echo $master_img; ?> + <div id="user-avatar-preview-title"><label><?php echo elgg_echo('avatar:preview'); ?></label></div> + <div id="user-avatar-preview"><?php echo $preview_img; ?></div> +</div> +<div class="elgg-foot"> +<?php +$coords = array('x1', 'x2', 'y1', 'y2'); +foreach ($coords as $coord) { + echo elgg_view('input/hidden', array('name' => $coord, 'value' => $vars['entity']->$coord)); +} + +echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity']->guid)); + +echo elgg_view('input/submit', array('value' => elgg_echo('avatar:create'))); + +?> +</div> diff --git a/views/default/forms/avatar/upload.php b/views/default/forms/avatar/upload.php new file mode 100644 index 000000000..d91e8575e --- /dev/null +++ b/views/default/forms/avatar/upload.php @@ -0,0 +1,16 @@ +<?php +/** + * Avatar upload form + * + * @uses $vars['entity'] + */ + +?> +<div> + <label><?php echo elgg_echo("avatar:upload"); ?></label><br /> + <?php echo elgg_view("input/file",array('name' => 'avatar')); ?> +</div> +<div class="elgg-foot"> + <?php echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity']->guid)); ?> + <?php echo elgg_view('input/submit', array('value' => elgg_echo('upload'))); ?> +</div> diff --git a/views/default/forms/comments/add.php b/views/default/forms/comments/add.php index 74ee5ba4b..9acabf3ea 100644 --- a/views/default/forms/comments/add.php +++ b/views/default/forms/comments/add.php @@ -4,20 +4,34 @@ * * @package Elgg * - * @uses $vars['entity'] + * @uses ElggEntity $vars['entity'] The entity to comment on + * @uses bool $vars['inline'] Show a single line version of the form? */ -if (isset($vars['entity']) && isloggedin()) { + +if (isset($vars['entity']) && elgg_is_logged_in()) { + + $inline = elgg_extract('inline', $vars, false); + + if ($inline) { + echo elgg_view('input/text', array('name' => 'generic_comment')); + echo elgg_view('input/submit', array('value' => elgg_echo('comment'))); + } else { ?> -<p class="mbn"> - <label><?php echo elgg_echo("generic_comments:text"); ?></label> - <?php echo elgg_view('input/longtext', array('internalname' => 'generic_comment')); ?> -</p> + <div> + <label><?php echo elgg_echo("generic_comments:add"); ?></label> + <?php echo elgg_view('input/longtext', array('name' => 'generic_comment')); ?> + </div> + <div class="elgg-foot"> <?php - + echo elgg_view('input/submit', array('value' => elgg_echo("generic_comments:post"))); +?> + </div> +<?php + } + echo elgg_view('input/hidden', array( - 'internalname' => 'entity_guid', + 'name' => 'entity_guid', 'value' => $vars['entity']->getGUID() )); - echo elgg_view('input/submit', array('value' => elgg_echo("generic_comments:post"))); } diff --git a/views/default/forms/friends/collections/add.php b/views/default/forms/friends/collections/add.php new file mode 100644 index 000000000..04c87346b --- /dev/null +++ b/views/default/forms/friends/collections/add.php @@ -0,0 +1,53 @@ +<?php +/** + * Form body for editing or adding a friend collection + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['collection'] Optionally, the collection to edit + */ + +// Set title, form destination +if (isset($vars['collection'])) { + $title = $vars['collection']->name; + $highlight = 'default'; +} else { + $title = ""; + $highlight = 'all'; +} + +echo "<div class=\"mtm\"><label>" . elgg_echo("friends:collectionname") . "<br/>"; +echo elgg_view("input/text", array( + "name" => "collection_name", + "value" => $title, + )); +echo "</label></div>"; + +echo "<div>"; +if ($vars['collection_members']) { + echo elgg_echo("friends:collectionfriends") . "<br />"; + foreach ($vars['collection_members'] as $mem) { + echo elgg_view_entity_icon($mem, 'tiny'); + echo $mem->name; + } +} +echo "</div>"; + +echo "<div><label>" . elgg_echo("friends:addfriends") . "</label>"; +echo elgg_view('input/friendspicker', array( + 'entities' => $vars['friends'], + 'name' => 'friends_collection', + 'highlight' => $highlight, +)); +echo "</div>"; + +echo '<div class="elgg-foot">'; +if (isset($vars['collection'])) { + echo elgg_view('input/hidden', array( + 'name' => 'collection_id', + 'value' => $vars['collection']->id, + )); +} +echo elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('save'))); +echo '</div>'; diff --git a/views/default/forms/login.php b/views/default/forms/login.php new file mode 100644 index 000000000..d2c6e6221 --- /dev/null +++ b/views/default/forms/login.php @@ -0,0 +1,49 @@ +<?php +/** + * Elgg login form + * + * @package Elgg + * @subpackage Core + */ +?> + +<div> + <label><?php echo elgg_echo('loginusername'); ?></label> + <?php echo elgg_view('input/text', array( + 'name' => 'username', + 'class' => 'elgg-autofocus', + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('password'); ?></label> + <?php echo elgg_view('input/password', array('name' => 'password')); ?> +</div> + +<?php echo elgg_view('login/extend', $vars); ?> + +<div class="elgg-foot"> + <label class="mtm float-alt"> + <input type="checkbox" name="persistent" value="true" /> + <?php echo elgg_echo('user:persistent'); ?> + </label> + + <?php echo elgg_view('input/submit', array('value' => elgg_echo('login'))); ?> + + <?php + if (isset($vars['returntoreferer'])) { + echo elgg_view('input/hidden', array('name' => 'returntoreferer', 'value' => 'true')); + } + ?> + + <ul class="elgg-menu elgg-menu-general mtm"> + <?php + if (elgg_get_config('allow_registration')) { + echo '<li><a class="registration_link" href="' . elgg_get_site_url() . 'register">' . elgg_echo('register') . '</a></li>'; + } + ?> + <li><a class="forgot_link" href="<?php echo elgg_get_site_url(); ?>forgotpassword"> + <?php echo elgg_echo('user:password:lost'); ?> + </a></li> + </ul> +</div> diff --git a/views/default/forms/members/name_search.php b/views/default/forms/members/name_search.php new file mode 100644 index 000000000..5f6b9a4b6 --- /dev/null +++ b/views/default/forms/members/name_search.php @@ -0,0 +1,9 @@ +<?php + +$params = array( + 'name' => 'name', + 'class' => 'mbm', +); +echo elgg_view('input/text', $params); + +echo elgg_view('input/submit', array('value' => elgg_echo('search'))); diff --git a/views/default/forms/members/tag_search.php b/views/default/forms/members/tag_search.php new file mode 100644 index 000000000..4fe9bb32a --- /dev/null +++ b/views/default/forms/members/tag_search.php @@ -0,0 +1,12 @@ +<?php +/** + * Simple members search by tag form + */ + +$params = array( + 'name' => 'tag', + 'class' => 'mbm', +); +echo elgg_view('input/text', $params); + +echo elgg_view('input/submit', array('value' => elgg_echo('search'))); diff --git a/views/default/forms/plugins/settings/save.php b/views/default/forms/plugins/settings/save.php new file mode 100644 index 000000000..116529905 --- /dev/null +++ b/views/default/forms/plugins/settings/save.php @@ -0,0 +1,31 @@ +<?php +/** + * Used to show plugin settings for both users and admins. + * + * @package Elgg.Core + * @subpackage Plugins + */ + +$plugin = $vars['entity']; +$plugin_id = $plugin->getID(); +$user_guid = elgg_extract('user_guid', $vars, elgg_get_logged_in_user_guid()); + +// Do we want to show admin settings or user settings +$type = elgg_extract('type', $vars, ''); + +if ($type != 'user') { + $type = ''; +} + +if (elgg_view_exists("plugins/$plugin_id/{$type}settings")) { + echo elgg_view("plugins/$plugin_id/{$type}settings", $vars); +} elseif (elgg_view_exists("{$type}settings/$plugin_id/edit")) { + elgg_deprecated_notice("{$type}settings/$plugin_id/edit was deprecated in favor of plugins/$plugin_id/{$type}settings", 1.8); + echo elgg_view("{$type}settings/$plugin_id/edit", $vars); +} + +echo '<div class="elgg-foot">'; +echo elgg_view('input/hidden', array('name' => 'plugin_id', 'value' => $plugin_id)); +echo elgg_view('input/hidden', array('name' => 'user_guid', 'value' => $user_guid)); +echo elgg_view('input/submit', array('value' => elgg_echo('save'))); +echo '</div>'; diff --git a/views/default/forms/plugins/usersettings/save.php b/views/default/forms/plugins/usersettings/save.php new file mode 100644 index 000000000..ced88f818 --- /dev/null +++ b/views/default/forms/plugins/usersettings/save.php @@ -0,0 +1,14 @@ +<?php +/** + * Plugin user settings + * + * Calls the plugin admin settings form body with type set to 'user' + * + * @package Elgg.Core + * @subpackage Plugins + */ + +$vars['type'] = 'user'; + +// Can't use elgg_view_form() because it overrides the $vars['action'] parameter +echo elgg_view('forms/plugins/settings/save', $vars);
\ No newline at end of file diff --git a/views/default/forms/profile/edit.php b/views/default/forms/profile/edit.php new file mode 100644 index 000000000..cb0a37ca4 --- /dev/null +++ b/views/default/forms/profile/edit.php @@ -0,0 +1,81 @@ +<?php +/** + * Edit profile form + * + * @uses vars['entity'] + */ + +?> + +<div> + <label><?php echo elgg_echo('user:name:label'); ?></label> + <?php echo elgg_view('input/text', array('name' => 'name', 'value' => $vars['entity']->name)); ?> +</div> +<?php + +$sticky_values = elgg_get_sticky_values('profile:edit'); + +$profile_fields = elgg_get_config('profile_fields'); +if (is_array($profile_fields) && count($profile_fields) > 0) { + foreach ($profile_fields as $shortname => $valtype) { + $metadata = elgg_get_metadata(array( + 'guid' => $vars['entity']->guid, + 'metadata_name' => $shortname, + 'limit' => false + )); + if ($metadata) { + if (is_array($metadata)) { + $value = ''; + foreach ($metadata as $md) { + if (!empty($value)) { + $value .= ', '; + } + $value .= $md->value; + $access_id = $md->access_id; + } + } else { + $value = $metadata->value; + $access_id = $metadata->access_id; + } + } else { + $value = ''; + $access_id = ACCESS_DEFAULT; + } + + // sticky form values take precedence over saved ones + if (isset($sticky_values[$shortname])) { + $value = $sticky_values[$shortname]; + } + if (isset($sticky_values['accesslevel'][$shortname])) { + $access_id = $sticky_values['accesslevel'][$shortname]; + } + +?> +<div> + <label><?php echo elgg_echo("profile:{$shortname}") ?></label> + <?php + $params = array( + 'name' => $shortname, + 'value' => $value, + ); + echo elgg_view("input/{$valtype}", $params); + $params = array( + 'name' => "accesslevel[$shortname]", + 'value' => $access_id, + ); + echo elgg_view('input/access', $params); + ?> +</div> +<?php + } +} + +elgg_clear_sticky_form('profile:edit'); + +?> +<div class="elgg-foot"> +<?php + echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity']->guid)); + echo elgg_view('input/submit', array('value' => elgg_echo('save'))); +?> +</div> diff --git a/views/default/forms/profile/fields/add.php b/views/default/forms/profile/fields/add.php new file mode 100644 index 000000000..2087ec299 --- /dev/null +++ b/views/default/forms/profile/fields/add.php @@ -0,0 +1,29 @@ +<?php +/** + * Add a new field to the set of custom profile fields + */ + +$label_text = elgg_echo('profile:label'); +$type_text = elgg_echo('profile:type'); + +$label_control = elgg_view('input/text', array('name' => 'label')); +$type_control = elgg_view('input/dropdown', array('name' => 'type', 'options_values' => array( + 'text' => elgg_echo('profile:field:text'), + 'longtext' => elgg_echo('profile:field:longtext'), + 'tags' => elgg_echo('profile:field:tags'), + 'url' => elgg_echo('profile:field:url'), + 'email' => elgg_echo('profile:field:email'), + 'location' => elgg_echo('profile:field:location'), + 'date' => elgg_echo('profile:field:date'), +))); + +$submit_control = elgg_view('input/submit', array('name' => elgg_echo('add'), 'value' => elgg_echo('add'))); + +$formbody = <<< END + <div>$label_text: $label_control</div> + <div class="elgg-foot">$type_text: $type_control + $submit_control</div> +END; + +echo elgg_autop(elgg_echo('profile:explainchangefields')); +echo $formbody; diff --git a/views/default/forms/register.php b/views/default/forms/register.php new file mode 100644 index 000000000..c0ee66f76 --- /dev/null +++ b/views/default/forms/register.php @@ -0,0 +1,80 @@ +<?php +/** + * Elgg register form + * + * @package Elgg + * @subpackage Core + */ + +elgg_load_js('elgg.register'); + +$password = $password2 = ''; +$username = get_input('u'); +$email = get_input('e'); +$name = get_input('n'); + +if (elgg_is_sticky_form('register')) { + extract(elgg_get_sticky_values('register')); + elgg_clear_sticky_form('register'); +} + +?> +<div class="mtm"> + <label><?php echo elgg_echo('name'); ?></label><br /> + <?php + echo elgg_view('input/text', array( + 'name' => 'name', + 'value' => $name, + 'class' => 'elgg-autofocus', + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('email'); ?></label><br /> + <?php + echo elgg_view('input/text', array( + 'name' => 'email', + 'value' => $email, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('username'); ?></label><br /> + <?php + echo elgg_view('input/text', array( + 'name' => 'username', + 'value' => $username, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('password'); ?></label><br /> + <?php + echo elgg_view('input/password', array( + 'name' => 'password', + 'value' => $password, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('passwordagain'); ?></label><br /> + <?php + echo elgg_view('input/password', array( + 'name' => 'password2', + 'value' => $password2, + )); + ?> +</div> + +<?php +// view to extend to add more fields to the registration form +echo elgg_view('register/extend', $vars); + +// Add captcha hook +echo elgg_view('input/captcha', $vars); + +echo '<div class="elgg-foot">'; +echo elgg_view('input/hidden', array('name' => 'friend_guid', 'value' => $vars['friend_guid'])); +echo elgg_view('input/hidden', array('name' => 'invitecode', 'value' => $vars['invitecode'])); +echo elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('register'))); +echo '</div>'; diff --git a/views/default/forms/user/passwordreset.php b/views/default/forms/user/passwordreset.php new file mode 100644 index 000000000..5946fa7c0 --- /dev/null +++ b/views/default/forms/user/passwordreset.php @@ -0,0 +1,20 @@ +<?php +/** + * Reset user password form + */ + +echo elgg_autop(elgg_echo('user:resetpassword:reset_password_confirm')); + +echo elgg_view('input/hidden', array( + 'name' => 'u', + 'value' => $vars['guid'], +)); + +echo elgg_view('input/hidden', array( + 'name' => 'c', + 'value' => $vars['code'], +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo('resetpassword') +)); diff --git a/views/default/forms/user/requestnewpassword.php b/views/default/forms/user/requestnewpassword.php new file mode 100644 index 000000000..c90971eaf --- /dev/null +++ b/views/default/forms/user/requestnewpassword.php @@ -0,0 +1,24 @@ +<?php +/** + * Elgg forgotten password. + * + * @package Elgg + * @subpackage Core + */ +?> + +<div class="mtm"> + <?php echo elgg_echo('user:password:text'); ?> +</div> +<div> + <label><?php echo elgg_echo('loginusername'); ?></label><br /> + <?php echo elgg_view('input/text', array( + 'name' => 'username', + 'class' => 'elgg-autofocus', + )); + ?> +</div> +<?php echo elgg_view('input/captcha'); ?> +<div class="elgg-foot"> + <?php echo elgg_view('input/submit', array('value' => elgg_echo('request'))); ?> +</div> diff --git a/views/default/forms/useradd.php b/views/default/forms/useradd.php new file mode 100644 index 000000000..4f337e4e4 --- /dev/null +++ b/views/default/forms/useradd.php @@ -0,0 +1,78 @@ +<?php +/** + * Elgg add user form. + * + * @package Elgg + * @subpackage Core + * + */ + +$name = $username = $email = $password = $password2 = $admin = ''; + +if (elgg_is_sticky_form('useradd')) { + extract(elgg_get_sticky_values('useradd')); + elgg_clear_sticky_form('useradd'); + if (is_array($admin)) { + $admin = $admin[0]; + } +} + +?> +<div> + <label><?php echo elgg_echo('name');?></label><br /> + <?php + echo elgg_view('input/text', array( + 'name' => 'name', + 'value' => $name, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('username'); ?></label><br /> + <?php + echo elgg_view('input/text', array( + 'name' => 'username', + 'value' => $username, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('email'); ?></label><br /> + <?php + echo elgg_view('input/text', array( + 'name' => 'email', + 'value' => $email, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('password'); ?></label><br /> + <?php + echo elgg_view('input/password', array( + 'name' => 'password', + 'value' => $password, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('passwordagain'); ?></label><br /> + <?php + echo elgg_view('input/password', array( + 'name' => 'password2', + 'value' => $password2, + )); + ?> +</div> +<div> +<?php + echo elgg_view('input/checkboxes', array( + 'name' => "admin", + 'options' => array(elgg_echo('admin_option') => 1), + 'value' => $admin, + )); +?> +</div> + +<div class="elgg-foot"> + <?php echo elgg_view('input/submit', array('value' => elgg_echo('register'))); ?> +</div>
\ No newline at end of file diff --git a/views/default/forms/usersettings/save.php b/views/default/forms/usersettings/save.php new file mode 100644 index 000000000..71323083f --- /dev/null +++ b/views/default/forms/usersettings/save.php @@ -0,0 +1,14 @@ +<?php +/** + * User account settings. + * + * Plugins should extend "forms/account/settings" to add to the settings. + */ + +$form_body = elgg_view("forms/account/settings", $vars); + +$form_body .= '<div class="elgg-foot">'; +$form_body .= elgg_view('input/submit', array('value' => elgg_echo('save'))); +$form_body .= '</div>'; + +echo $form_body;
\ No newline at end of file diff --git a/views/default/forms/widgets/save.php b/views/default/forms/widgets/save.php new file mode 100644 index 000000000..6959b2a82 --- /dev/null +++ b/views/default/forms/widgets/save.php @@ -0,0 +1,41 @@ +<?php +/** + * Elgg widget edit settings + * + * @uses $vars['widget'] + * @uses $vars['show_access'] + */ + +$widget = $vars['widget']; +$show_access = elgg_extract('show_access', $vars, true); + +$edit_view = "widgets/$widget->handler/edit"; +$custom_form_section = elgg_view($edit_view, array('entity' => $widget)); + +$access = ''; +if ($show_access) { + $access = elgg_echo('access') . ': ' . elgg_view('input/access', array( + 'name' => 'params[access_id]', + 'value' => $widget->access_id, + )); +} + +if (!$custom_form_section && !$access) { + return true; +} + +$hidden = elgg_view('input/hidden', array('name' => 'guid', 'value' => $widget->guid)); +$submit = elgg_view('input/submit', array('value' => elgg_echo('save'))); + +$body = <<<___END + $custom_form_section + <div> + $access + </div> + <div class="elgg-foot"> + $hidden + $submit + </div> +___END; + +echo $body; diff --git a/views/default/friends/collection.php b/views/default/friends/collection.php deleted file mode 100644 index 665e6d34d..000000000 --- a/views/default/friends/collection.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * Elgg friends collection - * Lists one of a user's friends collections - * - * @package Elgg - * @subpackage Core - * - * @see collections.php - * - * @uses $vars['collection'] The individual friends collection - */ - -$coll = $vars['collection']; - -if (is_array($vars['collection']->members)) { - $count = sizeof($vars['collection']->members); -} else { - $count = 0; -} - -echo "<li><h2>"; - -//as collections are private, check that the logged in user is the owner -if ($coll->owner_guid == get_loggedin_userid()) { - echo "<div class=\"friends_collections_controls\">"; - echo elgg_view('output/confirmlink', array( - 'href' => 'action/friends/deletecollection?collection=' . $coll->id, - 'class' => 'delete_collection' - )); - echo "</div>"; -} -echo $coll->name; -echo " (<span id=\"friends_membership_count{$vars['friendspicker']}\">{$count}</span>) </h2>"; - -// individual collection panels -if ($friends = $vars['collection']->entities) { - $content = elgg_view('friends/collectiontabs', array('owner' => get_loggedin_user(), 'collection' => $vars['collection'], 'friendspicker' => $vars['friendspicker'])); - - echo elgg_view('friends/picker',array('entities' => $friends, 'value' => $members, 'content' => $content, 'replacement' => '', 'friendspicker' => $vars['friendspicker'])); - ?> - - <script type="text/javascript"> - $(document).ready(function () { - - $('#friends-picker_placeholder<?php echo $vars['friendspicker']; ?>').load('<?php echo elgg_get_site_url(); ?>pages/friends/pickercallback.php?username=<?php echo get_loggedin_user()->username; ?>&type=list&collection=<?php echo $vars['collection']->id; ?>'); - - }); - </script> - <?php -} - -// close friends-picker div and the accordian list item -echo "</li>"; diff --git a/views/default/friends/collectiontabs.php b/views/default/friends/collectiontabs.php deleted file mode 100644 index 6aef4bf1e..000000000 --- a/views/default/friends/collectiontabs.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php -/** - * Elgg friends collections - * Lists a user's friends collections - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['collections'] The array of friends collections - */ - -$friendspicker = $vars['friendspicker']; - -$collectionid = $vars['collection']->id; -$ownerid = $vars['owner']->getGUID(); - -?> - -<div id="elgg-horizontal-tabbed-nav"> -<ul> -<li class="selected"><a href="#" class="collectionmembers<?php echo $friendspicker; ?>"><?php echo elgg_echo('friends:collections:members'); ?></a></li> - -<li><a href="#" class="editmembers<?php echo $friendspicker; ?>"><?php echo elgg_echo('friends:collections:edit'); ?></a></li> - -</ul> -</div> - -<script type="text/javascript"> -$(document).ready(function () { - - $('a.collectionmembers<?php echo $friendspicker; ?>').click(function () { - // load collection members pane - $('#friends-picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo elgg_get_site_url(); ?>pages/friends/pickercallback.php?username=<?php echo get_loggedin_user()->username; ?>&type=list&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>'); - - // remove selected state from previous tab - $(this).parent().parent().find("li.selected").removeClass("selected"); - // add selected class to current tab - $(this).parent().addClass("selected"); - - return false; - }); - - $('a.editmembers<?php echo $friendspicker; ?>').click(function () { - // load friends picker pane - $('#friends-picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo elgg_get_site_url(); ?>pages/friends/pickercallback.php?username=<?php echo get_loggedin_user()->username; ?>&type=picker&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>'); - - // remove selected state from previous tab - $(this).parent().parent().find("li.selected").removeClass("selected"); - // add selected class to current tab - $(this).parent().addClass("selected"); - - return false; - }); - - -}); -</script> diff --git a/views/default/friends/forms/collectionfields.php b/views/default/friends/forms/collectionfields.php deleted file mode 100644 index 35db3a962..000000000 --- a/views/default/friends/forms/collectionfields.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -/** - * Elgg friend collections required hidden fields for js friends picker form - * - * @package Elgg - * @subpackage Core - */ - -if (isset($vars['collection'])) { -?> - - <input type="hidden" name="collection_id" value="<?php echo $vars['collection']->id; ?>" /> - -<?php -}
\ No newline at end of file diff --git a/views/default/friends/forms/edit.php b/views/default/friends/forms/edit.php deleted file mode 100644 index 632268fb8..000000000 --- a/views/default/friends/forms/edit.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * Elgg friend collections add/edit - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['object'] Optionally, the collection edit - */ - -// var_export($vars['collection'][0]->id); - -// Set title, form destination -if (isset($vars['collection'])) { - $action = "friends/editcollection"; - $title = $vars['collection'][0]->name; - $highlight = 'default'; -} else { - $action = "friends/addcollection"; - $title = ""; - $highlight = 'all'; -} - - -$form_body = "<div class='contentWrapper'><p><label>" . elgg_echo("friends:collectionname") . "<br />" . - elgg_view("input/text", array( - "internalname" => "collection_name", - "value" => $title, - )) . "</label></p>"; - -$form_body .= "<p>"; - -if($vars['collection_members']){ - $form_body .= elgg_echo("friends:collectionfriends") . "<br />"; - foreach($vars['collection_members'] as $mem){ - $form_body .= elgg_view("profile/icon",array('entity' => $mem, 'size' => 'tiny')); - $form_body .= $mem->name; - } -} - -$form_body .= "</p>"; - -$form_body .= "<p><label>" . elgg_echo("friends:addfriends") . "</label>". - elgg_view('friends/picker',array('entities' => $vars['friends'], 'internalname' => 'friends_collection', 'highlight' => $highlight)) . "</p>"; - -$form_body .= "<p>"; -if (isset($vars['collection'])) { - $form_body .= elgg_view('input/hidden', array('internalname' => 'collection_id', 'value' => "{$vars['collection'][0]->id}")); -} -$form_body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save'))); -$form_body .= "</p></div>"; - -echo elgg_view('input/form', array('body' => $form_body, 'action' => "action/$action"));
\ No newline at end of file diff --git a/views/default/friends/river/create.php b/views/default/friends/river/create.php deleted file mode 100644 index d7a751945..000000000 --- a/views/default/friends/river/create.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php -/** - * Elgg create new friend river item - * - * @package Elgg - * - * @uses $vars['entity'] - */ -$performed_by = get_entity($vars['item']->subject_guid); -$performed_on = get_entity($vars['item']->object_guid); - -$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; -$string = elgg_echo("friends:river:add", array($url)) . " "; -$string .= "<a href=\"{$performed_on->getURL()}\">{$performed_on->name}</a>"; -$string .= "<div class=\"river_content_display\">"; -$string .= "<table><tr><td>" . elgg_view("profile/icon",array('entity' => $performed_by, 'size' => 'tiny')) . "</td>"; -$string .= "<td><div class=\"following_icon\"></div></td><td>" . elgg_view("profile/icon",array('entity' => $performed_on, 'size' => 'tiny')) . "</td></tr></table>"; -$string .= "</div>"; - -echo $string; diff --git a/views/default/graphics/ajax_loader.php b/views/default/graphics/ajax_loader.php new file mode 100644 index 000000000..d5ce87ea9 --- /dev/null +++ b/views/default/graphics/ajax_loader.php @@ -0,0 +1,32 @@ +<?php +/** + * Elgg AJAX loader + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['id'] CSS id + * @uses $vars['class'] Optional additional CSS class + * @uses $vars['hidden'] Begin hidden? (true) + */ + +if (isset($vars['id'])) { + $id = "id=\"{$vars['id']}\""; +} + +$class = 'elgg-ajax-loader'; +if (isset($vars['class'])) { + $class = "$class {$vars['class']}"; +} + +if (elgg_extract('hidden', $vars, true)) { + $class = "$class hidden"; +} + +$loader = <<< END + +<div class="$class" $id></div> + +END; + +echo $loader;
\ No newline at end of file diff --git a/views/default/graphics/icon.php b/views/default/graphics/icon.php deleted file mode 100644 index 226287d6e..000000000 --- a/views/default/graphics/icon.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * Generic icon view. - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['entity'] The entity the icon represents - uses getIcon() method - * @uses $vars['js'] Any JavaScript to add to img tag - * @uses $vars['size'] topbar, tiny, small, medium (default), large, master - * @uses $vars['link'] Optional link for the image - * @uses $vars['align'] Align attribute of the img tag - */ - -$entity = $vars['entity']; - -$sizes = array('small','medium','large','tiny','master','topbar'); -// Get size -if (!in_array($vars['size'], $sizes)) { - $vars['size'] = "medium"; -} - -// Get any align and js -if (!empty($vars['align'])) { - $align = " align=\"{$vars['align']}\" "; -} else { - $align = ""; -} - - -?> -<div class="icon"> -<?php -if ($vars['link']) { - ?><a href="<?php echo $vars['link'] ?>"><?php -} -?> -<img src="<?php echo $entity->getIcon($vars['size']); ?>" border="0" <?php echo $align; ?> <?php echo $vars['js']; ?> /> -<?php -if ($vars['link']) { - ?></a><?php -} -?> -</div>
\ No newline at end of file diff --git a/views/default/group/default.php b/views/default/group/default.php index 662baef92..383a25c49 100644 --- a/views/default/group/default.php +++ b/views/default/group/default.php @@ -7,4 +7,3 @@ */ echo elgg_view('object/default', $vars); -?>
\ No newline at end of file diff --git a/views/default/group/elements/summary.php b/views/default/group/elements/summary.php new file mode 100644 index 000000000..395ed5292 --- /dev/null +++ b/views/default/group/elements/summary.php @@ -0,0 +1,13 @@ +<?php +/** + * Group summary + * + * @uses $vars['entity'] ElggEntity + * @uses $vars['title'] Title link (optional) false = no title, '' = default + * @uses $vars['metadata'] HTML for entity metadata and actions (optional) + * @uses $vars['subtitle'] HTML for the subtitle (optional) + * @uses $vars['tags'] HTML for the tags (optional) + * @uses $vars['content'] HTML for the entity content (optional) + */ + +echo elgg_view('object/elements/summary', $vars); diff --git a/views/default/group/search/finishblurb.php b/views/default/group/search/finishblurb.php index a21f95881..ceaeb0ff0 100644 --- a/views/default/group/search/finishblurb.php +++ b/views/default/group/search/finishblurb.php @@ -9,7 +9,7 @@ elgg_deprecated_notice('view groups/search/finishblurb was deprecated.', 1.7); if ($vars['count'] > $vars['threshold']) { ?> -<div class="contentWrapper"><a href="<?php echo elgg_get_site_url(); ?>pg/search/groups/?tag=<?php echo urlencode($vars['tag']); ?>"> +<div class="contentWrapper"><a href="<?php echo elgg_get_site_url(); ?>search/groups?tag=<?php echo urlencode($vars['tag']); ?>"> <?php echo elgg_echo("group:search:finishblurb"); ?></a> diff --git a/views/default/icon/default.php b/views/default/icon/default.php new file mode 100644 index 000000000..7f13a1189 --- /dev/null +++ b/views/default/icon/default.php @@ -0,0 +1,80 @@ +<?php +/** + * Generic icon view. + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['entity'] The entity the icon represents - uses getIconURL() method + * @uses $vars['size'] topbar, tiny, small, medium (default), large, master + * @uses $vars['href'] Optional override for link + * @uses $vars['img_class'] Optional CSS class added to img + * @uses $vars['link_class'] Optional CSS class for the link + */ + +$entity = $vars['entity']; + +$sizes = array('small', 'medium', 'large', 'tiny', 'master', 'topbar'); +// Get size +if (!in_array($vars['size'], $sizes)) { + $vars['size'] = "medium"; +} + +$class = elgg_extract('img_class', $vars, ''); + +if (isset($entity->name)) { + $title = $entity->name; +} else { + $title = $entity->title; +} +$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8', false); + +$url = $entity->getURL(); +if (isset($vars['href'])) { + $url = $vars['href']; +} + +$icon_sizes = elgg_get_config('icon_sizes'); +$size = $vars['size']; + +if (!isset($vars['width'])) { + $vars['width'] = $size != 'master' ? $icon_sizes[$size]['w'] : null; +} +if (!isset($vars['height'])) { + $vars['height'] = $size != 'master' ? $icon_sizes[$size]['h'] : null; +} + +$img_params = array( + 'src' => $entity->getIconURL($vars['size']), + 'alt' => $title, +); + +if (!empty($class)) { + $img_params['class'] = $class; +} + +if (!empty($vars['width'])) { + $img_params['width'] = $vars['width']; +} + +if (!empty($vars['height'])) { + $img_params['height'] = $vars['height']; +} + +$img = elgg_view('output/img', $img_params); + +if ($url) { + $params = array( + 'href' => $url, + 'text' => $img, + 'is_trusted' => true, + ); + $class = elgg_extract('link_class', $vars, ''); + if ($class) { + $params['class'] = $class; + } + + echo elgg_view('output/url', $params); +} else { + echo $img; +} diff --git a/views/default/icon/user/default.php b/views/default/icon/user/default.php new file mode 100644 index 000000000..c0b0e7483 --- /dev/null +++ b/views/default/icon/user/default.php @@ -0,0 +1,103 @@ +<?php +/** + * Elgg user icon + * + * Rounded avatar corners - CSS3 method + * uses avatar as background image so we can clip it with border-radius in supported browsers + * + * @uses $vars['entity'] The user entity. If none specified, the current user is assumed. + * @uses $vars['size'] The size - tiny, small, medium or large. (medium) + * @uses $vars['use_hover'] Display the hover menu? (true) + * @uses $vars['use_link'] Wrap a link around image? (true) + * @uses $vars['class'] Optional class added to the .elgg-avatar div + * @uses $vars['img_class'] Optional CSS class added to img + * @uses $vars['link_class'] Optional CSS class for the link + * @uses $vars['href'] Optional override of the link href + */ + +$user = elgg_extract('entity', $vars, elgg_get_logged_in_user_entity()); +$size = elgg_extract('size', $vars, 'medium'); +if (!in_array($size, array('topbar', 'tiny', 'small', 'medium', 'large', 'master'))) { + $size = 'medium'; +} + +$class = "elgg-avatar elgg-avatar-$size"; +if (isset($vars['class'])) { + $class = "$class {$vars['class']}"; +} + +$use_link = elgg_extract('use_link', $vars, true); + +if (!($user instanceof ElggUser)) { + return true; +} + +$name = htmlspecialchars($user->name, ENT_QUOTES, 'UTF-8', false); +$username = $user->username; + +$icontime = $user->icontime; +if (!$icontime) { + $icontime = "default"; +} + +$js = elgg_extract('js', $vars, ''); +if ($js) { + elgg_deprecated_notice("Passing 'js' to icon views is deprecated.", 1.8, 5); +} + +$img_class = ''; +if (isset($vars['img_class'])) { + $img_class = $vars['img_class']; +} + +$use_hover = elgg_extract('use_hover', $vars, true); +if (isset($vars['override'])) { + elgg_deprecated_notice("Use 'use_hover' rather than 'override' with user avatars", 1.8, 5); + $use_hover = false; +} +if (isset($vars['hover'])) { + // only 1.8.0 was released with 'hover' as the key + $use_hover = $vars['hover']; +} + +$spacer_url = elgg_get_site_url() . '_graphics/spacer.gif'; + +$icon_url = elgg_format_url($user->getIconURL($size)); +$icon = elgg_view('output/img', array( + 'src' => $spacer_url, + 'alt' => $name, + 'title' => $name, + 'class' => $img_class, + 'style' => "background: url($icon_url) no-repeat;", +)); + +$show_menu = $use_hover && (elgg_is_admin_logged_in() || !$user->isBanned()); + +?> +<div class="<?php echo $class; ?>"> +<?php + +if ($show_menu) { + $params = array( + 'entity' => $user, + 'username' => $username, + 'name' => $name, + ); + echo elgg_view_icon('hover-menu'); + echo elgg_view_menu('user_hover', $params); +} + +if ($use_link) { + $class = elgg_extract('link_class', $vars, ''); + $url = elgg_extract('href', $vars, $user->getURL()); + echo elgg_view('output/url', array( + 'href' => $url, + 'text' => $icon, + 'is_trusted' => true, + 'class' => $class, + )); +} else { + echo "<a>$icon</a>"; +} +?> +</div> diff --git a/views/default/input/access.php b/views/default/input/access.php index d4f366363..137eea288 100644 --- a/views/default/input/access.php +++ b/views/default/input/access.php @@ -1,57 +1,38 @@ <?php /** * Elgg access level input - * Displays a pulldown input field - * - * @package Elgg - * @subpackage Core - - - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field + * Displays a dropdown input field * + * @uses $vars['value'] The current value, if any + * @uses $vars['options_values'] Array of value => label pairs (overrides default) + * @uses $vars['name'] The name of the input field + * @uses $vars['entity'] Optional. The entity for this access control (uses access_id) + * @uses $vars['class'] Additional CSS class */ -$class = "input-access"; if (isset($vars['class'])) { - $class = $vars['class']; + $vars['class'] = "elgg-input-access {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-access"; } -$disabled = false; -if (isset($vars['disabled'])) { - $disabled = $vars['disabled']; -} +$defaults = array( + 'disabled' => false, + 'value' => get_default_access(), + 'options_values' => get_write_access_array(), +); -if (!array_key_exists('value', $vars) || $vars['value'] == ACCESS_DEFAULT) { - $vars['value'] = get_default_access(); +if (isset($vars['entity'])) { + $defaults['value'] = $vars['entity']->access_id; + unset($vars['entity']); } -if (!isset($vars['value']) || $vars['value'] === FALSE) { - $vars['value'] = elgg_get_sticky_value($vars['internalname']); -} +$vars = array_merge($defaults, $vars); -if ((!isset($vars['options'])) || (!is_array($vars['options']))) { - $vars['options'] = array(); - $vars['options'] = get_write_access_array(); +if ($vars['value'] == ACCESS_DEFAULT) { + $vars['value'] = get_default_access(); } -if (is_array($vars['options']) && sizeof($vars['options']) > 0) { - ?> - - <select <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['js'])) echo $vars['js']; ?> <?php if ($disabled) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>"> - <?php - - foreach($vars['options'] as $key => $option) { - if ($key != $vars['value']) { - echo "<option value=\"{$key}\">". htmlentities($option, ENT_QUOTES, 'UTF-8') ."</option>"; - } else { - echo "<option value=\"{$key}\" selected=\"selected\">". htmlentities($option, ENT_QUOTES, 'UTF-8') ."</option>"; - } - } - - ?> - </select> - <?php -}
\ No newline at end of file +if (is_array($vars['options_values']) && sizeof($vars['options_values']) > 0) { + echo elgg_view('input/dropdown', $vars); +} diff --git a/views/default/input/autocomplete.php b/views/default/input/autocomplete.php index 67d01c0c7..e58eb1ae8 100644 --- a/views/default/input/autocomplete.php +++ b/views/default/input/autocomplete.php @@ -7,94 +7,43 @@ * * @todo This currently only works for ONE AUTOCOMPLETE TEXT FIELD on a page. * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['match_on'] Array | str What to match on. all|array(group|user|friend|subtype) + * @uses $vars['value'] Current value for the text input + * @uses $vars['match_on'] Array | str What to match on. all|array(groups|users|friends) * @uses $vars['match_owner'] Bool. Match only entities that are owned by logged in user. - * + * @uses $vars['class'] Additional CSS class */ -global $autocomplete_js_loaded; - -$internalname = $vars['internalname']; -$value = $vars['value']; - -if(!$value) { - $value= ''; +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-autocomplete {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-autocomplete"; } -if($vars['internal_id']) { - $id_autocomplete = $vars['internal_id']; -} +$defaults = array( + 'value' => '', + 'disabled' => false, +); -$ac_url_params = http_build_query(array( - 'match_on' => $vars['match_on'], - 'match_owner' => $vars['match_owner'], -)); -$ac_url = elgg_get_site_url() . 'pg/autocomplete?' . $ac_url_params; +$vars = array_merge($defaults, $vars); -if (!isset($autocomplete_js_loaded)) { - $autocomplete_js_loaded = false; +$params = array(); +if (isset($vars['match_on'])) { + $params['match_on'] = $vars['match_on']; + unset($vars['match_on']); } +if (isset($vars['match_owner'])) { + $params['match_owner'] = $vars['match_owner']; + unset($vars['match_owner']); +} +$ac_url_params = http_build_query($params); -?> - -<!-- show the input --> -<input type="text" class='autocomplete' name ='<?php echo $internalname; ?>_autocomplete' value='<?php echo $value?>' /> -<input type="hidden" name="<?php echo $internalname; ?>" value='<?php echo $value; ?>' /> - -<?php -if (!$autocomplete_js_loaded) { - ?> - - <!-- include autocomplete --> - <script language="javascript" type="text/javascript" src="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery.autocomplete.min.js"></script> - <script type="text/javascript"> - function bindAutocomplete() { - $('input[type=text].autocomplete').autocomplete("<?php echo $ac_url; ?>", { - minChars: 1, - matchContains: true, - autoFill: false, - formatItem: function(row, i, max, term) { - eval("var info = " + row + ";"); - var r = ''; - - switch (info.type) { - case 'user': - case 'group': - r = info.icon + info.name + ' - ' + info.desc; - break; - - default: - r = info.name + ' - ' + info.desc; - break; - } - return r.replace(new RegExp("(" + term + ")", "gi"), "<b>$1</b>"); - } - }); - - $('input[type=text].autocomplete').result(function(event, data, formatted) { - eval("var info = " + data + ";"); - $(this).val(info.name); - - var hidden = $(this).next(); - hidden.val(info.guid); - }); - } - - $(document).ready(function() { - bindAutocomplete(); - }); - - </script> +elgg_load_js('elgg.autocomplete'); +elgg_load_js('jquery.ui.autocomplete.html'); - <?php +?> - $autocomplete_js_loaded = true; -} else { - ?> - <!-- rebind autocomplete --> - <script type="text/javascript">bindAutocomplete();</script> - <?php -}
\ No newline at end of file +<script type="text/javascript"> +elgg.provide('elgg.autocomplete'); +elgg.autocomplete.url = "<?php echo elgg_get_site_url() . 'livesearch?' . $ac_url_params; ?>"; +</script> +<input type="text" <?php echo elgg_format_attributes($vars); ?> /> diff --git a/views/default/input/button.php b/views/default/input/button.php index 1c8bdaf3c..9957fdc54 100644 --- a/views/default/input/button.php +++ b/views/default/input/button.php @@ -5,14 +5,18 @@ * @package Elgg * @subpackage Core * - * @uses $vars['src'] Src of an image + * @uses $vars['src'] Src of an image + * @uses $vars['class'] Additional CSS class */ -global $CONFIG; +if (isset($vars['class'])) { + $vars['class'] = "elgg-button {$vars['class']}"; +} else { + $vars['class'] = "elgg-button"; +} $defaults = array( 'type' => 'button', - 'class' => 'submit-button', ); $vars = array_merge($defaults, $vars); @@ -29,8 +33,8 @@ switch ($vars['type']) { } // blank src if trying to access an offsite image. @todo why? -if (strpos($vars['src'], $CONFIG->wwwroot) === false) { +if (isset($vars['src']) && strpos($vars['src'], elgg_get_site_url()) === false) { $vars['src'] = ""; } ?> -<input <?php echo elgg_format_attributes($vars); ?> />
\ No newline at end of file +<input <?php echo elgg_format_attributes($vars); ?> /> diff --git a/views/default/input/calendar.php b/views/default/input/calendar.php index 553a254ce..52c84ff82 100644 --- a/views/default/input/calendar.php +++ b/views/default/input/calendar.php @@ -1,6 +1,6 @@ <?php -// @deprecated Use datepicker instead. +// @deprecated Use input/date instead. -elgg_deprecated_notice('view: input/calendar is deprecated by input/datepicker', 1.8); +elgg_deprecated_notice('view: input/calendar is deprecated by input/date', 1.8); echo elgg_view('input/datepicker', $vars);
\ No newline at end of file diff --git a/views/default/input/captcha.php b/views/default/input/captcha.php index 210e0f50a..1c2e22aaa 100644 --- a/views/default/input/captcha.php +++ b/views/default/input/captcha.php @@ -1,6 +1,6 @@ <?php /** - * This view provides a hook for third parties to provide captcha behaviour. + * This view provides a hook for third parties to provide a CAPTCHA. * * @package Elgg * @subpackage Core diff --git a/views/default/input/checkbox.php b/views/default/input/checkbox.php index 59af3216f..3dc75c6c3 100644 --- a/views/default/input/checkbox.php +++ b/views/default/input/checkbox.php @@ -10,27 +10,30 @@ * Pass input tag attributes as key value pairs. For a list of allowable * attributes, see http://www.w3schools.com/tags/tag_input.asp * - * @uses mixed $vars['default'] The default value to submit if not checked. - * Optional, defaults to 0. Set to false for no default. + * @uses $vars['default'] The default value to submit if not checked. + * Optional, defaults to 0. Set to false for no default. + * @uses $vars['class'] Additional CSS class */ +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-checkbox {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-checkbox"; +} + $defaults = array( - 'class' => 'input-checkbox', + 'default' => 0, + 'disabled' => false, ); $vars = array_merge($defaults, $vars); -if (isset($vars['default'])) { - $default = $vars['default']; - unset($vars['default']); -} else { - $default = 0; -} +$default = $vars['default']; +unset($vars['default']); if (isset($vars['name']) && $default !== false) { echo "<input type=\"hidden\" name=\"{$vars['name']}\" value=\"$default\"/>"; } ?> - -<input type="checkbox" <?php echo elgg_format_attributes($vars); ?> />
\ No newline at end of file +<input type="checkbox" <?php echo elgg_format_attributes($vars); ?> /> diff --git a/views/default/input/checkboxes.php b/views/default/input/checkboxes.php index 4abeabf58..db4b06949 100644 --- a/views/default/input/checkboxes.php +++ b/views/default/input/checkboxes.php @@ -2,79 +2,89 @@ /** * Elgg checkbox input * Displays a checkbox input field - * NB: This also includes a hidden input with the same name as the checkboxes + * + * @note This also includes a hidden input with the same name as the checkboxes * to make sure something is sent to the server. The default value is 0. * If using JS, be specific to avoid selecting the hidden default value: - * $('input[type=checkbox][name=internalname]') + * $('input[type=checkbox][name=name]') + * + * @warning Passing integers as labels does not currently work due to a + * deprecated hack that will be removed in Elgg 1.9. To use integer labels, + * the labels must be character codes: 1 would be 1 * * @package Elgg * @subpackage Core * - * @uses string $vars['internalname'] The name of the input fields - * (Forced to an array by appending []) - * @uses array $vars['options'] An array of strings representing the - * label => option for the each checkbox field - * @uses string $vars['internalid'] The id for each input field. Optional - * (Only use this with a single value.) - * @uses string $vars['default'] The default value to send if nothing is checked. - * Optional, defaults to 0. Set to FALSE for no default. - * @uses bool $vars['disabled'] Make all input elements disabled. Optional. - * @uses string $vars['value'] The current value. Optional. - * @uses string $vars['class'] The class of each input element. Optional. - * @uses string $vars['js'] Any Javascript to enter into the input tag. Optional. + * @uses string $vars['name'] The name of the input fields + * (Forced to an array by appending []) + * @uses array $vars['options'] An array of strings representing the + * label => option for the each checkbox field + * @uses string $vars['default'] The default value to send if nothing is checked. + * Optional, defaults to 0. Set to FALSE for no default. + * @uses bool $vars['disabled'] Make all input elements disabled. Optional. + * @uses string $vars['value'] The current value. Single value or array. Optional. + * @uses string $vars['class'] Additional class of the list. Optional. + * @uses string $vars['align'] 'horizontal' or 'vertical' Default: 'vertical' * */ -if (!isset($vars['value']) || $vars['value'] === FALSE) { - $vars['value'] = elgg_get_sticky_value($vars['internalname']); +$defaults = array( + 'align' => 'vertical', + 'value' => array(), + 'default' => 0, + 'disabled' => false, + 'options' => array(), + 'name' => '', +); + +$vars = array_merge($defaults, $vars); + +$class = "elgg-input-checkboxes elgg-{$vars['align']}"; +if (isset($vars['class'])) { + $class .= " {$vars['class']}"; + unset($vars['class']); } -$class = (isset($vars['class'])) ? $vars['class'] : 'input-checkboxes'; -$value = (isset($vars['value'])) ? $vars['value'] : NULL; -$value_array = (is_array($value)) ? array_map('strtolower', $value) : array(strtolower($value)); -$internalname = (isset($vars['internalname'])) ? $vars['internalname'] : ''; -$options = (isset($vars['options']) && is_array($vars['options'])) ? $vars['options'] : array(); -$default = (isset($vars['default'])) ? $vars['default'] : 0; +$id = ''; +if (isset($vars['id'])) { + $id = "id=\"{$vars['id']}\""; + unset($vars['id']); +} + +if (is_array($vars['value'])) { + $values = array_map('elgg_strtolower', $vars['value']); +} else { + $values = array(elgg_strtolower($vars['value'])); +} -$id = (isset($vars['internalid'])) ? $vars['internalid'] : ''; -$disabled = (isset($vars['disabled'])) ? $vars['disabled'] : FALSE; -$js = (isset($vars['js'])) ? $vars['js'] : ''; +$input_vars = $vars; +$input_vars['default'] = false; +if ($vars['name']) { + $input_vars['name'] = "{$vars['name']}[]"; +} +unset($input_vars['align']); +unset($input_vars['options']); -if ($options) { +if (count($vars['options']) > 0) { // include a default value so if nothing is checked 0 will be passed. - if ($internalname && $default !== FALSE) { - echo "<input type=\"hidden\" name=\"$internalname\" value=\"$default\">"; + if ($vars['name'] && $vars['default'] !== false) { + echo "<input type=\"hidden\" name=\"{$vars['name']}\" value=\"{$vars['default']}\" />"; } - foreach ($options as $label => $option) { - // @hack - This sorta checks if options is not an assoc array and then - // ignores the label (because it's just the index) and sets the value ($option) - // as the label. - // Wow. - // @todo deprecate in Elgg 1.8 + echo "<ul class=\"$class\" $id>"; + foreach ($vars['options'] as $label => $value) { + // @deprecated 1.8 Remove in 1.9 if (is_integer($label)) { - $label = $option; - } - - $input_vars = array( - 'checked' => in_array(strtolower($option), $value_array), - 'value' => $option, - 'disabled' => $disabled, - 'id' => $id, - 'js' => $js, - 'default' => false, - ); - - if ($class) { - $input_vars['class'] = $class; + elgg_deprecated_notice('$vars[\'options\'] must be an associative array in input/checkboxes', 1.8); + $label = $value; } - if ($internalname) { - $input_vars['name'] = "{$internalname}[]"; - } + $input_vars['checked'] = in_array(elgg_strtolower($value), $values); + $input_vars['value'] = $value; $input = elgg_view('input/checkbox', $input_vars); - echo "<label>{$input}{$label}</label><br />"; + echo "<li><label>$input$label</label></li>"; } -}
\ No newline at end of file + echo '</ul>'; +} diff --git a/views/default/input/date.php b/views/default/input/date.php new file mode 100644 index 000000000..828ce5520 --- /dev/null +++ b/views/default/input/date.php @@ -0,0 +1,56 @@ +<?php +/** + * Elgg date input + * Displays a text field with a popup date picker. + * + * The elgg.ui JavaScript library initializes the jQueryUI datepicker based + * on the CSS class .elgg-input-date. It uses the ISO 8601 standard for date + * representation: yyyy-mm-dd. + * + * Unix timestamps are supported by setting the 'timestamp' parameter to true. + * The date is still displayed to the user in a text format but is submitted as + * a unix timestamp in seconds. + * + * @uses $vars['value'] The current value, if any (as a unix timestamp) + * @uses $vars['class'] Additional CSS class + * @uses $vars['timestamp'] Store as a Unix timestamp in seconds. Default = false + * Note: you cannot use an id with the timestamp option. + */ + +//@todo popup_calendar deprecated in 1.8. Remove in 2.0 +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-date popup_calendar {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-date popup_calendar"; +} + +$defaults = array( + 'value' => '', + 'disabled' => false, + 'timestamp' => false, +); + +$vars = array_merge($defaults, $vars); + +$timestamp = $vars['timestamp']; +unset($vars['timestamp']); + +if ($timestamp) { + echo elgg_view('input/hidden', array( + 'name' => $vars['name'], + 'value' => $vars['value'], + )); + + $vars['class'] = "{$vars['class']} elgg-input-timestamp"; + $vars['id'] = $vars['name']; + unset($vars['name']); + unset($vars['internalname']); +} + +// convert timestamps to text for display +if (is_numeric($vars['value'])) { + $vars['value'] = gmdate('Y-m-d', $vars['value']); +} + +$attributes = elgg_format_attributes($vars); +echo "<input type=\"text\" $attributes />"; diff --git a/views/default/input/datepicker.php b/views/default/input/datepicker.php index fceb8b30c..8955e6e53 100644 --- a/views/default/input/datepicker.php +++ b/views/default/input/datepicker.php @@ -1,40 +1,6 @@ <?php /** - * Elgg datepicker input - * Displays a text field with a popup date picker. - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * + * @deprecated use input/date instead */ - -$cal_name = sanitise_string($vars['internalname']); - -if (isset($vars['class'])) { - $class = "{$vars['class']} popup_calendar"; -} else { - $class = 'popup_calendar'; -} - -if (!isset($vars['value']) || $vars['value'] === FALSE) { - $vars['value'] = elgg_get_sticky_value($vars['internalname']); -} - -if ($vars['value'] > 86400) { - //$val = date("F j, Y", $vars['value']); - $val = date('n/d/Y', $vars['value']); -} else { - $val = $vars['value']; -} - -?> -<input type="text" name="<?php echo $vars['internalname']; ?>" value="<?php echo $val; ?>" /> -<script language="JavaScript"> - $(document).ready(function() { - $('input[type=text][name=<?php echo $cal_name; ?>]').datepicker(); - }); -</script> +elgg_deprecated_notice('input/datepicker was deprecated in favor of input/date', 1.8); +echo elgg_view('input/date', $vars);
\ No newline at end of file diff --git a/views/default/input/dropdown.php b/views/default/input/dropdown.php new file mode 100644 index 000000000..9f07874f1 --- /dev/null +++ b/views/default/input/dropdown.php @@ -0,0 +1,71 @@ +<?php +/** + * Elgg dropdown input + * Displays a dropdown (select) input field + * + * @warning Default values of FALSE or NULL will match '' (empty string) but not 0. + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['value'] The current value, if any + * @uses $vars['options'] An array of strings representing the options for the dropdown field + * @uses $vars['options_values'] An associative array of "value" => "option" + * where "value" is the name and "option" is + * the value displayed on the button. Replaces + * $vars['options'] when defined. + * @uses $vars['class'] Additional CSS class + */ + +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-dropdown {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-dropdown"; +} + +$defaults = array( + 'disabled' => false, + 'value' => '', + 'options_values' => array(), + 'options' => array(), +); + +$vars = array_merge($defaults, $vars); + +$options_values = $vars['options_values']; +unset($vars['options_values']); + +$options = $vars['options']; +unset($vars['options']); + +$value = $vars['value']; +unset($vars['value']); + +?> +<select <?php echo elgg_format_attributes($vars); ?>> +<?php + +if ($options_values) { + foreach ($options_values as $opt_value => $option) { + + $option_attrs = elgg_format_attributes(array( + 'value' => $opt_value, + 'selected' => (string)$opt_value == (string)$value, + )); + + echo "<option $option_attrs>$option</option>"; + } +} else { + if (is_array($options)) { + foreach ($options as $option) { + + $option_attrs = elgg_format_attributes(array( + 'selected' => (string)$option == (string)$value + )); + + echo "<option $option_attrs>$option</option>"; + } + } +} +?> +</select> diff --git a/views/default/input/email.php b/views/default/input/email.php index c973ff7e4..190fb88c6 100644 --- a/views/default/input/email.php +++ b/views/default/input/email.php @@ -5,18 +5,22 @@ * * @package Elgg * @subpackage Core + * + * @uses $vars['class'] Additional CSS class */ +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-email {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-email"; +} + $defaults = array( - 'class' => 'input-text', //@todo input-email? - 'disabled' => FALSE, + 'disabled' => false, ); $vars = array_merge($defaults, $vars); -if (!isset($vars['value']) || $vars['value'] === FALSE) { - $vars['value'] = elgg_get_sticky_value($vars['internalname']); -} ?> <input type="text" <?php echo elgg_format_attributes($vars); ?> />
\ No newline at end of file diff --git a/views/default/input/file.php b/views/default/input/file.php index 8f0461083..452fe72b9 100644 --- a/views/default/input/file.php +++ b/views/default/input/file.php @@ -6,28 +6,26 @@ * @package Elgg * @subpackage Core * - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['internalid'] The id of the input field - * @uses $vars['class'] CSS class - * @uses $vars['disabled'] Is the input field disabled? * @uses $vars['value'] The current value if any - * + * @uses $vars['class'] Additional CSS class */ if (!empty($vars['value'])) { echo elgg_echo('fileexists') . "<br />"; } -$class = "input-file"; if (isset($vars['class'])) { - $class = $vars['class']; + $vars['class'] = "elgg-input-file {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-file"; } -$disabled = false; -if (isset($vars['disabled'])) { - $disabled = $vars['disabled']; -} +$defaults = array( + 'disabled' => false, + 'size' => 30, +); + +$attrs = array_merge($defaults, $vars); ?> -<input type="file" size="30" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php if ($disabled) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>" />
\ No newline at end of file +<input type="file" <?php echo elgg_format_attributes($attrs); ?> /> diff --git a/views/default/input/form.php b/views/default/input/form.php index 31c221688..df30133b3 100644 --- a/views/default/input/form.php +++ b/views/default/input/form.php @@ -1,14 +1,17 @@ <?php /** * Create a form for data submission. - * Use this view for forms rather than creating a form tag in the wild as it provides - * extra security which help prevent CSRF attacks. + * Use this view for forms as it provides protection against CSRF attacks. * * @package Elgg * @subpackage Core * * @uses $vars['body'] The body of the form (made up of other input/xxx views and html + * @uses $vars['action'] The action URL of the form + * @uses $vars['method'] The submit method: post (default) or get + * @uses $vars['enctype'] Set to 'multipart/form-data' if uploading a file * @uses $vars['disable_security'] turn off CSRF security by setting to true + * @uses $vars['class'] Additional class for the form */ $defaults = array( @@ -18,21 +21,24 @@ $defaults = array( $vars = array_merge($defaults, $vars); -$body = $vars['body']; -unset($vars['body']); +if (isset($vars['class'])) { + $vars['class'] = "elgg-form {$vars['class']}"; +} else { + $vars['class'] = 'elgg-form'; +} $vars['action'] = elgg_normalize_url($vars['action']); - -// @todo why? $vars['method'] = strtolower($vars['method']); +$body = $vars['body']; +unset($vars['body']); + // Generate a security header if (!$vars['disable_security']) { - $body .= elgg_view('input/securitytoken'); + $body = elgg_view('input/securitytoken') . $body; } unset($vars['disable_security']); - $attributes = elgg_format_attributes($vars); -echo "<form $attributes>$body</form>";
\ No newline at end of file +echo "<form $attributes><fieldset>$body</fieldset></form>"; diff --git a/views/default/friends/picker.php b/views/default/input/friendspicker.php index 3bbe4ffe2..40708c890 100644 --- a/views/default/friends/picker.php +++ b/views/default/input/friendspicker.php @@ -3,25 +3,29 @@ * Elgg friends picker * Lists the friends picker * + * @warning Below is the ugliest code in Elgg. It needs to be rewritten or removed + * * @package Elgg * @subpackage Core * * @uses $vars['entities'] The array of ElggUser objects + * @uses $vars['name'] + * @uses $vars['value'] + * @uses $vars['highlight'] + * @uses $vars['callback'] */ -$base = elgg_get_site_url(); -$viewtype = elgg_get_viewtype(); -elgg_register_js("{$base}vendors/jquery/jquery.easing.1.3.packed.js", 'jquery.easing'); -$url = elgg_view_get_simplecache_url('js', 'friendsPickerv1'); -elgg_register_js($url, 'friendsPicker'); +elgg_load_js('elgg.friendspicker'); +elgg_load_js('jquery.easing'); + $chararray = elgg_echo('friendspicker:chararray'); -// Initialise internalname -if (!isset($vars['internalname'])) { - $internalname = "friend"; +// Initialise name +if (!isset($vars['name'])) { + $name = "friend"; } else { - $internalname = $vars['internalname']; + $name = $vars['name']; } // Are we highlighting default or all? @@ -74,13 +78,9 @@ if (isset($vars['formtarget'])) { // Sort users by letter if (is_array($vars['entities']) && sizeof($vars['entities'])) { foreach($vars['entities'] as $user) { - if (is_callable('mb_substr')) { - $letter = strtoupper(mb_substr($user->name,0,1)); - } else { - $letter = strtoupper(substr($user->name,0,1)); - } + $letter = elgg_strtoupper(elgg_substr($user->name, 0, 1)); - if (!substr_count($chararray,$letter)) { + if (!elgg_substr_count($chararray, $letter)) { $letter = "*"; } if (!isset($users[$letter])) { @@ -101,7 +101,7 @@ foreach ($users as $letter => $letter_users) { if (!$callback) { ?> - <div class="friends-picker"> + <div class="friends-picker-main-wrapper"> <?php @@ -118,9 +118,9 @@ if (!$callback) { if (!isset($vars['replacement'])) { if ($formtarget) { ?> - +<?php //@todo JS 1.8: no ?> <script language="text/javascript"> - $(function() { // onload...do + $(function() { // onload...do $('#collectionMembersForm<?php echo $friendspicker; ?>').submit(function() { var inputs = []; $(':input', this).each(function() { @@ -147,6 +147,11 @@ if (!isset($vars['replacement'])) { <form id="collectionMembersForm<?php echo $friendspicker; ?>" action="<?php echo $formtarget; ?>" method="post"> <!-- action="" method=""> --> <?php + echo elgg_view('input/securitytoken'); + echo elgg_view('input/hidden', array( + 'name' => 'collection_id', + 'value' => $vars['collection_id'], + )); } ?> @@ -157,11 +162,7 @@ if (!isset($vars['replacement'])) { // Initialise letters $chararray .= "*"; - if (is_callable('mb_substr')) { - $letter = mb_substr($chararray,0,1); - } else { - $letter = substr($chararray,0,1); - } + $letter = elgg_substr($chararray, 0, 1); $letpos = 0; while (1 == 1) { ?> @@ -182,12 +183,10 @@ if (!isset($vars['replacement'])) { } //echo "<p>" . $user->name . "</p>"; - $label = elgg_view("profile/icon",array('entity' => $friend, 'size' => 'tiny', 'override' => true)); + $label = elgg_view_entity_icon($friend, 'tiny', array('use_hover' => false)); $options[$label] = $friend->getGUID(); - if ($vars['highlight'] == 'all' - && !in_array($letter,$activeletters)) { - + if ($vars['highlight'] == 'all' && !in_array($letter,$activeletters)) { $activeletters[] = $letter; } @@ -204,7 +203,7 @@ if (!isset($vars['replacement'])) { <td> - <input type="checkbox" <?php echo $checked; ?> name="<?php echo $internalname; ?>[]" value="<?php echo $options[$label]; ?>" /> + <input type="checkbox" <?php echo $checked; ?> name="<?php echo $name; ?>[]" value="<?php echo $options[$label]; ?>" /> </td> @@ -238,23 +237,14 @@ if (!isset($vars['replacement'])) { </div> </div> <?php - //if ($letter == 'Z') break; - if (is_callable('mb_substr')) { - $substr = mb_substr($chararray,strlen($chararray) - 1,1); - } else { - $substr = substr($chararray,strlen($chararray) - 1,1); - } + $substr = elgg_substr($chararray, elgg_strlen($chararray) - 1, 1); if ($letter == $substr) { break; } //$letter++; $letpos++; - if (is_callable('mb_substr')) { - $letter = mb_substr($chararray,$letpos,1); - } else { - $letter = substr($chararray,$letpos,1); - } + $letter = elgg_substr($chararray, $letpos, 1); } ?> @@ -270,8 +260,8 @@ if ($formtarget) { ?> <div class="clearfix"></div> <div class="friendspicker-savebuttons"> - <input type="submit" class="submit-button" value="<?php echo elgg_echo('save'); ?>" /> - <input type="button" class="cancel-button" value="<?php echo elgg_echo('cancel'); ?>" onclick="$('a.collectionmembers<?php echo $friendspicker; ?>').click();" /> + <input type="submit" class="elgg-button elgg-button-submit" value="<?php echo elgg_echo('save'); ?>" /> + <input type="button" class="elgg-button elgg-button-cancel" value="<?php echo elgg_echo('cancel'); ?>" onclick="$('a.collectionmembers<?php echo $friendspicker; ?>').click();" /> <br /></div> </form> @@ -302,19 +292,19 @@ if (!$callback) { if (!isset($vars['replacement'])) { ?> - +<?php //@todo JS 1.8: no ?> <script type="text/javascript"> // initialise picker $("div#friends-picker<?php echo $friendspicker; ?>").friendsPicker(<?php echo $friendspicker; ?>); </script> -<script> +<script type="text/javascript"> $(document).ready(function () { // manually add class to corresponding tab for panels that have content <?php if (sizeof($activeletters) > 0) //$chararray = elgg_echo('friendspicker:chararray'); foreach($activeletters as $letter) { - $tab = strpos($chararray, $letter) + 1; + $tab = elgg_strpos($chararray, $letter) + 1; ?> $("div#friends-picker-navigation<?php echo $friendspicker; ?> li.tab<?php echo $tab; ?> a").addClass("tabHasContent"); <?php diff --git a/views/default/input/hidden.php b/views/default/input/hidden.php index a5fb01e73..9c2fc6c08 100644 --- a/views/default/input/hidden.php +++ b/views/default/input/hidden.php @@ -1,21 +1,12 @@ <?php /** * Create a hidden data field - * Use this view for forms rather than creating a hidden tag in the wild as it provides - * extra security which help prevent CSRF attacks. * * @package Elgg * @subpackage Core * * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * */ -if (!isset($vars['value']) || $vars['value'] === FALSE) { - $vars['value'] = elgg_get_sticky_value($vars['internalname']); -} - ?> -<input type="hidden" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" />
\ No newline at end of file +<input type="hidden" <?php echo elgg_format_attributes($vars); ?> />
\ No newline at end of file diff --git a/views/default/input/location.php b/views/default/input/location.php new file mode 100644 index 000000000..4cf05c72a --- /dev/null +++ b/views/default/input/location.php @@ -0,0 +1,27 @@ +<?php +/** + * Location input field + * + * @uses $vars['entity'] The ElggEntity that has a location + * @uses $vars['value'] The default value for the location + * @uses $vars['class'] Additional CSS class + */ + +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-location {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-location"; +} + +$defaults = array( + 'disabled' => false, +); + +if (isset($vars['entity'])) { + $defaults['value'] = $vars['entity']->location; + unset($vars['entity']); +} + +$vars = array_merge($defaults, $vars); + +echo elgg_view('input/tag', $vars); diff --git a/views/default/input/longtext.php b/views/default/input/longtext.php index d784c6014..61dc7ca19 100644 --- a/views/default/input/longtext.php +++ b/views/default/input/longtext.php @@ -1,38 +1,42 @@ <?php /** * Elgg long text input - * Displays a long text input field + * Displays a long text input field that can use WYSIWYG editor * * @package Elgg * @subpackage Core * - * @uses $vars['value'] The current value, if any - will be html encoded - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['internalid'] The id of the input field - * @uses $vars['class'] CSS class + * @uses $vars['value'] The current value, if any - will be html encoded * @uses $vars['disabled'] Is the input field disabled? + * @uses $vars['class'] Additional CSS class */ -$class = "input-textarea"; if (isset($vars['class'])) { - $class = $vars['class']; + $vars['class'] = "elgg-input-longtext {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-longtext"; } -$disabled = false; -if (isset($vars['disabled'])) { - $disabled = $vars['disabled']; -} +$defaults = array( + 'value' => '', + 'rows' => '10', + 'cols' => '50', + 'id' => 'elgg-input-' . rand(), //@todo make this more robust +); -if (!isset($vars['value']) || $vars['value'] === FALSE) { - $vars['value'] = elgg_get_sticky_value($vars['internalname']); -} +$vars = array_merge($defaults, $vars); -$value = ''; -if (isset($vars['value'])) { - $value = $vars['value']; -} +$value = $vars['value']; +unset($vars['value']); + +echo elgg_view_menu('longtext', array( + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', + 'id' => $vars['id'], +)); ?> -<textarea class="<?php echo $class; ?>" name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php if ($disabled) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?>><?php echo htmlentities($value, ENT_QUOTES, 'UTF-8'); ?></textarea>
\ No newline at end of file +<textarea <?php echo elgg_format_attributes($vars); ?>> +<?php echo htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false); ?> +</textarea> diff --git a/views/default/input/password.php b/views/default/input/password.php index 0d1523977..45f2b20a6 100644 --- a/views/default/input/password.php +++ b/views/default/input/password.php @@ -7,15 +7,22 @@ * @subpackage Core * * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * + * @uses $vars['name'] The name of the input field + * @uses $vars['class'] Additional CSS class */ -$class = $vars['class']; -if (!$class) { - $class = "input-password"; +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-password {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-password"; } + +$defaults = array( + 'disabled' => false, + 'value' => '', +); + +$attrs = array_merge($defaults, $vars); ?> -<input type="password" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>" />
\ No newline at end of file +<input type="password" <?php echo elgg_format_attributes($attrs); ?> /> diff --git a/views/default/input/plaintext.php b/views/default/input/plaintext.php index e2b8c5ed2..e92c61ced 100644 --- a/views/default/input/plaintext.php +++ b/views/default/input/plaintext.php @@ -6,21 +6,32 @@ * @package Elgg * @subpackage Core * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * + * @uses $vars['value'] The current value, if any + * @uses $vars['name'] The name of the input field + * @uses $vars['class'] Additional CSS class + * @uses $vars['disabled'] */ -$class = $vars['class']; -if (!$class) { - $class = "input-textarea"; +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-plaintext {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-plaintext"; } -if (!isset($vars['value']) || $vars['value'] === FALSE) { - $vars['value'] = elgg_get_sticky_value($vars['internalname']); -} +$defaults = array( + 'value' => '', + 'rows' => '10', + 'cols' => '50', + 'disabled' => false, +); + +$vars = array_merge($defaults, $vars); + +$value = $vars['value']; +unset($vars['value']); ?> -<textarea class="<?php echo $class; ?>" name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?>><?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?></textarea>
\ No newline at end of file +<textarea <?php echo elgg_format_attributes($vars); ?>> +<?php echo htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false); ?> +</textarea> diff --git a/views/default/input/pulldown.php b/views/default/input/pulldown.php index f789d1020..fc0595300 100644 --- a/views/default/input/pulldown.php +++ b/views/default/input/pulldown.php @@ -1,56 +1,9 @@ <?php /** - * Elgg pulldown input - * Displays a pulldown input field + * Deprecated pulldown input view - use 'input/dropdown' instead. * - * NB: Default values of FALSE or NULL will match '' (empty string) and not 0. - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['options'] An array of strings representing the options for the pulldown field - * @uses $vars['options_values'] An associative array of "value" => "option" where "value" is an internal name and "option" is - * the value displayed on the button. Replaces $vars['options'] when defined. + * @deprecated 1.8 */ -$class = $vars['class']; -if (!$class) { - $class = "input-pulldown"; -} - -if (!isset($vars['value'])) { - $vars['value'] = elgg_get_sticky_value($vars['internalname']); -} - -?> -<select name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php echo $vars['js']; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>"> -<?php - -if ($vars['options_values']) { - foreach($vars['options_values'] as $value => $option) { - - $encoded_value = htmlentities($value, ENT_QUOTES, 'UTF-8'); - $encoded_option = htmlentities($option, ENT_QUOTES, 'UTF-8'); - - if ((string)$value == (string)$vars['value']) { - echo "<option value=\"$encoded_value\" selected=\"selected\">$encoded_option</option>"; - } else { - echo "<option value=\"$encoded_value\">$encoded_option</option>"; - } - } -} else { - foreach($vars['options'] as $option) { - $encoded_option = htmlentities($option, ENT_QUOTES, 'UTF-8'); - - if ((string)$option == (string)$vars['value']) { - echo "<option selected=\"selected\">$encoded_option</option>"; - } else { - echo "<option>$encoded_option</option>"; - } - } -} -?> -</select>
\ No newline at end of file +elgg_deprecated_notice("input/pulldown was deprecated by input/dropdown", 1.8, 2); +echo elgg_view('input/dropdown', $vars); diff --git a/views/default/input/radio.php b/views/default/input/radio.php index 0a5885f8b..ef860a773 100644 --- a/views/default/input/radio.php +++ b/views/default/input/radio.php @@ -3,43 +3,74 @@ * Elgg radio input * Displays a radio input field * + * @warning Passing integers as labels does not currently work due to a + * deprecated hack that will be removed in Elgg 1.9. To use integer labels, + * the labels must be character codes: 1 would be 1 + * * @package Elgg * @subpackage Core * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['options'] An array of strings representing the options for the radio field as "label" => option - * + * @uses $vars['value'] The current value, if any + * @uses $vars['name'] The name of the input field + * @uses $vars['options'] An array of strings representing the options for the + * radio field as "label" => option + * @uses $vars['class'] Additional class of the list. Optional. + * @uses $vars['align'] 'horizontal' or 'vertical' Default: 'vertical' */ -$class = $vars['class']; -if (!$class) { - $class = "input-radio"; +$defaults = array( + 'align' => 'vertical', + 'value' => array(), + 'disabled' => false, + 'options' => array(), + 'name' => '', +); + +$vars = array_merge($defaults, $vars); + +$id = ''; +if (isset($vars['id'])) { + $id = "id=\"{$vars['id']}\""; + unset($vars['id']); } -if (!isset($vars['value']) || $vars['value'] === FALSE) { - $vars['value'] = elgg_get_sticky_value($vars['internalname']); +$class = "elgg-input-radios elgg-{$vars['align']}"; +if (isset($vars['class'])) { + $class .= " {$vars['class']}"; + unset($vars['class']); } +unset($vars['align']); +$vars['class'] = 'elgg-input-radio'; -foreach($vars['options'] as $label => $option) { - if (strtolower($option) != strtolower($vars['value'])) { - $selected = ""; - } else { - $selected = "checked = \"checked\""; - } +if (is_array($vars['value'])) { + $vars['value'] = array_map('elgg_strtolower', $vars['value']); +} else { + $vars['value'] = array(elgg_strtolower($vars['value'])); +} - // handle indexed array where label is not specified - // @todo deprecate in Elgg 1.8 - if (is_integer($label)) { - $label = $option; - } - - if (isset($vars['internalid'])) { - $id = "id=\"{$vars['internalid']}\""; - } - if ($vars['disabled']) { - $disabled = ' disabled="yes" '; +$options = $vars['options']; +unset($vars['options']); + +$value = $vars['value']; +unset($vars['value']); + +if ($options && count($options) > 0) { + echo "<ul class=\"$class\" $id>"; + foreach ($options as $label => $option) { + + $vars['checked'] = in_array(elgg_strtolower($option), $value); + $vars['value'] = $option; + + $attributes = elgg_format_attributes($vars); + + // handle indexed array where label is not specified + // @deprecated 1.8 Remove in 1.9 + if (is_integer($label)) { + elgg_deprecated_notice('$vars[\'options\'] must be an associative array in input/radio', 1.8); + $label = $option; + } + + echo "<li><label><input type=\"radio\" $attributes />$label</label></li>"; } - echo "<label><input type=\"radio\" $disabled {$vars['js']} name=\"{$vars['internalname']}\" $id value=\"".htmlentities($option, ENT_QUOTES, 'UTF-8')."\" {$selected} class=\"$class\" />{$label}</label><br />"; -}
\ No newline at end of file + echo '</ul>'; +} diff --git a/views/default/input/reset.php b/views/default/input/reset.php index d1296e4bf..082da8669 100644 --- a/views/default/input/reset.php +++ b/views/default/input/reset.php @@ -2,14 +2,13 @@ /** * Create a reset input button * - * @todo ... huh? - * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides - * extra security which help prevent CSRF attacks. - * * @package Elgg * @subpackage Core + * + * @uses $vars['class'] CSS class that replaces elgg-button-cancel */ $vars['type'] = 'reset'; +$vars['class'] = elgg_extract('class', $vars, 'elgg-button-cancel'); echo elgg_view('input/button', $vars);
\ No newline at end of file diff --git a/views/default/input/securitytoken.php b/views/default/input/securitytoken.php index 9a8cb1ebe..75410848a 100644 --- a/views/default/input/securitytoken.php +++ b/views/default/input/securitytoken.php @@ -11,5 +11,5 @@ $ts = time(); $token = generate_action_token($ts); -echo elgg_view('input/hidden', array('internalname' => '__elgg_token', 'value' => $token)); -echo elgg_view('input/hidden', array('internalname' => '__elgg_ts', 'value' => $ts)); +echo elgg_view('input/hidden', array('name' => '__elgg_token', 'value' => $token)); +echo elgg_view('input/hidden', array('name' => '__elgg_ts', 'value' => $ts)); diff --git a/views/default/input/submit.php b/views/default/input/submit.php index 39734b807..df369b3b4 100644 --- a/views/default/input/submit.php +++ b/views/default/input/submit.php @@ -2,14 +2,13 @@ /** * Create a submit input button * - * @todo ... huh? - * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides - * extra security which help prevent CSRF attacks. - * * @package Elgg * @subpackage Core + * + * @uses $vars['class'] CSS class that replaces elgg-button-submit */ $vars['type'] = 'submit'; +$vars['class'] = elgg_extract('class', $vars, 'elgg-button-submit'); echo elgg_view('input/button', $vars);
\ No newline at end of file diff --git a/views/default/input/tag.php b/views/default/input/tag.php new file mode 100644 index 000000000..8893a18ff --- /dev/null +++ b/views/default/input/tag.php @@ -0,0 +1,25 @@ +<?php +/** + * Elgg tag input + * + * Accepts a single tag value + * + * @uses $vars['value'] The default value for the tag + * @uses $vars['class'] Additional CSS class + */ + +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-tag {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-tag"; +} + +$defaults = array( + 'value' => '', + 'disabled' => false, +); + +$vars = array_merge($defaults, $vars); +?> + +<input type="text" <?php echo elgg_format_attributes($vars); ?> />
\ No newline at end of file diff --git a/views/default/input/tags.php b/views/default/input/tags.php index 6ce074a2a..261cf9f97 100644 --- a/views/default/input/tags.php +++ b/views/default/input/tags.php @@ -3,21 +3,30 @@ * Elgg tag input * Displays a tag input field * - * @package Elgg - * @subpackage Core + * @uses $vars['disabled'] + * @uses $vars['class'] Additional CSS class + * @uses $vars['value'] Array of tags or a string + * @uses $vars['entity'] Optional. Entity whose tags are being displayed (metadata ->tags) */ +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-tags {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-tags"; +} + $defaults = array( - 'class' => 'input-tags', - 'disabled' => FALSE, + 'value' => '', + 'disabled' => false, ); -$vars = array_merge($defaults, $vars); - -if (!isset($vars['value']) || $vars['value'] === FALSE) { - $vars['value'] = elgg_get_sticky_value($vars['internalname']); +if (isset($vars['entity'])) { + $defaults['value'] = $vars['entity']->tags; + unset($vars['entity']); } +$vars = array_merge($defaults, $vars); + if (is_array($vars['value'])) { $tags = array(); diff --git a/views/default/input/text.php b/views/default/input/text.php index 9f3076ed3..07ce5c710 100644 --- a/views/default/input/text.php +++ b/views/default/input/text.php @@ -5,18 +5,22 @@ * * @package Elgg * @subpackage Core + * + * @uses $vars['class'] Additional CSS class */ +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-text {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-text"; +} + $defaults = array( - 'class' => 'input-text', - 'disabled' => FALSE, + 'value' => '', + 'disabled' => false, ); $vars = array_merge($defaults, $vars); -if (!isset($vars['value']) || $vars['value'] === FALSE) { - $vars['value'] = elgg_get_sticky_value($vars['internalname']); -} ?> - <input type="text" <?php echo elgg_format_attributes($vars); ?> />
\ No newline at end of file diff --git a/views/default/input/url.php b/views/default/input/url.php index fddf44a5b..e97a316d8 100644 --- a/views/default/input/url.php +++ b/views/default/input/url.php @@ -5,17 +5,23 @@ * * @package Elgg * @subpackage Core + * + * @uses $vars['class'] Additional CSS class */ +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-url {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-url"; +} + $defaults = array( - 'class' => 'input-url', + 'value' => '', + 'disabled' => false, ); $vars = array_merge($defaults, $vars); -if (!isset($vars['value']) || $vars['value'] === FALSE) { - $vars['value'] = elgg_get_sticky_value($vars['internalname']); -} ?> <input type="text" <?php echo elgg_format_attributes($vars); ?> /> diff --git a/views/default/input/userpicker.php b/views/default/input/userpicker.php index 8f32aa4c5..8b64d7df5 100644 --- a/views/default/input/userpicker.php +++ b/views/default/input/userpicker.php @@ -5,45 +5,43 @@ * @package Elgg * @subpackage Core * - * @uses $vars['value'] The current value, if any - * @uses $vars['internalname'] The name of the input field + * @uses $vars['value'] Array of user guids for already selected users or null * + * The name of the hidden fields is members[] * - * pops up defaulted to lazy load friends lists in paginated alphabetical order. - * upon + * @warning Only a single input/userpicker is supported per web page. * - * As users are checked they move down to a "users" box. - * When this happens, a hidden input is created also. - * {$internalnal}[] with the value th GUID. + * Defaults to lazy load user lists in alphabetical order. User needs + * to type two characters before seeing the user popup list. * + * As users are selected they move down to a "users" box. + * When this happens, a hidden input is created with the + * name of members[] and a value of the GUID. */ -global $user-picker_js_sent; +elgg_load_js('elgg.userpicker'); +elgg_load_js('jquery.ui.autocomplete.html'); -function user-picker_add-user($user_id) { +function user_picker_add_user($user_id) { $user = get_entity($user_id); if (!$user || !($user instanceof ElggUser)) { - return FALSE; + return false; } - $icon = $user->getIcon('tiny'); - - $code = '<li class="user-picker-entry">'; - $code .= "<img class=\"livesearch_icon\" src=\"$icon\" />"; - $code .= "$user->name - $user->username"; - $code .= '<div class="delete-button">'; - $code .= "<a onclick=\"userPickerRemoveUser(this, $user_id)\"><strong>X</strong></a>"; - $code .= '</div>'; + $icon = elgg_view_entity_icon($user, 'tiny', array('use_hover' => false)); + + // this html must be synced with the userpicker.js library + $code = '<li><div class="elgg-image-block">'; + $code .= "<div class='elgg-image'>$icon</div>"; + $code .= "<div class='elgg-image-alt'><a href='#' class='elgg-userpicker-remove'>X</a></div>"; + $code .= "<div class='elgg-body'>" . $user->name . "</div>"; + $code .= "</div>"; $code .= "<input type=\"hidden\" name=\"members[]\" value=\"$user_id\">"; $code .= '</li>'; return $code; } -if (!isset($vars['value']) || $vars['value'] === FALSE) { - $vars['value'] = elgg_get_sticky_value($vars['internalname']); -} - // loop over all values and prepare them so that "in" will work in javascript $values = array(); if (!is_array($vars['value'])) { @@ -56,138 +54,22 @@ foreach ($vars['value'] as $value) { // convert the values to a json-encoded list $json_values = json_encode($values); -if (!$user-picker_js_sent) { -?> -<!-- User picker JS --> -<script language="javascript" type="text/javascript" src="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery.autocomplete.min.js"></script> -<script type="text/javascript"> -// set up a few required variables -userPickerURL = '<?php echo elgg_get_site_url() ?>pg/livesearch'; -userList = <?php echo $json_values ?>; - -function userPickerBindEvents() { - // binding autocomplete. - // doing this as an each so we can past this to functions. - $('.user-picker .search').each(function (i, e) { - userPickerBindAutocomplete(e); - }); - - // changing friends vs all users. - $('.user-picker .all_users').click(function() { - // update the extra params for the autocomplete. - var e = $(this).parents('.user-picker').find('.search'); - var params = userPickerGetSearchParams(e); - e.setOptions({extraParams: params}); - e.flushCache(); - }); - - // hitting enter on the text field -// $('.user-picker .search').bind($.browser.opera ? "keypress" : "keydown", function(event) { -// if(event.keyCode == 13) { -//// console.log($(this).val()); -// userPickerAddUser(this); -// } -// }); -} - -function userPickerBindAutocomplete(e) { - var params = userPickerGetSearchParams(e); - - $(e).autocomplete(userPickerURL, { - extraParams: params, - max: 25, - minChars: 2, - matchContains: false, - autoFill: false, - formatItem: userPickerFormatItem, - formatResult: function (row, i, max) { - eval("var info = " + row + ";"); - // returning the just name - return info.name; - } - }); - - // add users when a result is picked. - $(e).result(userPickerAddUser); -} - -function userPickerFormatItem(row, i, max, term) { - eval("var info = " + row + ";"); - var r = ''; - var name = info.name.replace(new RegExp("(" + term + ")", "gi"), "<span class=\"user-picker_highlight\">$1</b>"); - var desc = info.desc.replace(new RegExp("(" + term + ")", "gi"), "<span class=\"user-picker_highlight\">$1</b>"); - - switch (info.type) { - case 'user': - case 'group': - r = info.icon + name + ' - ' + desc; - break; - - default: - r = name + ' - ' + desc; - break; - } - return r; - //return r.replace(new RegExp("(" + term + ")", "gi"), "<span class=\"user-picker_highlight\">$1</b>"); -} - -function userPickerAddUser(event, data, formatted) { - eval("var info = " + data + ";"); - - // do not allow users to be added multiple times - if (!(info.guid in userList)) { - userList[info.guid] = true; - - var picker = $(this).parent('.user-picker'); - var users = picker.find('.users'); - var internalName = picker.find('input.internalname').val(); - // not sure why formatted isn't. - var formatted = userPickerFormatItem(data); - - // add guid as hidden input and to list. - var li = formatted + ' <div class="delete-button"><a onclick="userPickerRemoveUser(this, ' + info.guid + ')"><strong>X</strong></a></div>' - + '<input type="hidden" name="' + internalName + '[]" value="' + info.guid + '" />'; - $('<li class="user-picker-entry">').html(li).appendTo(users); - - $(this).val(''); - } -} - -function userPickerRemoveUser(link, guid) { - $(link).parents('.user-picker-entry').remove(); -} - -function userPickerGetSearchParams(e) { - if ($(e).parent().find('.all_users').attr('checked')) { - return {'match_on[]': 'friends'}; - } else { - return {'match_on[]': 'users'}; - } -} - -$(document).ready(function() { - userPickerBindEvents(); -}); -</script> -<?php - $user-picker_js_sent = true; -} - // create an HTML list of users $user_list = ''; foreach ($vars['value'] as $user_id) { - $user_list .= user-picker_add-user($user_id); + $user_list .= user_picker_add_user($user_id); } ?> -<div class="user-picker"> - <input class="internalname" type="hidden" name="internalname" value="<?php echo $vars['internalname']; ?>" /> - <input class="search" type="text" name="user_search" size="30"/> - <span class="controls"> - <label><input class="all_users" type="checkbox" name="match_on" value="true" /><?php echo elgg_echo('userpicker:only_friends'); ?></label> - </span> - <div class="results"> - <!-- This space will be filled with users, checkboxes and magic. --> - </div> - <ul class="users"><?php echo $user_list; ?></ul> +<div class="elgg-user-picker"> + <input type="text" class="elgg-input-user-picker" size="30"/> + <label> + <input type="checkbox" name="match_on" value="true" /> + <?php echo elgg_echo('userpicker:only_friends'); ?> + </label> + <ul class="elgg-user-picker-list"><?php echo $user_list; ?></ul> </div> +<script type="text/javascript"> + // @todo grab the values in the init function rather than using inline JS + elgg.userpicker.userList = <?php echo $json_values ?>; +</script> diff --git a/views/default/js/admin.php b/views/default/js/admin.php new file mode 100644 index 000000000..e8aa0d2ed --- /dev/null +++ b/views/default/js/admin.php @@ -0,0 +1,126 @@ +<?php +/** + * Admin-area specific javascript functions. + * + * @since 1.8 + */ + +if (0) { ?><script><?php } +?> +elgg.provide('elgg.admin'); + +elgg.admin.init = function () { + + // system messages do not fade in admin area, instead slide up when clicked + $('.elgg-system-messages li').stop(true); + $('.elgg-system-messages li').die('click'); + $('.elgg-system-messages li').live('click', function() { + $(this).stop().slideUp('medium'); + }); + + // draggable plugin reordering + $('#elgg-plugin-list > ul').sortable({ + items: 'li:has(> .elgg-state-draggable)', + handle: '.elgg-head', + forcePlaceholderSize: true, + placeholder: 'elgg-widget-placeholder', + opacity: 0.8, + revert: 500, + stop: elgg.admin.movePlugin + }); + + // in-line editing for custom profile fields. + // @note this requires jquery.jeditable plugin + $(".elgg-state-editable").editable(elgg.admin.editProfileField, { + type: 'text', + onblur: 'submit', + width: '300px', + height: 'none', + style: 'display:inline;' + }); + + // draggable profile field reordering. + $('#elgg-profile-fields').sortable({ + items: 'li', + handle: 'span.elgg-state-draggable', + stop: elgg.admin.moveProfileField + }); + + // admin notices delete ajax + $('a.elgg-admin-notice').click(elgg.admin.deleteNotice); +}; + +/** + * Save the plugin order after a move event. + * + * @param {Object} e Event object. + * @param {Object} ui jQueryUI object + * @return void + */ +elgg.admin.movePlugin = function(e, ui) { + // get guid from id like elgg-object-<guid> + var pluginGuid = ui.item.attr('id'); + pluginGuid = pluginGuid.replace('elgg-object-', ''); + + elgg.action('admin/plugins/set_priority', { + data: { + plugin_guid: pluginGuid, + // we start at priority 1 + priority: ui.item.index() + 1 + } + }); +}; + +/** + * In-line editing for custom profile fields + * + * @param string value The new value + * @param {Object} settings The settings used for editable + * @return void + */ +elgg.admin.editProfileField = function(value, settings) { + var id = $(this).attr('id'); + id = id.replace('elgg-profile-field-', ''); + + var data = { + id: id, + label: value + }; + + elgg.action('profile/fields/edit', data); + return value; +}; + +/** + * Save the plugin profile order after a move event. + * + * @param {Object} e Event object. + * @param {Object} ui jQueryUI object + * @return void + */ +elgg.admin.moveProfileField = function(e, ui) { + var orderArr = $('#elgg-profile-fields').sortable('toArray'); + var orderStr = orderArr.join(','); + + elgg.action('profile/fields/reorder', { + fieldorder: orderStr + }); +}; + +/** + * Fires the ajax action to delete the admin notice then hides the notice. + * + * @return void + */ +elgg.admin.deleteNotice = function(e) { + e.preventDefault(); + var $container = $(this).closest('p'); + + elgg.action($(this).attr('href'), { + success: function(json) { + $container.slideUp('medium'); + } + }); +}; + +elgg.register_hook_handler('init', 'system', elgg.admin.init, 1000);
\ No newline at end of file diff --git a/views/default/js/elgg.php b/views/default/js/elgg.php new file mode 100644 index 000000000..c3b56e398 --- /dev/null +++ b/views/default/js/elgg.php @@ -0,0 +1,77 @@ +<?php +/** + * Core Elgg javascript loader + */ +global $CONFIG; + +$prereq_files = array( + "vendors/sprintf.js", + "js/lib/elgglib.js", +); + +foreach ($prereq_files as $file) { + include("{$CONFIG->path}$file"); +} + +//No such thing as autoloading classes in javascript +$model_files = array( + 'ElggEntity', + 'ElggUser', + 'ElggPriorityList', +); + +foreach ($model_files as $file) { + include("{$CONFIG->path}js/classes/$file.js"); +} + +//Include library files +$libs = array( + //libraries + 'prototypes', + 'hooks', + 'security', + 'languages', + 'ajax', + 'session', + 'pageowner', + 'configuration', + + //ui + 'ui', + 'ui.widgets', +); + +foreach ($libs as $file) { + include("{$CONFIG->path}js/lib/$file.js"); + // putting a new line between the files to address https://github.com/elgg/elgg/issues/3081 + echo "\n"; +} + +/** + * Set some values that are cacheable + */ +if (0) { ?><script><?php } +?> + +elgg.version = '<?php echo get_version(); ?>'; +elgg.release = '<?php echo get_version(true); ?>'; +elgg.config.wwwroot = '<?php echo elgg_get_site_url(); ?>'; +<?php //@todo make this configurable ?> +elgg.security.interval = 5 * 60 * 1000; +elgg.config.domReady = false; +elgg.config.language = '<?php echo isset($CONFIG->language) ? $CONFIG->language : 'en'; ?>'; +elgg.config.languageReady = false; + +//After the DOM is ready +$(function() { + elgg.config.domReady = true; + elgg.initWhenReady(); +}); + +<?php + +$previous_content = elgg_view('js/initialise_elgg'); +if ($previous_content) { + elgg_deprecated_notice("The view 'js/initialise_elgg' has been deprecated for js/elgg", 1.8); + echo $previous_content; +} diff --git a/views/default/js/friendsPickerv1.php b/views/default/js/friendsPickerv1.php deleted file mode 100644 index e9a387844..000000000 --- a/views/default/js/friendsPickerv1.php +++ /dev/null @@ -1,93 +0,0 @@ -/* - elgg friendsPicker plugin - adapted from Niall Doherty's excellent Coda-Slider - http://www.ndoherty.com/coda-slider -*/ - - -jQuery.fn.friendsPicker = function(iterator) { - - var settings; - settings = $.extend({ easeFunc: "easeOutExpo", easeTime: 1000, toolTip: false }, settings); - - return this.each(function() { - - var container = $(this); - container.addClass("friends-picker"); - // set panelwidth manually as it's hidden initially - adjust this value for different themes/pagewidths - var panelWidth = 730; - - // count the panels in the container - var panelCount = container.find("div.panel").size(); - // calculate the width of all the panels lined up end-to-end - var friendsPicker_containerWidth = panelWidth*panelCount; - // specify width for the friendsPicker_container - container.find("div.friends-picker-container").css("width" , friendsPicker_containerWidth); - - // global variables for container.each function below - var friendsPickerNavigationWidth = 0; - var currentPanel = 1; - - // generate appropriate nav for each container - container.each(function(i) { - // generate Left and Right arrows - $(this).before("<div class='friends-picker-navigation-l' id='friends-picker-navigation-l" + iterator + "'><a href='#'>Left</a><\/div>"); - $(this).after("<div class='friends-picker-navigation-r' id='friends-picker-navigation-r" + iterator + "'><a href='#'>Right</a><\/div>"); - - // generate a-z tabs - $(this).before("<div class='friends-picker-navigation' id='friends-picker-navigation" + iterator + "'><ul><\/ul><\/div>"); - $(this).find("div.panel").each(function(individualTabItemNumber) { - $("div#friends-picker-navigation" + iterator + " ul").append("<li class='tab" + (individualTabItemNumber+1) + "'><a href='#" + (individualTabItemNumber+1) + "'>" + $(this).attr("title") + "<\/a><\/li>"); - }); - - // tabs navigation - $("div#friends-picker-navigation" + iterator + " a").each(function(individualTabItemNumber) { - // calc friendsPickerNavigationWidth by summing width of each li - friendsPickerNavigationWidth += $(this).parent().width(); - // set-up individual tab clicks - $(this).bind("click", function() { - $(this).addClass("current").parent().parent().find("a").not($(this)).removeClass("current"); - var distanceToMoveFriendsPicker_container = - (panelWidth*individualTabItemNumber); - currentPanel = individualTabItemNumber + 1; - $(this).parent().parent().parent().next().find("div.friends-picker-container").animate({ left: distanceToMoveFriendsPicker_container}, settings.easeTime, settings.easeFunc); - }); - }); - - // Right arow click function - $("div#friends-picker-navigation-r" + iterator + " a").click(function() { - if (currentPanel == panelCount) { - var distanceToMoveFriendsPicker_container = 0; - currentPanel = 1; - $(this).parent().parent().find("div.friends-picker-navigation a.current").removeClass("current").parent().parent().find("a:eq(0)").addClass("current"); - } else { - var distanceToMoveFriendsPicker_container = - (panelWidth*currentPanel); - currentPanel += 1; - $(this).parent().parent().find("div.friends-picker-navigation a.current").removeClass("current").parent().next().find("a").addClass("current"); - }; - $(this).parent().parent().find("div.friends-picker-container").animate({ left: distanceToMoveFriendsPicker_container}, settings.easeTime, settings.easeFunc); - return false; - }); - - // Left arrow click function - $("div#friends-picker-navigation-l" + iterator + " a").click(function() { - if (currentPanel == 1) { - var distanceToMoveFriendsPicker_container = - (panelWidth*(panelCount - 1)); - currentPanel = panelCount; - $(this).parent().parent().find("div.friends-picker-navigation a.current").removeClass("current").parent().parent().find("li:last a").addClass("current"); - } else { - currentPanel -= 1; - var distanceToMoveFriendsPicker_container = - (panelWidth*(currentPanel - 1)); - $(this).parent().parent().find("div.friends-picker-navigation a.current").removeClass("current").parent().prev().find("a").addClass("current"); - }; - $(this).parent().parent().find("div.friends-picker-container").animate({ left: distanceToMoveFriendsPicker_container}, settings.easeTime, settings.easeFunc); - return false; - }); - - // apply 'current' class to currently selected tab link - $("div#friends-picker-navigation" + iterator + " a:eq(0)").addClass("current"); - }); - - $("div#friends-picker-navigation" + iterator).append("<br />"); - }); -}; - - diff --git a/views/default/js/initialise_elgg.php b/views/default/js/initialise_elgg.php index 2db51d991..3d617953a 100644 --- a/views/default/js/initialise_elgg.php +++ b/views/default/js/initialise_elgg.php @@ -1,324 +1,4 @@ <?php /** - * Bootstrap Elgg javascript - */ -global $CONFIG; - -$prereq_files = array( - "vendors/sprintf.js", - "js/lib/elgglib.js", -); - -foreach ($prereq_files as $file) { - include("{$CONFIG->path}$file"); -} - -//No such thing as autoloading classes in javascript -$model_files = array( - 'ElggEntity', - 'ElggUser', - 'ElggPriorityList', -); - -foreach ($model_files as $file) { - include("{$CONFIG->path}js/classes/$file.js"); -} - -//Include library files -$libs = array( - //libraries - 'prototypes', - 'events', - 'security', - 'languages', - 'ajax', - 'session', - - //ui - 'ui', - 'ui.widgets', -); - -foreach ($libs as $file) { - include("{$CONFIG->path}js/lib/$file.js"); -} - -/** - * Set some values that are cacheable - */ -?> - -elgg.version = '<?php echo get_version(); ?>'; -elgg.release = '<?php echo get_version(true); ?>'; -elgg.config.wwwroot = '<?php echo elgg_get_site_url(); ?>'; -elgg.security.interval = 5 * 60 * 1000; <?php //@todo make this configurable ?> - -//Mimic PHP engine boot process - -//Before the DOM is ready -- note that plugins aren't loaded yet -elgg.trigger_event('boot', 'system'); - -//After the DOM is ready -$(function() { - elgg.trigger_event('init', 'system'); -}); - -$(document).ready(function () { - - // COLLAPSABLE WIDGETS (on Dashboard? & Profile pages) - // toggle widget box contents - $('a.toggle_box_contents').bind('click', toggleContent); - - // WIDGET GALLERY EDIT PANEL - // Sortable widgets - var els = ['#leftcolumn_widgets', '#middlecolumn_widgets', '#rightcolumn_widgets', '#widget_picker_gallery' ]; - var $els = $(els.toString()); - - $els.sortable({ - items: '.draggable_widget', - handle: '.drag-handle', - forcePlaceholderSize: true, - placeholder: 'ui-state-highlight', - cursor: 'move', - revert: true, - opacity: 0.9, - appendTo: 'body', - connectWith: els, - start:function(e,ui) { - - }, - stop: function(e,ui) { - // refresh list before updating hidden fields with new widget order - $(this).sortable( "refresh" ); - - var widgetNamesLeft = outputWidgetList('#leftcolumn_widgets'); - var widgetNamesMiddle = outputWidgetList('#middlecolumn_widgets'); - var widgetNamesRight = outputWidgetList('#rightcolumn_widgets'); - - document.getElementById('debugField1').value = widgetNamesLeft; - document.getElementById('debugField2').value = widgetNamesMiddle; - document.getElementById('debugField3').value = widgetNamesRight; - } - }); - - // bind more info buttons - called when new widgets are created - widget_moreinfo(); - - // set-up hover class for dragged widgets - $("#rightcolumn_widgets").droppable({ - accept: ".draggable_widget", - hoverClass: 'droppable-hover' - }); - $("#middlecolumn_widgets").droppable({ - accept: ".draggable_widget", - hoverClass: 'droppable-hover' - }); - $("#leftcolumn_widgets").droppable({ - accept: ".draggable_widget", - hoverClass: 'droppable-hover' - }); - - // user likes - $(".likes-list-button").click(function(event) { - if ($(this).next(".likes-list").css('display') == 'none') { // show list - // hide any other currently viewable likes lists - $('.likes-list').fadeOut(); - - var topPosition = - $(this).next(".likes-list").height(); - topPosition10 = topPosition + 10 + "px"; - topPosition = topPosition - 5 + "px"; - $('.likes-list').css('top',topPosition10); - $('.likes-list').css('left', -$('.likes-list').width()+110); - $(this).next(".likes-list").animate({opacity: "toggle", top: topPosition}, 500); - - // set up cancel for a click outside the likes list - $(document).click(function(event) { - var target = $(event.target); - if (target.parents(".likes-list-holder").length == 0) { - $(".likes-list").fadeOut(); - } - }); - - } else { // hide list - var topPosition = - $(this).next(".likes-list").height() + 5; - $(this).next(".likes-list").animate({opacity: "toggle", top: topPosition}, 500); - } - }); - - elgg_system_message(); - -}); /* end document ready function */ - - - -// display & hide elgg system messages -function elgg_system_message() { - $("#elgg-system-message").animate({opacity: 0.9}, 1000); - $("#elgg-system-message").animate({opacity: 0.9}, 5000); - $("#elgg-system-message").fadeOut('slow'); - - $("#elgg-system-message").click(function () { - $("#elgg-system-message").stop(); - $("#elgg-system-message").fadeOut('slow'); - return false; - }); -} - -// reusable slide in/out toggle function -function elgg_slide_toggle(activateLink, parentElement, toggleElement) { - $(activateLink).closest(parentElement).find(toggleElement).animate({"height": "toggle"}, { duration: 400 }); - return false; -} - -// List active widgets for each page column -function outputWidgetList(forElement) { - return( $("input[name='handler'], input[name='guid']", forElement ).makeDelimitedList("value") ); -} - -// Make delimited list -jQuery.fn.makeDelimitedList = function(elementAttribute) { - - var delimitedListArray = new Array(); - var listDelimiter = "::"; - - // Loop over each element in the stack and add the elementAttribute to the array - this.each(function(e) { - var listElement = $(this); - // Add the attribute value to our values array - delimitedListArray[delimitedListArray.length] = listElement.attr(elementAttribute); - } - ); - - // Return value list by joining the array - return(delimitedListArray.join(listDelimiter)); -} - - -// Read each widgets collapsed/expanded state from cookie and apply -function widget_state(forWidget) { - - var thisWidgetState = $.cookie(forWidget); - - if (thisWidgetState == 'collapsed') { - forWidget = "#" + forWidget; - $(forWidget).find("div.collapsable_box_content").hide(); - $(forWidget).find("a.toggle_box_contents").html('+'); - $(forWidget).find("a.toggle_box_edit_panel").fadeOut('medium'); - }; -} - - -// Toggle widgets contents and save to a cookie -var toggleContent = function(e) { -var targetContent = $('div.collapsable_box_content', this.parentNode.parentNode); - if (targetContent.css('display') == 'none') { - targetContent.slideDown(400); - $(this).html('-'); - $(this.parentNode).children(".toggle_box_edit_panel").fadeIn('medium'); - - // set cookie for widget panel open-state - var thisWidgetName = $(this.parentNode.parentNode.parentNode).attr('id'); - $.cookie(thisWidgetName, 'expanded', { expires: 365 }); - - } else { - targetContent.slideUp(400); - $(this).html('+'); - $(this.parentNode).children(".toggle_box_edit_panel").fadeOut('medium'); - // make sure edit pane is closed - $(this.parentNode.parentNode).children(".collapsable_box_editpanel").hide(); - - // set cookie for widget panel closed-state - var thisWidgetName = $(this.parentNode.parentNode.parentNode).attr('id'); - $.cookie(thisWidgetName, 'collapsed', { expires: 365 }); - } - return false; -}; - -// More info tooltip in widget gallery edit panel -function widget_moreinfo() { - - $("img.more_info").hover(function(e) { - var widgetdescription = $("input[name='description']", this.parentNode.parentNode.parentNode ).attr('value'); - $("body").append("<p id='widget_moreinfo'><b>"+ widgetdescription +" </b></p>"); - - if (e.pageX < 900) { - $("#widget_moreinfo") - .css("top",(e.pageY + 10) + "px") - .css("left",(e.pageX + 10) + "px") - .fadeIn("medium"); - } - else { - $("#widget_moreinfo") - .css("top",(e.pageY + 10) + "px") - .css("left",(e.pageX - 210) + "px") - .fadeIn("medium"); - } - }, - function() { - $("#widget_moreinfo").remove(); - }); - - $("img.more_info").mousemove(function(e) { - // action on mousemove - }); -}; - -// ELGG DROP DOWN MENU -$.fn.elgg_dropdownmenu = function(options) { - -options = $.extend({speed: 350}, options || {}); - -this.each(function() { - - var root = this, zIndex = 5000; - - function getSubnav(ele) { - if (ele.nodeName.toLowerCase() == 'li') { - var subnav = $('> ul', ele); - return subnav.length ? subnav[0] : null; - } else { - - return ele; - } - } - - function getActuator(ele) { - if (ele.nodeName.toLowerCase() == 'ul') { - return $(ele).parents('li')[0]; - } else { - return ele; - } - } - - function hide() { - var subnav = getSubnav(this); - if (!subnav) return; - $.data(subnav, 'cancelHide', false); - setTimeout(function() { - if (!$.data(subnav, 'cancelHide')) { - $(subnav).slideUp(100); - } - }, 250); - } - - function show() { - var subnav = getSubnav(this); - if (!subnav) return; - $.data(subnav, 'cancelHide', true); - $(subnav).css({zIndex: zIndex++}).slideDown(options.speed); - if (this.nodeName.toLowerCase() == 'ul') { - var li = getActuator(this); - $(li).addClass('hover'); - $('> a', li).addClass('hover'); - } - } - - $('ul, li', this).hover(show, hide); - $('li', this).hover( - function() { $(this).addClass('hover'); $('> a', this).addClass('hover'); }, - function() { $(this).removeClass('hover'); $('> a', this).removeClass('hover'); } - ); - -}); - -};
\ No newline at end of file + * This has been deprecated in 1.8 - see elgg.php in this directory. + */
\ No newline at end of file diff --git a/views/default/js/initialize_elgg.php b/views/default/js/initialize_elgg.php new file mode 100644 index 000000000..b45c33463 --- /dev/null +++ b/views/default/js/initialize_elgg.php @@ -0,0 +1,52 @@ +<?php +/** + * Initialize Elgg's js lib with the uncacheable data + */ + +if (0) { ?><script><?php } +?> +/** + * Don't want to cache these -- they could change for every request + */ +elgg.config.lastcache = <?php echo (int)elgg_get_config('lastcache'); ?>; +elgg.config.viewtype = '<?php echo elgg_get_viewtype(); ?>'; +elgg.config.simplecache_enabled = <?php echo (int)elgg_is_simplecache_enabled(); ?>; + +elgg.security.token.__elgg_ts = <?php echo $ts = time(); ?>; +elgg.security.token.__elgg_token = '<?php echo generate_action_token($ts); ?>'; + +<?php +// @todo json export should be smoother than this... +// @todo Might also be nice to make url exportable. $entity->url? yes please! +$page_owner = elgg_get_page_owner_entity(); + +if ($page_owner instanceof ElggEntity) { + $page_owner_json = array(); + foreach ($page_owner->getExportableValues() as $v) { + $page_owner_json[$v] = $page_owner->$v; + } + + $page_owner_json['subtype'] = $page_owner->getSubtype(); + $page_owner_json['url'] = $page_owner->getURL(); + + echo 'elgg.page_owner = ' . json_encode($page_owner_json) . ';'; +} + +$user = elgg_get_logged_in_user_entity(); + +if ($user instanceof ElggUser) { + $user_json = array(); + foreach ($user->getExportableValues() as $v) { + $user_json[$v] = $user->$v; + } + + $user_json['subtype'] = $user->getSubtype(); + $user_json['url'] = $user->getURL(); + $user_json['admin'] = $user->isAdmin(); + + echo 'elgg.session.user = new elgg.ElggUser(' . json_encode($user_json) . ');'; +} +?> + +//Before the DOM is ready, but elgg's js framework is fully initalized +elgg.trigger_hook('boot', 'system');
\ No newline at end of file diff --git a/views/default/js/languages.php b/views/default/js/languages.php index 34367aaf1..fcf903d4b 100644 --- a/views/default/js/languages.php +++ b/views/default/js/languages.php @@ -1,9 +1,33 @@ -<?php
-/**
- * @uses $vars['language']
- */
-global $CONFIG;
-
-$language = $vars['language'];
-
-echo json_encode($CONFIG->translations[$language]);
\ No newline at end of file +<?php +/** + * @uses $vars['language'] + * @uses $vars['lc'] if present, client will be sent long expires headers + */ + +$language = $vars['language']; +$lastcache = elgg_extract('lc', $vars, 0); + +// @todo add server-side caching +if ($lastcache) { + // we're relying on lastcache changes to predict language changes + $etag = '"' . md5("$language|$lastcache") . '"'; + + header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', strtotime("+6 months")), true); + header("Pragma: public", true); + header("Cache-Control: public", true); + header("ETag: $etag"); + + if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && trim($_SERVER['HTTP_IF_NONE_MATCH']) === $etag) { + header("HTTP/1.1 304 Not Modified"); + exit; + } +} + +$all_translations = elgg_get_config('translations'); +$translations = $all_translations['en']; + +if ($language != 'en') { + $translations = array_merge($translations, $all_translations[$language]); +} + +echo json_encode($translations);
\ No newline at end of file diff --git a/views/default/js/languages/en.php b/views/default/js/languages/en.php index afcf4bb7f..8a604cc12 100644 --- a/views/default/js/languages/en.php +++ b/views/default/js/languages/en.php @@ -1,2 +1,2 @@ -<?php
+<?php echo elgg_view('js/languages', array('language' => 'en'));
\ No newline at end of file diff --git a/views/default/js/lightbox.php b/views/default/js/lightbox.php new file mode 100644 index 000000000..a1f018eea --- /dev/null +++ b/views/default/js/lightbox.php @@ -0,0 +1,36 @@ +<?php +/** + * Elgg lightbox + * + * Usage + * Call elgg_load_js('lightbox') and elgg_load_css('lightbox') then + * apply the class elgg-lightbox to links. + * + * Advanced Usage + * Elgg is distributed with the Fancybox jQuery library. Please go to + * http://fancybox.net for more information on the options of this lightbox. + * + * Overriding + * In a plugin, override this view and override the registration for the + * lightbox JavaScript and CSS (@see elgg_views_boot()). + * + * @todo add support for passing options: $('#myplugin-lightbox').elgg.ui.lightbox(options); + */ + +if (0) { ?><script><?php } +?> + +/** + * Lightbox initialization + */ +elgg.ui.lightbox_init = function() { + $(".elgg-lightbox").fancybox(); +} + +elgg.register_hook_handler('init', 'system', elgg.ui.lightbox_init); + +<?php + +$js_path = elgg_get_config('path'); +$js_path = "{$js_path}vendors/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"; +include $js_path; diff --git a/views/default/js/upload_js.php b/views/default/js/upload_js.php deleted file mode 100644 index cdd011729..000000000 --- a/views/default/js/upload_js.php +++ /dev/null @@ -1,57 +0,0 @@ -<script> -/* -Part of multi file uploader -*/ - -var number_of_files = 1; - -// wait for the DOM to be loaded -$(document).ready(function() { - // bind 'file_form' and provide a simple callback function - $('#file_form').submit(function() { - $('#form_container').hide(); - $('#form_message').html('<div class="contentWrapper"><?php echo $vars['submit_message']; ?></div>'); - $('#form_message').show(); - $(this).ajaxSubmit(function(response_message) { - $('#form_message').html('<div class="contentWrapper">'+response_message+'</div>'); - }); - - return false; - }); -}); - -function file_generate_bit(bit_label,prefix,classname,field_type,field_size) { - bit = document.createElement('p'); - label = document.createElement('label'); - textnode = document.createTextNode(bit_label); - label.appendChild(textnode); - el = document.createElement('br'); - label.appendChild(el); - el = document.createElement('input'); - el.type = field_type; - el.className = classname; - if (field_size > 0) { - el.size = field_size; - } - el.name = prefix+number_of_files; - el.value = ""; - label.appendChild(el); - bit.appendChild(label); - - return bit; -} - -function file_addtoform() { - var o,el; - o = document.getElementById('option_container'); - title_label = "<?php echo elgg_echo("title"); ?>"; - bit = file_generate_bit(title_label,'title_','input-text','text',0); - o.appendChild(bit); - file_label = "<?php echo elgg_echo("file:file"); ?>"; - bit = file_generate_bit(file_label,'upload_','input-file','file',30); - o.appendChild(bit); - - number_of_files++; - document.file_form.number_of_files.value = number_of_files; -} -</script>
\ No newline at end of file diff --git a/views/default/js/walled_garden.php b/views/default/js/walled_garden.php new file mode 100644 index 000000000..e228df507 --- /dev/null +++ b/views/default/js/walled_garden.php @@ -0,0 +1,67 @@ +<?php +/** + * Walled garden JavaScript + * + * @since 1.8 + */ + +$cancel_button = elgg_view('input/button', array( + 'value' => elgg_echo('cancel'), + 'class' => 'elgg-button-cancel mlm', +)); +$cancel_button = json_encode($cancel_button); + +if (0) { ?><script><?php } +?> + +elgg.provide('elgg.walled_garden'); + +elgg.walled_garden.init = function () { + + $('.forgot_link').click(elgg.walled_garden.load('lost_password')); + $('.registration_link').click(elgg.walled_garden.load('register')); + + $('input.elgg-button-cancel').live('click', function(event) { + var $wgs = $('.elgg-walledgarden-single'); + if ($wgs.is(':visible')) { + $('.elgg-walledgarden-double').fadeToggle(); + $wgs.fadeToggle(); + $wgs.remove(); + } + event.preventDefault(); + }); +}; + +/** + * Creates a closure for loading walled garden content through ajax + * + * @param {String} view Name of the walled garden view + * @return {Object} + */ +elgg.walled_garden.load = function(view) { + return function(event) { + var id = '#elgg-walledgarden-' + view; + id = id.replace('_', '-'); + //@todo display some visual element that indicates that loading of content is running + elgg.get('walled_garden/' + view, { + 'success' : function(data) { + var $wg = $('.elgg-body-walledgarden'); + $wg.append(data); + $(id).find('input.elgg-button-submit').after(<?php echo $cancel_button; ?>); + + if (view == 'register' && $wg.hasClass('hidden')) { + // this was a failed register, display the register form ASAP + $('#elgg-walledgarden-login').toggle(false); + $(id).toggle(); + $wg.removeClass('hidden'); + } else { + $('#elgg-walledgarden-login').fadeToggle(); + $(id).fadeToggle(); + } + } + }); + event.preventDefault(); + }; +}; + +elgg.register_hook_handler('init', 'system', elgg.walled_garden.init);
\ No newline at end of file diff --git a/views/default/layout/objects/media.php b/views/default/layout/objects/media.php deleted file mode 100644 index 232acc8f1..000000000 --- a/views/default/layout/objects/media.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php -/** - * Elgg media element - * - * --------------------------------------------------- - * | | | - * | icon | body | - * | block | block | - * | | | - * --------------------------------------------------- - * - * @uses $vars['body'] HTML content of the body block - * @uses $vars['icon'] HTML content of the icon block - * @uses $vars['class'] Optional additional class for media element - * @uses $vars['id'] Optional id for the media element - * @uses $vars['body_class'] Optional additional class for body block - * @uses $vars['icon_class'] Optional additional class for icon block - */ - -$body = elgg_get_array_value('body', $vars, ''); -$icon_block = elgg_get_array_value('icon', $vars, ''); - -$class = 'elgg-media'; -$additional_class = elgg_get_array_value('class', $vars, ''); -if ($additional_class) { - $class = "$class $additional_class"; -} - -$id = ''; -if (isset($vars['id'])) { - $id = "id=\"{$vars['id']}\""; -} - - -$body_class = 'elgg-body'; -$additional_class = elgg_get_array_value('body_class', $vars, ''); -if ($additional_class) { - $body_class = "$body_class $additional_class"; -} -$body = "<div class=\"$body_class\">$body</div>"; - -$icon_class = 'elgg-icon'; -$additional_class = elgg_get_array_value('icon_class', $vars, ''); -if ($additional_class) { - $icon_class = "$icon_class $additional_class"; -} -if ($icon_block) { - $icon_block = "<div class=\"$icon_class\">$icon_block</div>"; -} - -echo <<<HTML -<div class="$class clearfix" $id> - $icon_block$body -</div> -HTML; diff --git a/views/default/layout/objects/module.php b/views/default/layout/objects/module.php deleted file mode 100644 index ffce583ff..000000000 --- a/views/default/layout/objects/module.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * Elgg module element - * - * @uses $vars['title'] Title text - * @uses $vars['header'] HTML content of the header - * @uses $vars['body'] HTML content of the body - * @uses $vars['footer'] HTML content of the footer - * @uses $vars['class'] Optional additional class for module - * @uses $vars['id'] Optional id for module - * @uses $vars['header_class'] Optional additional class for header - * @uses $vars['body_class'] Optional additional class for body - * @uses $vars['footer_class'] Optional additional class for footer - * @uses $vars['skip_inner'] Optional flag to leave out inner div - */ - -$title = elgg_get_array_value('title', $vars, ''); -$header = elgg_get_array_value('header', $vars, ''); -$body = elgg_get_array_value('body', $vars, ''); -$footer = elgg_get_array_value('footer', $vars, ''); -$skip_inner = elgg_get_array_value('skip_inner', $vars, false); - -$class = 'elgg-module'; -$additional_class = elgg_get_array_value('class', $vars, ''); -if ($additional_class) { - $class = "$class $additional_class"; -} - -$id = ''; -if (isset($vars['id'])) { - $id = "id=\"{$vars['id']}\""; -} - - -$header_class = 'elgg-header'; -$additional_class = elgg_get_array_value('header_class', $vars, ''); -if ($additional_class) { - $header_class = "$header_class $additional_class"; -} - -if (isset($vars['header'])) { - if ($vars['header']) { - $header = "<div class=\"$header_class\">$header</div>"; - } -} else { - $header = "<div class=\"$header_class\"><h3>$title</h3></div>"; -} - -$body_class = 'elgg-body'; -$additional_class = elgg_get_array_value('body_class', $vars, ''); -if ($additional_class) { - $body_class = "$body_class $additional_class"; -} -$body = "<div class=\"$body_class\">$body</div>"; - - -$footer_class = 'elgg-footer'; -$additional_class = elgg_get_array_value('footer_class', $vars, ''); -if ($additional_class) { - $body_class = "$footer_class $additional_class"; -} - -if (isset($vars['footer'])) { - if ($vars['footer']) { - $header = "<div class=\"$footer_class\">$footer</div>"; - } -} - -$contents = $header . $body . $footer; -if (!$skip_inner) { - $contents = "<div class=\"elgg-inner\">$contents</div>"; -} - -echo "<div class=\"$class\" $id>$contents</div>"; diff --git a/views/default/layout/shells/administration.php b/views/default/layout/shells/administration.php deleted file mode 100644 index f7ed84935..000000000 --- a/views/default/layout/shells/administration.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -/** - * Elgg Admin Area Canvas - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['content'] Content string - * @uses $vars['sidebar'] Optional sidebar content - */ -?> - -<div id="admin_header"> - <span class="network-title"><h2> - <a href="<?php echo elgg_get_site_url(); ?>"> - <?php echo $vars['config']->sitename; echo " ".elgg_echo('admin'); ?></a> - <a class="return_to_network" href="<?php echo elgg_get_site_url(); ?>"><< Return to network</a> - </h2></span> -</div> - -<div id="elgg-content" class="clearfix admin_area"> - - <div id="elgg-page-contents" class="clearfix"> - <?php - if (isset($vars['content'])) { - echo $vars['content']; - } - ?> - </div> - <div id="elgg-sidebar" class="clearfix"> - <?php - echo elgg_view('page_elements/sidebar', $vars); - ?> - </div> -</div> -<div id="admin_footer"></div>
\ No newline at end of file diff --git a/views/default/layout/shells/content/filter.php b/views/default/layout/shells/content/filter.php deleted file mode 100644 index 0b2562450..000000000 --- a/views/default/layout/shells/content/filter.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * Main content filter - * - * Select between user, friends, and all content - * - * @uses $vars['filter_context'] Filter context: everyone, friends, mine - * @uses $vars['filter_override'] HTML for overriding the default filter (override) - * @uses $vars['context'] Page context (override) - */ - -if (isset($vars['filter_override'])) { - echo $vars['filter_override']; - return true; -} - -$context = elgg_get_array_value('context', $vars, elgg_get_context()); - -if (isloggedin() && $context) { - $username = get_loggedin_user()->username; - $filter_context = elgg_get_array_value('filter_context', $vars, 'everyone'); - - // generate a list of default tabs - $tabs = array( - 'all' => array( - 'title' => elgg_echo('all'), - 'url' => (isset($vars['all_link'])) ? $vars['all_link'] : "pg/$context/all/", - 'selected' => ($filter_context == 'everyone'), - ), - 'mine' => array( - 'title' => elgg_echo('mine'), - 'url' => (isset($vars['mine_link'])) ? $vars['mine_link'] : "pg/$context/owner/$username/", - 'selected' => ($filter_context == 'mine'), - ), - 'friend' => array( - 'title' => elgg_echo('friends'), - 'url' => (isset($vars['friend_link'])) ? $vars['friend_link'] : "pg/$context/friends/$username/", - 'selected' => ($filter_context == 'friends'), - ), - ); - - echo elgg_view('navigation/tabs', array('tabs' => $tabs)); -} diff --git a/views/default/layout/shells/content/header.php b/views/default/layout/shells/content/header.php deleted file mode 100644 index a7c0d1389..000000000 --- a/views/default/layout/shells/content/header.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * Main content header - * - * This includes a title and a new content button by default - * - * @uses $vars['header_override'] HTML for overriding the default header (override) - * @uses $vars['title'] Title text (override) - * @uses $vars['context'] Page context (override) - * @uses $vars['buttons'] Content header buttons (override) - */ - -if (isset($vars['header_override'])) { - echo $vars['header_override']; - return true; -} - -$context = elgg_get_array_value('context', $vars, elgg_get_context()); -if ($context) { - $title = elgg_get_array_value('title', $vars, ''); - if (!$title) { - $title = elgg_echo($context); - } - - if (isset($vars['buttons'])) { - $buttons = $vars['buttons']; - } else { - if (isloggedin() && $context) { - $username = get_loggedin_user()->username; - $new_link = elgg_get_array_value('new_link', $vars, "pg/$context/new/$username/"); - $params = array( - 'href' => $new_link = elgg_normalize_url($new_link), - 'text' => elgg_echo("$context:new"), - 'class' => 'action-button right', - ); - $buttons = elgg_view('output/url', $params); - } - } - echo <<<HTML -<div class="elgg-main-header clearfix"> - <h2 class="elgg-main-heading">$title</h2>$buttons -</div> -HTML; -} diff --git a/views/default/layout/shells/one_column.php b/views/default/layout/shells/one_column.php deleted file mode 100644 index 84a304e14..000000000 --- a/views/default/layout/shells/one_column.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Elgg one-column layout - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['content'] Content string - */ -?> -<div class="elgg-layout-one_column elgg-center elgg-width-classic clearfix"> - <div class="elgg-body"> - <?php echo $vars['content']; ?> - <?php echo $vars['area1']; ?> - </div> -</div>
\ No newline at end of file diff --git a/views/default/layout/shells/one_column_with_sidebar.php b/views/default/layout/shells/one_column_with_sidebar.php deleted file mode 100644 index e408c6c1c..000000000 --- a/views/default/layout/shells/one_column_with_sidebar.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * Elgg 1 column with sidebar layout - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['content'] The content string for the main column - * @uses $vars['sidebar'] Optional content that is displayed in the sidebar - */ -?> - -<div class="elgg-layout-sidebar elgg-center elgg-width-classic clearfix"> - <div class="elgg-sidebar elgg-aside"> - <?php - echo elgg_view('page_elements/sidebar', $vars); - ?> - </div> - - <div class="elgg-main elgg-body"> - <?php - // @todo deprecated so remove in Elgg 2.0 - if (isset($vars['area1'])) { - echo $vars['area1']; - } - if (isset($vars['content'])) { - echo $vars['content']; - } - ?> - </div> -</div> diff --git a/views/default/layout/shells/one_sidebar.php b/views/default/layout/shells/one_sidebar.php deleted file mode 100644 index d0bb3879f..000000000 --- a/views/default/layout/shells/one_sidebar.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * Elgg main column with one sidebar layout - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['body'] Content HTML for the main column - * @uses $vars['sidebar'] Optional content that is displayed in the sidebar - */ -?> - -<div class="elgg-layout-sidebar elgg-center elgg-width-classic clearfix"> - <div class="elgg-sidebar elgg-aside"> - <?php - echo elgg_view('page_elements/sidebar', $vars); - ?> - </div> - - <div class="elgg-main elgg-body"> - <?php - // @todo deprecated so remove in Elgg 2.0 - if (isset($vars['area1'])) { - echo $vars['area1']; - } - if (isset($vars['body'])) { - echo $vars['body']; - } - ?> - </div> -</div> diff --git a/views/default/layout/shells/two_sidebar.php b/views/default/layout/shells/two_sidebar.php deleted file mode 100644 index 26fb64920..000000000 --- a/views/default/layout/shells/two_sidebar.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * Elgg 2 sidebar layout - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['content'] The content string for the main column - * @uses $vars['sidebar'] Optional content that is displayed in the sidebar - * @uses $vars['sidebar-alt'] Optional content that is displayed in the alternate sidebar - */ -?> - -<div class="elgg-layout-two-sidebar elgg-center elgg-width-classic clearfix"> - <div class="elgg-sidebar elgg-aside"> - <?php - echo elgg_view('page_elements/sidebar', $vars); - ?> - </div> - <div class="elgg-sidebar-alt elgg-aside"> - <?php - //$params = $vars; - //$params['sidebar'] = $vars['sidebar-alt']; - $params = array( - 'sidebar' => elgg_view('layout_elements/module', array('title' => 'Testing', 'body' => 'Hello, world!')) - ); - echo elgg_view('page_elements/sidebar', $params); - ?> - </div> - - <div class="elgg-main elgg-body"> - <?php - // @todo deprecated so remove in Elgg 2.0 - if (isset($vars['area1'])) { - echo $vars['area1']; - } - if (isset($vars['content'])) { - echo $vars['content']; - } - ?> - </div> -</div> diff --git a/views/default/layout/shells/widgets.php b/views/default/layout/shells/widgets.php deleted file mode 100644 index 130b2eaad..000000000 --- a/views/default/layout/shells/widgets.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Elgg widgets layout - * - * @uses $vars['box'] Optional display box at the top of layout - * @uses $vars['num_columns'] Number of widget columns for this layout - * @uses $vars['show_add_widgets'] Display the add widgets button and panel - */ - -$box = elgg_get_array_value('box', $vars, ''); -$num_columns = elgg_get_array_value('num_columns', $vars, 3); -$show_add_widgets = elgg_get_array_value('show_add_widgets', $vars, true); - -$owner = elgg_get_page_owner(); -$context = elgg_get_context(); -elgg_push_context('widgets'); - -$widgets = elgg_get_widgets($owner->guid, $context); - -if (elgg_can_edit_widget_layout($context)) { - if ($show_add_widgets) { - echo elgg_view('widgets/add-button'); - } - $params = array( - 'widgets' => $widgets, - 'context' => $context, - ); - echo elgg_view('widgets/add_panel', $params); -} - -echo $vars['box']; - -$widget_class = "widget-{$num_columns}-columns"; -for ($column_index = 1; $column_index <= $num_columns; $column_index++) { - $column_widgets = $widgets[$column_index]; - - echo "<div class=\"widget-column $widget_class\" id=\"widget-col-$column_index\">"; - if (is_array($column_widgets) && sizeof($column_widgets) > 0) { - foreach ($column_widgets as $widget) { - echo elgg_view_entity($widget); - } - } - echo '</div>'; -} - -elgg_pop_context();
\ No newline at end of file diff --git a/views/default/likes/forms/display.php b/views/default/likes/forms/display.php deleted file mode 100644 index 36e2cddc2..000000000 --- a/views/default/likes/forms/display.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php -/** - * Elgg likes - display users liked link/text - * - * @package Elgg - * - * @uses $vars['entity'] - */ - -if (isset($vars['entity']) && isloggedin()) { - - //display the number of likes - $numoflikes = elgg_count_likes($vars['entity']); - if ($numoflikes != 0) { - if ($numoflikes == 1) { - $user_string = elgg_echo('likes:userlikedthis'); - } else { - $user_string = elgg_echo('likes:userslikedthis'); - } - - echo "<a class='river_more_comments off likes_user_list_button link'>" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>"; - } -}
\ No newline at end of file diff --git a/views/default/likes/forms/edit.php b/views/default/likes/forms/edit.php deleted file mode 100644 index 33527b53a..000000000 --- a/views/default/likes/forms/edit.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * Elgg likes add form - * - * @package Elgg - * - * @uses $vars['entity'] - */ - -if (isset($vars['entity']) && isloggedin()) { - $guid = $vars['entity']->getGuid(); - $url = elgg_add_action_tokens_to_url(elgg_get_site_url() . "action/likes/add?guid={$guid}"); - - echo "<span class='likes-list-holder'>"; - //check to see if the user has already liked - if (!elgg_annotation_exists($guid, 'likes') ) { - echo "<a class='user-like link' title='".elgg_echo('likes:likethis')."' href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a>"; - $likes_classname = "not-liked"; - $likes_titletag = ""; - } else { - $likes_titletag = "title='".elgg_echo('likes:remove')."'"; - } - //display the number of likes - $numoflikes = elgg_count_likes($vars['entity']); - if ($numoflikes != 0) { - if ($numoflikes == 1) { - $user_string = elgg_echo('likes:userlikedthis'); - } else { - $user_string = elgg_echo('likes:userslikedthis'); - } - - echo "<a class='likes-list-button link {$likes_classname}' {$likes_titletag}>" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>"; - - //show the users who liked the object - echo "<div class='likes-list hidden clearfix'>"; - echo list_annotations($vars['entity']->getGUID(), 'likes', 99); - echo "</div>"; - } - echo "</span>"; -} - - - - - diff --git a/views/default/likes/forms/link.php b/views/default/likes/forms/link.php deleted file mode 100644 index decb4aa7f..000000000 --- a/views/default/likes/forms/link.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -/** - * Elgg likes link form - used on riverdashboard where we want the likes link separate from the list of users that liked the object - * - * @package Elgg - * - * @uses $vars['entity'] - */ - -if (isset($vars['entity']) && isloggedin()) { - $guid = $vars['entity']->getGuid(); - $url = elgg_add_action_tokens_to_url(elgg_get_site_url() . "action/likes/add?guid={$guid}"); - //check to see if the user has already liked - if (!elgg_annotation_exists($guid, 'likes') ) { - echo "<span class='river_link_divider'> | </span><a class='river_user-like_button link' href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a>"; - } -}
\ No newline at end of file diff --git a/views/default/navigation/breadcrumbs.php b/views/default/navigation/breadcrumbs.php index 67e985bed..88577a8ff 100644 --- a/views/default/navigation/breadcrumbs.php +++ b/views/default/navigation/breadcrumbs.php @@ -17,8 +17,8 @@ if (isset($vars['breadcrumbs'])) { $breadcrumbs = elgg_get_breadcrumbs(); } -$class = 'elgg-breadcrumbs'; -$additional_class = elgg_get_array_value('class', $vars, ''); +$class = 'elgg-menu elgg-breadcrumbs'; +$additional_class = elgg_extract('class', $vars, ''); if ($additional_class) { $class = "$class $additional_class"; } @@ -30,6 +30,7 @@ if (is_array($breadcrumbs) && count($breadcrumbs) > 0) { $crumb = elgg_view('output/url', array( 'href' => $breadcrumb['link'], 'text' => $breadcrumb['title'], + 'is_trusted' => true, )); } else { $crumb = $breadcrumb['title']; diff --git a/views/default/navigation/listtype.php b/views/default/navigation/listtype.php deleted file mode 100644 index 9b86df40c..000000000 --- a/views/default/navigation/listtype.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * Elgg list view switcher - * - * @package Elgg - * @subpackage Core - */ - -$baseurl = elgg_http_remove_url_query_element($vars['baseurl'], 'search_listtype'); - -if ($vars['listtype'] == "list") { - $listtype = "gallery"; -} else { - $listtype = "list"; -} - -if (substr_count($baseurl,'?')) { - $baseurl .= "&search_listtype=" . $listtype; -} else { - $baseurl .= "?search_listtype=" . $listtype; -} - -?> - -<p class="margin-top"> - <?php echo elgg_echo("listtype:change") ?>: - <a href="<?php echo $baseurl; ?>"><?php echo elgg_echo("listtype:{$listtype}"); ?></a> -</p>
\ No newline at end of file diff --git a/views/default/navigation/menu/default.php b/views/default/navigation/menu/default.php new file mode 100644 index 000000000..006deb3ea --- /dev/null +++ b/views/default/navigation/menu/default.php @@ -0,0 +1,31 @@ +<?php +/** + * Default menu + * + * @uses $vars['name'] Name of the menu + * @uses $vars['menu'] Array of menu items + * @uses $vars['class'] Additional CSS class for the menu + * @uses $vars['item_class'] Additional CSS class for each menu item + * @uses $vars['show_section_headers'] Do we show headers for each section? + */ + +// we want css classes to use dashes +$vars['name'] = preg_replace('/[^a-z0-9\-]/i', '-', $vars['name']); +$headers = elgg_extract('show_section_headers', $vars, false); +$item_class = elgg_extract('item_class', $vars, ''); + +$class = "elgg-menu elgg-menu-{$vars['name']}"; +if (isset($vars['class'])) { + $class .= " {$vars['class']}"; +} + +foreach ($vars['menu'] as $section => $menu_items) { + echo elgg_view('navigation/menu/elements/section', array( + 'items' => $menu_items, + 'class' => "$class elgg-menu-{$vars['name']}-$section", + 'section' => $section, + 'name' => $vars['name'], + 'show_section_headers' => $headers, + 'item_class' => $item_class, + )); +} diff --git a/views/default/navigation/menu/elements/item.php b/views/default/navigation/menu/elements/item.php new file mode 100644 index 000000000..fd9738826 --- /dev/null +++ b/views/default/navigation/menu/elements/item.php @@ -0,0 +1,43 @@ +<?php +/** + * A single element of a menu. + * + * @package Elgg.Core + * @subpackage Navigation + * + * @uses $vars['item'] ElggMenuItem + * @uses $vars['item_class'] Additional CSS class for the menu item + */ + +$item = $vars['item']; + +$link_class = 'elgg-menu-closed'; +if ($item->getSelected()) { + // @todo switch to addItemClass when that is implemented + //$item->setItemClass('elgg-state-selected'); + $link_class = 'elgg-menu-opened'; +} + +$children = $item->getChildren(); +if ($children) { + $item->addLinkClass($link_class); + $item->addLinkClass('elgg-menu-parent'); +} + +$item_class = $item->getItemClass(); +if ($item->getSelected()) { + $item_class = "$item_class elgg-state-selected"; +} +if (isset($vars['item_class']) && $vars['item_class']) { + $item_class .= ' ' . $vars['item_class']; +} + +echo "<li class=\"$item_class\">"; +echo $item->getContent(); +if ($children) { + echo elgg_view('navigation/menu/elements/section', array( + 'items' => $children, + 'class' => 'elgg-menu elgg-child-menu', + )); +} +echo '</li>'; diff --git a/views/default/navigation/menu/elements/section.php b/views/default/navigation/menu/elements/section.php new file mode 100644 index 000000000..c0e9ba750 --- /dev/null +++ b/views/default/navigation/menu/elements/section.php @@ -0,0 +1,30 @@ +<?php +/** + * Menu group + * + * @uses $vars['items'] Array of menu items + * @uses $vars['class'] Additional CSS class for the section + * @uses $vars['name'] Name of the menu + * @uses $vars['section'] The section name + * @uses $vars['item_class'] Additional CSS class for each menu item + * @uses $vars['show_section_headers'] Do we show headers for each section + */ + +$headers = elgg_extract('show_section_headers', $vars, false); +$class = elgg_extract('class', $vars, ''); +$item_class = elgg_extract('item_class', $vars, ''); + +if ($headers) { + $name = elgg_extract('name', $vars); + $section = elgg_extract('section', $vars); + echo '<h2>' . elgg_echo("menu:$name:header:$section") . '</h2>'; +} + +echo "<ul class=\"$class\">"; +foreach ($vars['items'] as $menu_item) { + echo elgg_view('navigation/menu/elements/item', array( + 'item' => $menu_item, + 'item_class' => $item_class, + )); +} +echo '</ul>'; diff --git a/views/default/navigation/menu/page.php b/views/default/navigation/menu/page.php new file mode 100644 index 000000000..56a288234 --- /dev/null +++ b/views/default/navigation/menu/page.php @@ -0,0 +1,36 @@ +<?php +/** + * Page menu + * + * @uses $vars['menu'] + * @uses $vars['selected_item'] + * @uses $vars['class'] + * @uses $vars['name'] + * @uses $vars['show_section_headers'] + */ + +$headers = elgg_extract('show_section_headers', $vars, false); + +$class = 'elgg-menu elgg-menu-page'; +if (isset($vars['class'])) { + $class = "$class {$vars['class']}"; +} + +if (isset($vars['selected_item'])) { + $parent = $vars['selected_item']->getParent(); + + while ($parent) { + $parent->setSelected(); + $parent = $parent->getParent(); + } +} + +foreach ($vars['menu'] as $section => $menu_items) { + echo elgg_view('navigation/menu/elements/section', array( + 'items' => $menu_items, + 'class' => "$class elgg-menu-page-$section", + 'section' => $section, + 'name' => $vars['name'], + 'show_section_headers' => $headers + )); +} diff --git a/views/default/navigation/menu/site.php b/views/default/navigation/menu/site.php new file mode 100644 index 000000000..24c21dd57 --- /dev/null +++ b/views/default/navigation/menu/site.php @@ -0,0 +1,30 @@ +<?php +/** + * Site navigation menu + * + * @uses $vars['menu']['default'] + * @uses $vars['menu']['more'] + */ + +$default_items = elgg_extract('default', $vars['menu'], array()); +$more_items = elgg_extract('more', $vars['menu'], array()); + +echo '<ul class="elgg-menu elgg-menu-site elgg-menu-site-default clearfix">'; +foreach ($default_items as $menu_item) { + echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item)); +} + +if ($more_items) { + echo '<li class="elgg-more">'; + + $more = elgg_echo('more'); + echo "<a href=\"#\">$more</a>"; + + echo elgg_view('navigation/menu/elements/section', array( + 'class' => 'elgg-menu elgg-menu-site elgg-menu-site-more', + 'items' => $more_items, + )); + + echo '</li>'; +} +echo '</ul>'; diff --git a/views/default/navigation/menu/user_hover.php b/views/default/navigation/menu/user_hover.php new file mode 100644 index 000000000..5c89e585c --- /dev/null +++ b/views/default/navigation/menu/user_hover.php @@ -0,0 +1,60 @@ +<?php +/** + * User hover menu + * + * Register for the 'register', 'menu:user_hover' plugin hook to add to the user + * hover menu. There are three sections: action, default, and admin. + * + * @uses $vars['menu'] Menu array provided by elgg_view_menu() + */ + +$user = $vars['entity']; +$actions = elgg_extract('action', $vars['menu'], null); +$main = elgg_extract('default', $vars['menu'], null); +$admin = elgg_extract('admin', $vars['menu'], null); + +echo '<ul class="elgg-menu elgg-menu-hover">'; + +// name and username +$name_link = elgg_view('output/url', array( + 'href' => $user->getURL(), + 'text' => "<span class=\"elgg-heading-basic\">$user->name</span>@$user->username", + 'is_trusted' => true, +)); +echo "<li>$name_link</li>"; + +// actions +if (elgg_is_logged_in() && $actions) { + echo '<li>'; + echo elgg_view('navigation/menu/elements/section', array( + 'class' => "elgg-menu elgg-menu-hover-actions", + 'items' => $actions, + )); + echo '</li>'; +} + +// main +if ($main) { + echo '<li>'; + + echo elgg_view('navigation/menu/elements/section', array( + 'class' => 'elgg-menu elgg-menu-hover-default', + 'items' => $main, + )); + + echo '</li>'; +} + +// admin +if (elgg_is_admin_logged_in() && $admin) { + echo '<li>'; + + echo elgg_view('navigation/menu/elements/section', array( + 'class' => 'elgg-menu elgg-menu-hover-admin', + 'items' => $admin, + )); + + echo '</li>'; +} + +echo '</ul>'; diff --git a/views/default/navigation/pagination.php b/views/default/navigation/pagination.php index fc15470bc..04044c51c 100644 --- a/views/default/navigation/pagination.php +++ b/views/default/navigation/pagination.php @@ -5,106 +5,128 @@ * @package Elgg * @subpackage Core * - * @uses int $vars['offset'] - * @uses int $vars['limit'] - * @uses int $vars['count'] Number of entities. - * @uses string $vars['word'] Word to use in GET params for the offset - * @uses string $vars['baseurl'] Base URL to use in links + * @uses int $vars['offset'] The offset in the list + * @uses int $vars['limit'] Number of items per page + * @uses int $vars['count'] Number of items in list + * @uses string $vars['base_url'] Base URL to use in links + * @uses string $vars['offset_key'] The string to use for offet in the URL */ -$offset = (int) elgg_get_array_value('offset', $vars, 0); +if (elgg_in_context('widget')) { + // widgets do not show pagination + return true; +} + +$offset = abs((int) elgg_extract('offset', $vars, 0)); // because you can say $vars['limit'] = 0 -if (!$limit = (int) elgg_get_array_value('limit', $vars, 10)) { +if (!$limit = (int) elgg_extract('limit', $vars, 10)) { $limit = 10; } -$count = (int) elgg_get_array_value('count', $vars, 0); -$word = elgg_get_array_value('word', $vars, 'offset'); -$baseurl = elgg_get_array_value('baseurl', $vars, current_page_url()); -$totalpages = ceil($count / $limit); -$currentpage = ceil($offset / $limit) + 1; +$count = (int) elgg_extract('count', $vars, 0); +$offset_key = elgg_extract('offset_key', $vars, 'offset'); +// some views pass an empty string for base_url +if (isset($vars['base_url']) && $vars['base_url']) { + $base_url = $vars['base_url']; +} else if (isset($vars['baseurl']) && $vars['baseurl']) { + elgg_deprecated_notice("Use 'base_url' instead of 'baseurl' for the navigation/pagination view", 1.8); + $base_url = $vars['baseurl']; +} else { + $base_url = current_page_url(); +} + +$num_pages = elgg_extract('num_pages', $vars, 10); +$delta = ceil($num_pages / 2); + +if ($count <= $limit && $offset == 0) { + // no need for pagination + return true; +} + +$total_pages = ceil($count / $limit); +$current_page = ceil($offset / $limit) + 1; + +$pages = new stdClass(); +$pages->prev = array( + 'text' => '« ' . elgg_echo('previous'), + 'href' => '', + 'is_trusted' => true, +); +$pages->next = array( + 'text' => elgg_echo('next') . ' »', + 'href' => '', + 'is_trusted' => true, +); +$pages->items = array(); + +// Add pages before the current page +if ($current_page > 1) { + $prev_offset = $offset - $limit; + if ($prev_offset < 0) { + $prev_offset = 0; + } -//only display if there is content to paginate through or if we already have an offset -if (($count > $limit || $offset > 0) && elgg_get_context() != 'widget') { + $pages->prev['href'] = elgg_http_add_url_query_elements($base_url, array($offset_key => $prev_offset)); - ?> + $first_page = $current_page - $delta; + if ($first_page < 1) { + $first_page = 1; + } - <div class="pagination clearfix"> - <?php + $pages->items = range($first_page, $current_page - 1); +} - if ($offset > 0) { - $prevoffset = $offset - $limit; - if ($prevoffset < 0) { - $prevoffset = 0; - } +$pages->items[] = $current_page; - $prevurl = elgg_http_add_url_query_elements($baseurl, array($word => $prevoffset)); - echo "<a href=\"{$prevurl}\" class='pagination-previous'>« ". elgg_echo("previous") ."</a> "; +// add pages after the current one +if ($current_page < $total_pages) { + $next_offset = $offset + $limit; + if ($next_offset >= $count) { + $next_offset--; } - if ($offset > 0 || $offset < ($count - $limit)) { - - $currentpage = round($offset / $limit) + 1; - $allpages = ceil($count / $limit); - - $i = 1; - $pagesarray = array(); - while ($i <= $allpages && $i <= 4) { - $pagesarray[] = $i; - $i++; - } - $i = $currentpage - 2; - while ($i <= $allpages && $i <= ($currentpage + 2)) { - if ($i > 0 && !in_array($i,$pagesarray)) { - $pagesarray[] = $i; - } - $i++; - } - $i = $allpages - 3; - while ($i <= $allpages) { - if ($i > 0 && !in_array($i,$pagesarray)) { - $pagesarray[] = $i; - } - $i++; - } - - sort($pagesarray); - - $prev = 0; - foreach($pagesarray as $i) { - if (($i - $prev) > 1) { - echo "<span class='pagination-more'>...</span>"; - } - - $curoffset = (($i - 1) * $limit); - $counturl = elgg_http_add_url_query_elements($baseurl, array($word => $curoffset)); - - if ($curoffset != $offset) { - echo " <a href=\"{$counturl}\" class='pagination-number'>{$i}</a> "; - } else { - echo "<span class='pagination-currentpage'>{$i}</span>"; - } - $prev = $i; - - } + $pages->next['href'] = elgg_http_add_url_query_elements($base_url, array($offset_key => $next_offset)); + + $last_page = $current_page + $delta; + if ($last_page > $total_pages) { + $last_page = $total_pages; } - if ($offset < ($count - $limit)) { + $pages->items = array_merge($pages->items, range($current_page + 1, $last_page)); +} - $nextoffset = $offset + $limit; - if ($nextoffset >= $count) { - $nextoffset--; - } - $nexturl = elgg_http_add_url_query_elements($baseurl, array($word => $nextoffset)); +echo '<ul class="elgg-pagination">'; - echo " <a href=\"{$nexturl}\" class='pagination-next'>" . elgg_echo("next") . " »</a>"; +if ($pages->prev['href']) { + $link = elgg_view('output/url', $pages->prev); + echo "<li>$link</li>"; +} else { + echo "<li class=\"elgg-state-disabled\"><span>{$pages->prev['text']}</span></li>"; +} +foreach ($pages->items as $page) { + if ($page == $current_page) { + echo "<li class=\"elgg-state-selected\"><span>$page</span></li>"; + } else { + $page_offset = (($page - 1) * $limit); + $url = elgg_http_add_url_query_elements($base_url, array($offset_key => $page_offset)); + $link = elgg_view('output/url', array( + 'href' => $url, + 'text' => $page, + 'is_trusted' => true, + )); + echo "<li>$link</li>"; } +} + +if ($pages->next['href']) { + $link = elgg_view('output/url', $pages->next); + echo "<li>$link</li>"; +} else { + echo "<li class=\"elgg-state-disabled\"><span>{$pages->next['text']}</span></li>"; +} - ?> - </div> - <?php -} // end of pagination check if statement +echo '</ul>'; diff --git a/views/default/navigation/sidebar_menu.php b/views/default/navigation/sidebar_menu.php deleted file mode 100644 index 75fe7c743..000000000 --- a/views/default/navigation/sidebar_menu.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg sidebar menu - * - * @package Elgg - * @subpackage Core - * - */ - -// Plugins can add to the sidebar menu by calling elgg_add_submenu_item() -$submenu = elgg_get_submenu(); - -echo $submenu; diff --git a/views/default/navigation/site_nav.php b/views/default/navigation/site_nav.php deleted file mode 100644 index 84ac75569..000000000 --- a/views/default/navigation/site_nav.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php -/** - * Main site-wide navigation - * - **/ - -$nav_items = elgg_get_nav_items(); -$featured = $nav_items['featured']; -$more = $nav_items['more']; - -$nav_html = ''; -$more_nav_html = ''; -$context = elgg_get_context(); - -// sort more links alphabetically -$more_sorted = array(); -foreach ($more as $info) { - $more_sorted[] = $info->name; -} - -// required because array multisort is case sensitive -$more_sorted_lower = array_map('elgg_strtolower', $more_sorted); -array_multisort($more_sorted_lower, $more); - -$item_count = 0; - -// if there are no featured items, display the standard tools in alphabetical order -if ($featured) { - foreach ($featured as $info) { - $selected = ($info->value->context == $context) ? 'class="selected"' : ''; - $title = htmlentities($info->name, ENT_QUOTES, 'UTF-8'); - $url = htmlentities($info->value->url, ENT_QUOTES, 'UTF-8'); - - $nav_html .= "<li $selected><a href=\"$url\" title=\"$title\"><span>$title</span></a></li>"; - } -} elseif ($more) { - for ($i=0; $i<6; $i++) { - if (!array_key_exists($i, $more)) { - break; - } - $info = $more[$i]; - - $selected = ($info->value->context == $context) ? 'class="selected"' : ''; - $title = htmlentities($info->name, ENT_QUOTES, 'UTF-8'); - $url = htmlentities($info->value->url, ENT_QUOTES, 'UTF-8'); - - $nav_html .= "<li $selected><a href=\"$url\" title=\"$title\"><span>$title</span></a></li>"; - $more[$i]->used = TRUE; - $item_count++; - } -} - -// display the rest. -foreach ($more as $info) { - if ($info->used) { - continue; - } - $selected = ($info->value->context == $context) ? 'class="selected"' : ''; - $title = htmlentities($info->name, ENT_QUOTES, 'UTF-8'); - $url = htmlentities($info->value->url, ENT_QUOTES, 'UTF-8'); - - $more_nav_html .= "<li $selected><a href=\"$url\" title=\"$title\"><span>$title</span></a></li>\n"; - $item_count++; -} - -if ($more_nav_html) { - $more = elgg_echo('more'); - $nav_html .= "<li class='navigation-more'><a class='subnav' title=\"$more\"><span>$more</span></a> - <ul> - $more_nav_html - </ul> - </li>"; -} - -// only display, if there are nav items to display -if ($nav_html) { - echo <<<___END - <div id="elgg-main-nav" class="clearfix"> - <ul class="navigation"> - $nav_html - </ul> - </div> -___END; -} -?> diff --git a/views/default/navigation/submenu_group.php b/views/default/navigation/submenu_group.php deleted file mode 100644 index df750aff7..000000000 --- a/views/default/navigation/submenu_group.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * Elgg submenu group. Writes the <ul> for a submenu and passes items one by one - * to navigation/submenu_item - * - * @uses $vars['group_name'] - * @uses $vars['items'] - * @package Elgg - * @subpackage Core - */ - -$group = (isset($vars['group'])) ? $vars['group'] : 'default'; -$items = (isset($vars['items'])) ? $vars['items'] : array(); -$hidden = (isset($vars['hidden']) && $vars['hidden']) ? 'hidden' : ''; -$child = (isset($vars['child']) && $vars['child']) ? 'child' : ''; - -echo "<ul class='submenu $group $hidden $child'>\n"; - -foreach ($items as $item) { - $item_vars = array('item' => $item, 'group' => $group); - if (isset($item->vars) && is_array($item->vars)) { - $item_vars = array_merge($item->vars, $item_vars); - } - - if (isset($item->children)) { - $child_vars = array( - 'group' => $group, - 'items' => $item->children, - // if this menu item is selected, make sure to display the full tree - // ie, don't hide it. - 'hidden' => !$item->selected, - 'child' => TRUE - ); - $item_vars['children_html'] = elgg_view('navigation/submenu_group', $child_vars); - } - - echo elgg_view('navigation/submenu_item', $item_vars); -} - -echo "</ul>\n";
\ No newline at end of file diff --git a/views/default/navigation/submenu_item.php b/views/default/navigation/submenu_item.php deleted file mode 100644 index 09aa24a8e..000000000 --- a/views/default/navigation/submenu_item.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Elgg submenu item. Displays the <li> part of a submenu. - * - * @uses $vars['group'] - * @uses $vars['item'] - * @uses $vars['children_html'] - * @package Elgg - * @subpackage Core - */ - -$group = (isset($vars['group'])) ? $vars['group'] : 'default'; -$item = (isset($vars['item'])) ? $vars['item'] : FALSE; -$children_html = (isset($vars['children_html'])) ? $vars['children_html'] : ''; - -if ($item) { - $has_children = (isset($item->children) && $item->children) ? TRUE : FALSE; - $selected = (isset($item->selected) && $item->selected == TRUE) ? 'class="selected"' : ''; - $js = (isset($vars['js'])) ? $vars['js'] : ''; - - $child_indicator = ''; - if ($has_children) { - if ($selected) { - $child_indicator = '<span class="close_child">-</span>'; - $child_indicator .= '<span class="hidden open_child">+</span>'; - } else { - $child_indicator = '<span class="hidden close_child">-</span>'; - $child_indicator .= '<span class="open_child">+</span>'; - } - - $child_indicator = "<span class=\"child_indicator\">$child_indicator </span>"; - } - - $url = htmlentities($item->href); - $text = $child_indicator . htmlentities($item->text); - - $link_vars = array_merge($vars, array( - 'href' => $item->href, - 'text' => $text, - 'encode_text' => FALSE - )); - - $link = elgg_view('output/url', $link_vars); -} - -echo "<li $selected>$link$children_html</li>"; diff --git a/views/default/navigation/submenu_js.php b/views/default/navigation/submenu_js.php deleted file mode 100644 index 1ed710b2b..000000000 --- a/views/default/navigation/submenu_js.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php -/** - * Javascript to expand submenu items. - * - * @package Elgg - * @subpackage Core - */ -?> - -<script type="text/javascript"> -$(document).ready(function() { - $('.submenu span.child_indicator').click(function() { - var submenu = $(this).parent().parent().find('ul.submenu.child:first'); - var closeChild = $($(this).find('.close_child')); - var openChild = $($(this).find('.open_child')); - - if (submenu.is(':visible')) { - closeChild.addClass('hidden'); - openChild.removeClass('hidden'); - } else { - closeChild.removeClass('hidden'); - openChild.addClass('hidden'); - } - - submenu.slideToggle(); - return false; - }); -}); -</script>
\ No newline at end of file diff --git a/views/default/navigation/tabs.php b/views/default/navigation/tabs.php index 9d634a35a..95e3f2669 100644 --- a/views/default/navigation/tabs.php +++ b/views/default/navigation/tabs.php @@ -2,59 +2,80 @@ /** * Tab navigation * - * @uses string $vars['type'] horizontal || vertical - Defaults to horizontal (vertical TBI) + * @uses string $vars['type'] horizontal || vertical - Defaults to horizontal + * @uses string $vars['class'] Additional class to add to ul * @uses array $vars['tabs'] A multi-dimensional array of tab entries in the format array( - * 'title' => string, // Title of link - * 'url' => string, // URL for the link - * 'url_js' => string, // JS to pass to the link - * 'url_class' => string, // Class to pass to the link - * 'class' => string // Class of the li element. - * 'selected' => bool // if this link is currently selected + * 'text' => string, // The string between the <a></a> tags + * 'href' => string, // URL for the link + * 'class' => string // Class of the li element + * 'id' => string, // ID of the li element + * 'selected' => bool // if this tab is currently selected (applied to li element) + * 'link_class' => string, // Class to pass to the link + * 'link_id' => string, // ID to pass to the link * ) */ +$options = elgg_clean_vars($vars); + +$type = elgg_extract('type', $vars, 'horizontal'); -$type = elgg_get_array_value('type', $vars, 'horizontal'); if ($type == 'horizontal') { - $type_class = "elgg-horizontal-tabbed-nav mtm"; + $options['class'] = "elgg-tabs elgg-htabs"; } else { - $type_class = "elgg_vertical_tabbed_nav"; + $options['class'] = "elgg-tabs elgg-vtabs"; +} +if (isset($vars['class'])) { + $options['class'] = "{$options['class']} {$vars['class']}"; } +unset($options['tabs']); +unset($options['type']); + +$attributes = elgg_format_attributes($options); + if (isset($vars['tabs']) && is_array($vars['tabs']) && !empty($vars['tabs'])) { -?> - <ul class="<?php echo $type_class; ?>"> - <?php - foreach ($vars['tabs'] as $info) { - $class = elgg_get_array_value('class', $info, ''); - - $selected = elgg_get_array_value('selected', $info, FALSE); - if ($selected) { - $class .= ' selected'; - } + ?> + <ul <?php echo $attributes; ?>> + <?php + foreach ($vars['tabs'] as $info) { + $class = elgg_extract('class', $info, ''); + $id = elgg_extract('id', $info, ''); - $class_str = ($class) ? "class=\"$class\"" : ''; - $title = htmlentities($info['title'], ENT_QUOTES, 'UTF-8'); - $url = htmlentities($info['url'], ENT_QUOTES, 'UTF-8'); + $selected = elgg_extract('selected', $info, FALSE); + if ($selected) { + $class .= ' elgg-state-selected'; + } - $options = array( - 'href' => $url, - 'title' => $title, - 'text' => $title - ); + $class_str = ($class) ? "class=\"$class\"" : ''; + $id_str = ($id) ? "id=\"$id\"" : ''; - if (isset($info['url_js'])) { - $options['js'] = $info['url_js']; - } + $options = $info; + unset($options['class']); + unset($options['id']); + unset($options['selected']); - if (isset($info['url_class'])) { - $options['class'] = $info['url_class']; - } + if (!isset($info['href']) && isset($info['url'])) { + $options['href'] = $info['url']; + unset($options['url']); + } + if (!isset($info['text']) && isset($info['title'])) { + $options['text'] = $options['title']; + unset($options['title']); + } + if (isset($info['link_class'])) { + $options['class'] = $options['link_class']; + unset($options['link_class']); + } - $link = elgg_view('output/url', $options); + if (isset($info['link_id'])) { + $options['id'] = $options['link_id']; + unset($options['link_id']); + } - echo "<li $class_str $js>$link</li>"; - } - ?> - </ul> + $link = elgg_view('output/url', $options); + + echo "<li $id_str $class_str>$link</li>"; + } + ?> + </ul> <?php } diff --git a/views/default/navigation/topbar_tools.php b/views/default/navigation/topbar_tools.php index 44cf4a63d..307f03fc6 100644 --- a/views/default/navigation/topbar_tools.php +++ b/views/default/navigation/topbar_tools.php @@ -4,5 +4,6 @@ * * @package Elgg * @subpackage Core - * + * + * @deprecated 1.8 Extend the topbar menus or the page/elements/topbar view directly */ diff --git a/views/default/navigation/viewtype.php b/views/default/navigation/viewtype.php index cdf167eb5..6dfa4ebc7 100644 --- a/views/default/navigation/viewtype.php +++ b/views/default/navigation/viewtype.php @@ -4,8 +4,8 @@ * * @package Elgg * @subpackage Core + * + * @deprecated 1.8 See how file plugin adds a toggle in function file_register_toggle() */ -elgg_deprecated_notice('navigation/viewtype was deprecated by navigation/listtype', 1.8); - -echo elgg_view('navigation/listtype', $vars);
\ No newline at end of file +elgg_deprecated_notice('navigation/viewtype was deprecated', 1.8); diff --git a/views/default/notifications/settings/usersettings.php b/views/default/notifications/settings/usersettings.php deleted file mode 100644 index afb142ebe..000000000 --- a/views/default/notifications/settings/usersettings.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * User settings for notifications. - * - * @package Elgg - * @subpackage Core - */ - -global $NOTIFICATION_HANDLERS; -$notification_settings = get_user_notification_settings(elgg_get_page_owner_guid()); - -?> -<div class="user-settings notifications"> -<h3><?php echo elgg_echo('notifications:usersettings'); ?></h3> - -<p><?php echo elgg_echo('notifications:methods'); ?> - -<table> -<?php - // Loop through options - foreach ($NOTIFICATION_HANDLERS as $k => $v) { -?> - <tr> - <td><?php echo elgg_echo($k); ?>: </td> - - <td> -<?php - - if ($notification_settings->$k) { - $val = "yes"; - } else { - $val = "no"; - } - - echo elgg_view('input/radio', array( - 'internalname' => "method[$k]", - 'value' => $val, - 'options' => array( - elgg_echo('option:yes') => 'yes', - elgg_echo('option:no') => 'no' - ), - )); - -?> - </td> - </tr> -<?php - } -?> -</table> -</div>
\ No newline at end of file diff --git a/views/default/object/admin_notice.php b/views/default/object/admin_notice.php index 1a162ce4d..11524567e 100644 --- a/views/default/object/admin_notice.php +++ b/views/default/object/admin_notice.php @@ -6,6 +6,15 @@ if (isset($vars['entity']) && elgg_instanceof($vars['entity'], 'object', 'admin_notice')) { $notice = $vars['entity']; $message = $notice->description; - echo "<p>$message</p>"; + + $delete = elgg_view('output/url', array( + 'href' => "action/admin/delete_admin_notice?guid=$notice->guid", + 'text' => '<span class="elgg-icon elgg-icon-delete"></span>', + 'is_action' => true, + 'class' => 'elgg-admin-notice', + 'is_trusted' => true, + )); + + echo "<p>$delete$message</p>"; } diff --git a/views/default/object/default.php b/views/default/object/default.php index 6e03e9e78..70e098742 100644 --- a/views/default/object/default.php +++ b/views/default/object/default.php @@ -1,61 +1,48 @@ <?php /** - * ElggEntity default view. + * ElggObject default view. + * + * @warning This view may be used for other ElggEntity objects * * @package Elgg * @subpackage Core */ -if ($vars['full']) { - echo elgg_view('export/entity', $vars); -} else { - - $icon = elgg_view( - 'graphics/icon', array( - 'entity' => $vars['entity'], - 'size' => 'small', - ) - ); - - - $title = $vars['entity']->title; - if (!$title) { - $title = $vars['entity']->name; - } - if (!$title) { - $title = get_class($vars['entity']); - } - - $controls = ""; - if ($vars['entity']->canEdit()) { - $delete = elgg_view('output/confirm_link', array( - 'href' => "action/entities/delete?guid={$vars['entity']->guid}", - 'text' => elgg_echo('delete') - )); - $controls .= " ($delete)"; - } - - $info = "<div><p><b><a href=\"" . $vars['entity']->getUrl() . "\">" . $title . "</a></b> $controls </p></div>"; - - if (get_input('listtype') == "gallery") { - $icon = ""; - } - - $owner = $vars['entity']->getOwnerEntity(); - $ownertxt = elgg_echo('unknown'); - if ($owner) { - $ownertxt = "<a href=\"" . $owner->getURL() . "\">" . $owner->name . "</a>"; - } - - $info .= "<div>" . elgg_echo("entity:default:strapline", array( - elgg_view_friendly_time($vars['entity']->time_created), - $ownertxt - )); +$icon = elgg_view_entity_icon($vars['entity'], 'small'); - $info .= "</div>"; +$title = $vars['entity']->title; +if (!$title) { + $title = $vars['entity']->name; +} +if (!$title) { + $title = get_class($vars['entity']); +} - $info = "<span title=\"" . elgg_echo('entity:default:missingsupport:popup') . "\">$info</span>"; - $icon = "<span title=\"" . elgg_echo('entity:default:missingsupport:popup') . "\">$icon</span>"; +if (elgg_instanceof($vars['entity'], 'object')) { + $metadata = elgg_view('navigation/menu/metadata', $vars); +} - echo elgg_view_listing($icon, $info); +$owner_link = ''; +$owner = $vars['entity']->getOwnerEntity(); +if ($owner) { + $owner_link = elgg_view('output/url', array( + 'href' => $owner->getURL(), + 'text' => $owner->name, + 'is_trusted' => true, + )); } + +$date = elgg_view_friendly_time($vars['entity']->time_created); + +$subtitle = "$owner_link $date"; + +$params = array( + 'entity' => $vars['entity'], + 'title' => $title, + 'metadata' => $metadata, + 'subtitle' => $subtitle, +); +$params = $params + $vars; +$body = elgg_view('object/elements/summary', $params); + +echo elgg_view_image_block($icon, $body, $vars); diff --git a/views/default/object/elements/full.php b/views/default/object/elements/full.php new file mode 100644 index 000000000..b4634fe7e --- /dev/null +++ b/views/default/object/elements/full.php @@ -0,0 +1,37 @@ +<?php +/** + * Object full rendering + * + * Sample output: + * <div class="elgg-content"> + * <div class="elgg-image-block"> + * </div> + * <div class="elgg-output"> + * </div> + * </div> + * + * @uses $vars['entity'] ElggEntity + * @uses $vars['icon'] HTML for the content icon + * @uses $vars['summary'] HTML for the content summary + * @uses $vars['body'] HTML for the content body + * @uses $vars['class'] Optional additional class for the content wrapper + */ + +$icon = elgg_extract('icon', $vars); +$summary = elgg_extract('summary', $vars); +$body = elgg_extract('body', $vars); +$class = elgg_extract('class', $vars); +if ($class) { + $class = "elgg-content clearfix $class"; +} else { + $class = "elgg-content clearfix"; +} + +$header = elgg_view_image_block($icon, $summary); + +echo <<<HTML +<div class="$class"> +$header +$body +</div> +HTML; diff --git a/views/default/object/elements/summary.php b/views/default/object/elements/summary.php new file mode 100644 index 000000000..63ab8f816 --- /dev/null +++ b/views/default/object/elements/summary.php @@ -0,0 +1,59 @@ +<?php +/** + * Object summary + * + * Sample output + * <ul class="elgg-menu elgg-menu-entity"><li>Public</li><li>Like this</li></ul> + * <h3><a href="">Title</a></h3> + * <p class="elgg-subtext">Posted 3 hours ago by George</p> + * <p class="elgg-tags"><a href="">one</a>, <a href="">two</a></p> + * <div class="elgg-content">Excerpt text</div> + * + * @uses $vars['entity'] ElggEntity + * @uses $vars['title'] Title link (optional) false = no title, '' = default + * @uses $vars['metadata'] HTML for entity menu and metadata (optional) + * @uses $vars['subtitle'] HTML for the subtitle (optional) + * @uses $vars['tags'] HTML for the tags (default is tags on entity, pass false for no tags) + * @uses $vars['content'] HTML for the entity content (optional) + */ + +$entity = $vars['entity']; + +$title_link = elgg_extract('title', $vars, ''); +if ($title_link === '') { + if (isset($entity->title)) { + $text = $entity->title; + } else { + $text = $entity->name; + } + $params = array( + 'text' => elgg_get_excerpt($text, 100), + 'href' => $entity->getURL(), + 'is_trusted' => true, + ); + $title_link = elgg_view('output/url', $params); +} + +$metadata = elgg_extract('metadata', $vars, ''); +$subtitle = elgg_extract('subtitle', $vars, ''); +$content = elgg_extract('content', $vars, ''); + +$tags = elgg_extract('tags', $vars, ''); +if ($tags === '') { + $tags = elgg_view('output/tags', array('tags' => $entity->tags)); +} + +if ($metadata) { + echo $metadata; +} +if ($title_link) { + echo "<h3>$title_link</h3>"; +} +echo "<div class=\"elgg-subtext\">$subtitle</div>"; +echo $tags; + +echo elgg_view('object/summary/extend', $vars); + +if ($content) { + echo "<div class=\"elgg-content\">$content</div>"; +} diff --git a/views/default/object/object.php b/views/default/object/object.php deleted file mode 100644 index 9e1441a9f..000000000 --- a/views/default/object/object.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Elgg default object view. - * This is a placeholder. - * - * @package Elgg - * @subpackage Core - */ - -$entity = $vars['entity']; - -?> -<div> - <p><?php echo $entity->title; ?></p> - <p><?php echo $entity->description; ?></p> -</div>
\ No newline at end of file diff --git a/views/default/object/plugin.php b/views/default/object/plugin.php index aef9a9bbd..5c7138e96 100644 --- a/views/default/object/plugin.php +++ b/views/default/object/plugin.php @@ -1,19 +1,20 @@ <?php /** - * Elgg plugin + * Used to show plugin user settings. + * + * @package Elgg.Core + * @subpackage Plugins * - * @package Elgg - * @subpackage Core */ -$entity = $vars['entity']; -$plugin = $vars['plugin']; -$prefix = $vars['prefix']; // Do we want to show admin settings (default) or user settings +if (!elgg_in_context('admin')) { + forward('/', 403); +} -$form_body = elgg_view("{$prefix}settings/{$plugin}/edit", $vars); -$form_body .= "<p>" . elgg_view('input/hidden', array('internalname' => 'plugin', 'value' => $plugin)) . elgg_view('input/submit', array('value' => elgg_echo('save'))) . "</p>"; +$plugin = $vars['entity']; -?> -<div> - <?php echo elgg_view('input/form', array('body' => $form_body, 'action' => "action/plugins/{$prefix}settings/save")); ?> -</div>
\ No newline at end of file +if (!$plugin->isValid()) { + echo elgg_view('object/plugin/invalid', $vars); +} else { + echo elgg_view('object/plugin/full', $vars); +} diff --git a/views/default/object/plugin/elements/dependencies.php b/views/default/object/plugin/elements/dependencies.php new file mode 100644 index 000000000..d8daedd33 --- /dev/null +++ b/views/default/object/plugin/elements/dependencies.php @@ -0,0 +1,49 @@ +<?php +/** + * Shows a table of plugin dependecies for ElggPlugin in $vars['plugin']. + * + * This uses a table because it's a table of data. + * + * @package Elgg.Core + * @subpackage Admin.Plugins + */ + +$plugin = elgg_extract('plugin', $vars, false); +$deps = $plugin->getPackage()->checkDependencies(true); + +$columns = array('type', 'name', 'expected_value', 'local_value', 'comment'); + +echo '<table class="elgg-plugin-dependencies styled"><tr>'; + +foreach ($columns as $column) { + $column = elgg_echo("admin:plugins:dependencies:$column"); + echo "<th class=\"pas\">$column</th>"; +} + +echo '</tr>'; + +$row = 'odd'; +foreach ($deps as $dep) { + $fields = elgg_get_plugin_dependency_strings($dep); + $type = $dep['type']; + + if ($dep['status']) { + $class = "elgg-state-success elgg-dependency elgg-dependency-$type"; + } elseif ($dep['type'] == 'suggests') { + $class = "elgg-state-warning elgg-dependency elgg-dependency-$type"; + } else { + $class = "elgg-state-error elgg-dependency elgg-dependency-$type"; + } + + echo "<tr class=\"$row\">"; + + foreach ($columns as $column) { + echo "<td class=\"pas $class\">{$fields[$column]}</td>"; + } + + echo '</tr>'; + + $row = ($row == 'odd') ? 'even' : 'odd'; +} + +echo '</table>';
\ No newline at end of file diff --git a/views/default/object/plugin/full.php b/views/default/object/plugin/full.php new file mode 100644 index 000000000..2de65b555 --- /dev/null +++ b/views/default/object/plugin/full.php @@ -0,0 +1,308 @@ +<?php +/** + * Displays a plugin on the admin screen. + * + * This file renders a plugin for the admin screen, including active/deactive, + * manifest details & display plugin settings. + * + * @uses $vars['entity'] + * @uses $vars['display_reordering'] Do we display the priority reordering links? + * + * @package Elgg.Core + * @subpackage Plugins + */ + +$plugin = $vars['entity']; +$reordering = elgg_extract('display_reordering', $vars, false); +$priority = $plugin->getPriority(); +$active = $plugin->isActive(); + +$can_activate = $plugin->canActivate(); +$max_priority = elgg_get_max_plugin_priority(); +$actions_base = '/action/admin/plugins/'; +$css_id = preg_replace('/[^a-z0-9-]/i', '-', $plugin->getID()); + +// build reordering links +$links = ''; +$classes = array('elgg-plugin'); + +if ($reordering) { + $classes[] = 'elgg-state-draggable'; + + // top and up link only if not at top + if ($priority > 1) { + $top_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => 'first', + 'is_action' => true + )); + + $links .= "<li>" . elgg_view('output/url', array( + 'href' => $top_url, + 'text' => elgg_echo('top'), + 'is_action' => true, + 'is_trusted' => true, + )) . "</li>"; + + $up_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => '-1', + 'is_action' => true + )); + + $links .= "<li>" . elgg_view('output/url', array( + 'href' => $up_url, + 'text' => elgg_echo('up'), + 'is_action' => true, + 'is_trusted' => true, + )) . "</li>"; + } + + // down and bottom links only if not at bottom + if ($priority < $max_priority) { + $down_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => '+1', + 'is_action' => true + )); + + $links .= "<li>" . elgg_view('output/url', array( + 'href' => $down_url, + 'text' => elgg_echo('down'), + 'is_action' => true, + 'is_trusted' => true, + )) . "</li>"; + + $bottom_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( + 'plugin_guid' => $plugin->guid, + 'priority' => 'last', + 'is_action' => true + )); + + $links .= "<li>" . elgg_view('output/url', array( + 'href' => $bottom_url, + 'text' => elgg_echo('bottom'), + 'is_action' => true, + 'is_trusted' => true, + )) . "</li>"; + } +} else { + $classes[] = 'elgg-state-undraggable'; +} + + +// activate / deactivate links + +// always let them deactivate +$options = array( + 'is_action' => true, + 'is_trusted' => true, +); +if ($active) { + $classes[] = 'elgg-state-active'; + $action = 'deactivate'; + $options['text'] = elgg_echo('admin:plugins:deactivate'); + $options['class'] = "elgg-button elgg-button-cancel"; + + if (!$can_activate) { + $classes[] = 'elgg-state-active'; + $options['class'] = 'elgg-button elgg-state-warning'; + } +} else if ($can_activate) { + $classes[] = 'elgg-state-inactive'; + $action = 'activate'; + $options['text'] = elgg_echo('admin:plugins:activate'); + $options['class'] = "elgg-button elgg-button-submit"; +} else { + $classes[] = 'elgg-state-inactive'; + $action = ''; + $options['text'] = elgg_echo('admin:plugins:cannot_activate'); + $options['class'] = "elgg-button elgg-button-disabled"; + $options['disabled'] = 'disabled'; +} + +if ($action) { + $url = elgg_http_add_url_query_elements($actions_base . $action, array( + 'plugin_guids[]' => $plugin->guid + )); + + $options['href'] = $url; +} +$action_button = elgg_view('output/url', $options); + +// Display categories and make category classes +$categories = $plugin->getManifest()->getCategories(); +$categories_html = ''; +if ($categories) { + $base_url = elgg_get_site_url() . "admin/plugins?category="; + + foreach ($categories as $category) { + $css_class = preg_replace('/[^a-z0-9-]/i', '-', $category); + $classes[] = "elgg-plugin-category-$css_class"; + + $url = $base_url . urlencode($category); + $friendly_category = htmlspecialchars(ElggPluginManifest::getFriendlyCategory($category)); + $categories_html .= "<li class=\"elgg-plugin-category prm\"><a href=\"$url\">$friendly_category</a></li>"; + } +} + +$screenshots_html = ''; +$screenshots = $plugin->getManifest()->getScreenshots(); +if ($screenshots) { + $base_url = elgg_get_plugins_path() . $plugin->getID() . '/'; + foreach ($screenshots as $screenshot) { + $desc = elgg_echo($screenshot['description']); + $alt = htmlentities($desc, ENT_QUOTES, 'UTF-8'); + $screenshot_full = "{$vars['url']}admin_plugin_screenshot/{$plugin->getID()}/full/{$screenshot['path']}"; + $screenshot_src = "{$vars['url']}admin_plugin_screenshot/{$plugin->getID()}/thumbnail/{$screenshot['path']}"; + + $screenshots_html .= "<li class=\"elgg-plugin-screenshot prm ptm\"><a class=\"elgg-lightbox\" href=\"$screenshot_full\">" + . "<img src=\"$screenshot_src\" alt=\"$alt\"></a></li>"; + } +} + +// metadata +$description = elgg_view('output/longtext', array('value' => $plugin->getManifest()->getDescription())); +$author = '<span>' . elgg_echo('admin:plugins:label:author') . '</span>: ' + . elgg_view('output/text', array('value' => $plugin->getManifest()->getAuthor())); +$version = htmlspecialchars($plugin->getManifest()->getVersion()); +$website = elgg_view('output/url', array( + 'href' => $plugin->getManifest()->getWebsite(), + 'text' => $plugin->getManifest()->getWebsite(), + 'is_trusted' => true, +)); + +$resources = array( + 'repository' => $plugin->getManifest()->getRepositoryURL(), + 'bugtracker' => $plugin->getManifest()->getBugTrackerURL(), + 'donate' => $plugin->getManifest()->getDonationsPageURL(), +); + +$resources_html = "<ul class=\"elgg-plugin-resources\">"; +foreach ($resources as $id => $href) { + if ($href) { + $resources_html .= "<li class=\"prm\">"; + $resources_html .= elgg_view('output/url', array( + 'href' => $href, + 'text' => elgg_echo("admin:plugins:label:$id"), + 'is_trusted' => true, + )); + $resources_html .= "</li>"; + } +} +$resources_html .= "</ul>"; + +$copyright = elgg_view('output/text', array('value' => $plugin->getManifest()->getCopyright())); +$license = elgg_view('output/text', array('value' => $plugin->getManifest()->getLicense())); + +// show links to text files +$files = $plugin->getAvailableTextFiles(); + +$docs = ''; +if ($files) { + $docs = '<ul>'; + foreach ($files as $file => $path) { + $url = 'admin_plugin_text_file/' . $plugin->getID() . "/$file"; + $link = elgg_view('output/url', array( + 'text' => $file, + 'href' => $url, + 'is_trusted' => true, + )); + $docs .= "<li>$link</li>"; + + } + $docs .= '</ul>'; +} + +?> + +<div class="<?php echo implode(' ', $classes); ?>" id="<?php echo $css_id; ?>"> + <div class="elgg-image-block"> + <div class="elgg-image-alt"> + <?php if ($links) : ?> + <ul class="elgg-menu elgg-menu-metadata"> + <?php echo $links; ?> + </ul> + <?php endif; ?> + <div class="clearfloat float-alt mtm"> + <?php echo $action_button; ?> + </div> + </div> + <div class="elgg-body"> +<?php +$settings_view_old = 'settings/' . $plugin->getID() . '/edit'; +$settings_view_new = 'plugins/' . $plugin->getID() . '/settings'; +if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new)) { + $link = elgg_get_site_url() . "admin/plugin_settings/" . $plugin->getID(); + $settings_link = "<a class='elgg-plugin-settings' href='$link'>[" . elgg_echo('settings') . "]</a>"; +} +?> + <div class="elgg-head"> + <h3><?php echo $plugin->getManifest()->getName() . " $version $settings_link"; ?></h3> + </div> + <?php + if ($plugin->getManifest()->getApiVersion() < 1.8) { + $reqs = $plugin->getManifest()->getRequires(); + if (!$reqs) { + $message = elgg_echo('admin:plugins:warning:elgg_version_unknown'); + echo "<p class=\"elgg-state-error\">$message</p>"; + } + } + + if (!$can_activate) { + if ($active) { + $message = elgg_echo('admin:plugins:warning:unmet_dependencies_active'); + echo "<p class=\"elgg-state-warning\">$message</p>"; + } else { + $message = elgg_echo('admin:plugins:warning:unmet_dependencies'); + echo "<p class=\"elgg-state-error\">$message</p>"; + } + } + ?> + + <div><?php echo $description; ?></div> + <p><?php echo $author . ' - ' . $website; ?></p> + + <?php + echo $resources_html; + echo $docs; + ?> + + <div class="pts"> + <?php + echo elgg_view('output/url', array( + 'href' => "#elgg-plugin-manifest-$css_id", + 'text' => elgg_echo("admin:plugins:label:moreinfo"), + 'rel' => 'toggle', + )); + ?> + </div> + </div> + </div> + <div class="elgg-plugin-more hidden" id="elgg-plugin-manifest-<?php echo $css_id; ?>"> + + <?php + if ($screenshots_html) { + ?> + <div><ul><?php echo $screenshots_html; ?></ul></div> + <?php + } + + if ($categories_html) { + ?> + <div><?php echo elgg_echo('admin:plugins:label:categories') . ": <ul class=\"elgg-plugin-categories\">$categories_html</ul>"; ?></div> + <?php + } + + ?> + <div><?php echo elgg_echo('admin:plugins:label:copyright') . ": " . $copyright; ?></div> + <div><?php echo elgg_echo('admin:plugins:label:licence') . ": " . $license; ?></div> + <div><?php echo elgg_echo('admin:plugins:label:location') . ": " . htmlspecialchars($plugin->getPath()) ?></div> + + <div><?php echo elgg_echo('admin:plugins:label:dependencies'); ?>: + <?php + echo elgg_view('object/plugin/elements/dependencies', array('plugin' => $plugin)); + ?> + </div> + </div> +</div> diff --git a/views/default/object/plugin/invalid.php b/views/default/object/plugin/invalid.php new file mode 100644 index 000000000..828bceaba --- /dev/null +++ b/views/default/object/plugin/invalid.php @@ -0,0 +1,42 @@ +<?php +/** + * Displays an invalid plugin on the admin screen. + * + * An invalid plugin is a plugin whose isValid() method returns false. + * This usually means there are required files missing, unreadable or in the + * wrong format. + * + * @package Elgg.Core + * @subpackage Plugins + */ + +$plugin = $vars['entity']; + +$id = $plugin->getID(); +$path = htmlspecialchars($plugin->getPath()); +$message = elgg_echo('admin:plugins:warning:invalid', array($plugin->getError())); +$css_id = preg_replace('/[^a-z0-9-]/i', '-', $plugin->getID()); + +?> + +<div class="elgg-state-draggable elgg-plugin elgg-state-inactive elgg-state-error" id="elgg-plugin-<?php echo $plugin->guid; ?>"> + <div class="elgg-head"><h3><?php echo $id; ?></h3></div> + <div class="elgg-body"> + <p class="elgg-state-error"><?php echo $message; ?></p> + <p><?php echo elgg_echo('admin:plugins:warning:invalid:check_docs'); ?></p> + + <div class="pts"> + <?php + echo elgg_view('output/url', array( + 'href' => "#elgg-plugin-manifest-$css_id", + 'text' => elgg_echo("admin:plugins:label:moreinfo"), + 'rel' => 'toggle', + )); + ?> + </div> + + <div class="hidden elgg-plugin-more" id="elgg-plugin-manifest-<?php echo $css_id; ?>"> + <p><?php echo elgg_echo('admin:plugins:label:location') . ": " . $path; ?></p> + </div> + </div> +</div>
\ No newline at end of file diff --git a/views/default/object/widget.php b/views/default/object/widget.php index b3ef5bb8c..0c7994f2b 100644 --- a/views/default/object/widget.php +++ b/views/default/object/widget.php @@ -1,9 +1,75 @@ <?php /** - * Elgg default widget view + * Widget object * - * @package Elgg - * @subpackage Core + * @uses $vars['entity'] ElggWidget + * @uses $vars['show_access'] Show the access control in edit area? (true) */ -echo elgg_view('widgets/wrapper',$vars); +$widget = $vars['entity']; +if (!elgg_instanceof($widget, 'object', 'widget')) { + return true; +} + +$show_access = elgg_extract('show_access', $vars, true); + +// @todo catch for disabled plugins +$widget_types = elgg_get_widget_types('all'); + +$handler = $widget->handler; + +$title = $widget->getTitle(); + +$edit_area = ''; +$can_edit = $widget->canEdit(); +if ($can_edit) { + $edit_area = elgg_view('object/widget/elements/settings', array( + 'widget' => $widget, + 'show_access' => $show_access, + )); +} +$controls = elgg_view('object/widget/elements/controls', array( + 'widget' => $widget, + 'show_edit' => $edit_area != '', +)); + +// don't show content for default widgets +if (elgg_in_context('default_widgets')) { + $content = ''; +} else { + if (elgg_view_exists("widgets/$handler/content")) { + $content = elgg_view("widgets/$handler/content", $vars); + } else { + elgg_deprecated_notice("widgets use content as the display view", 1.8); + $content = elgg_view("widgets/$handler/view", $vars); + } +} + +$widget_id = "elgg-widget-$widget->guid"; +$widget_instance = "elgg-widget-instance-$handler"; +$widget_class = "elgg-module elgg-module-widget"; +if ($can_edit) { + $widget_class .= " elgg-state-draggable $widget_instance"; +} else { + $widget_class .= " elgg-state-fixed $widget_instance"; +} + +$widget_header = <<<HEADER + <div class="elgg-widget-handle clearfix"><h3>$title</h3> + $controls + </div> +HEADER; + +$widget_body = <<<BODY + $edit_area + <div class="elgg-widget-content" id="elgg-widget-content-$widget->guid"> + $content + </div> +BODY; + +echo elgg_view('page/components/module', array( + 'class' => $widget_class, + 'id' => $widget_id, + 'body' => $widget_body, + 'header' => $widget_header, +)); diff --git a/views/default/object/widget/elements/controls.php b/views/default/object/widget/elements/controls.php new file mode 100644 index 000000000..57a935f62 --- /dev/null +++ b/views/default/object/widget/elements/controls.php @@ -0,0 +1,14 @@ +<?php +/** + * Elgg widget controls + * + * @uses $vars['widget'] + * @uses $vars['show_edit'] Whether to show the edit button (true) + */ + +echo elgg_view_menu('widget', array( + 'entity' => elgg_extract('widget', $vars), + 'show_edit' => elgg_extract('show_edit', $vars, true), + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', +)); diff --git a/views/default/object/widget/elements/settings.php b/views/default/object/widget/elements/settings.php new file mode 100644 index 000000000..25cda58c9 --- /dev/null +++ b/views/default/object/widget/elements/settings.php @@ -0,0 +1,25 @@ +<?php +/** + * Elgg widget edit settings + * + * @uses $vars['widget'] + */ + +$widget = elgg_extract('widget', $vars); + +// not using elgg_view_form() so that we can detect if the form is empty +$form_body = elgg_view('forms/widgets/save', $vars); +if (!$form_body) { + return true; +} + +$form = elgg_view('input/form', array( + 'action' => 'action/widgets/save', + 'body' => $form_body, + 'class' => 'elgg-form-widgets-save', +)); +?> + +<div class="elgg-widget-edit" id="widget-edit-<?php echo $widget->guid; ?>"> + <?php echo $form; ?> +</div> diff --git a/views/default/output/access.php b/views/default/output/access.php index 5490d3203..5c8d62c4d 100644 --- a/views/default/output/access.php +++ b/views/default/output/access.php @@ -9,31 +9,34 @@ //sort out the access level for display if (isset($vars['entity']) && elgg_instanceof($vars['entity'])) { $access_id = $vars['entity']->access_id; - $access_class = 'access_level'; + $access_class = 'elgg-access'; $access_id_string = get_readable_access_level($access_id); + $access_id_string = htmlspecialchars($access_id_string, ENT_QUOTES, 'UTF-8', false); // if within a group or shared access collection display group name and open/closed membership status // @todo have a better way to do this instead of checking against subtype / class. - $container = get_entity($vars['entity']->container_guid); + $container = $vars['entity']->getContainerEntity(); - if ($container instanceof ElggGroup) { + if ($container && $container instanceof ElggGroup) { // we decided to show that the item is in a group, rather than its actual access level // not required. Group ACLs are prepended with "Group: " when written. //$access_id_string = elgg_echo('groups:group') . $container->name; - $membership = $is_group->membership; + $membership = $container->membership; if ($membership == ACCESS_PUBLIC) { - $access_class .= ' group_open'; + $access_class .= ' elgg-access-group-open'; } else { - $access_class .= ' group_closed'; + $access_class .= ' elgg-access-group-closed'; } - } elseif ($container->getSubtype() == 'shared_access') { - $access_level .= ' shared_collection'; + + // @todo this is plugin specific code in core. Should be removed. + } elseif ($container && $container->getSubtype() == 'shared_access') { + $access_class .= ' shared_collection'; } elseif ($access_id == ACCESS_PRIVATE) { - $access_level .= ' private'; - } else { - $access_level .= ' entity_access'; + $access_class .= ' elgg-access-private'; } - echo "<span class=\"$access_class\">$access_id_string</span>"; -}
\ No newline at end of file + $help_text = elgg_echo('access:help'); + + echo "<span title=\"$help_text\" class=\"$access_class\">$access_id_string</span>"; +} diff --git a/views/default/output/calendar.php b/views/default/output/calendar.php index 8729fa1c5..fa0bd0c04 100644 --- a/views/default/output/calendar.php +++ b/views/default/output/calendar.php @@ -9,9 +9,5 @@ * @uses $vars['value'] The current value, if any * */ - -if (is_int($vars['value'])) { - echo date("F j, Y", $vars['value']); -} else { - echo htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8'); -}
\ No newline at end of file +elgg_deprecated_notice('output/calendar was deprecated in favor of output/date', 1.8); +echo elgg_view('output/date', $vars);
\ No newline at end of file diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php index bce06305a..532790a38 100644 --- a/views/default/output/confirmlink.php +++ b/views/default/output/confirmlink.php @@ -6,24 +6,42 @@ * @package Elgg * @subpackage Core * - * @uses $vars['text'] The text of the link - * @uses $vars['href'] The address - * @uses $vars['confirm'] The dialog text - * + * @uses $vars['text'] The text of the link + * @uses $vars['href'] The address + * @uses $vars['title'] The title text (defaults to confirm text) + * @uses $vars['confirm'] The dialog text + * @uses $vars['encode_text'] Run $vars['text'] through htmlspecialchars() (false) */ -$confirm = $vars['confirm']; -if (!$confirm) { - $confirm = elgg_echo('question:areyousure'); -} +$vars['rel'] = elgg_extract('confirm', $vars, elgg_echo('question:areyousure')); +$vars['rel'] = addslashes($vars['rel']); +$encode = elgg_extract('encode_text', $vars, false); // always generate missing action tokens -$link = elgg_add_action_tokens_to_url(elgg_normalize_url($vars['href'])); +$vars['href'] = elgg_add_action_tokens_to_url(elgg_normalize_url($vars['href']), true); + +$text = elgg_extract('text', $vars, ''); +if ($encode) { + $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8', false); +} -if (isset($vars['class']) && $vars['class']) { - $class = 'class="' . $vars['class'] . '"'; +if (!isset($vars['title']) && isset($vars['confirm'])) { + $vars['title'] = $vars['rel']; +} + +if (isset($vars['class'])) { + if (!is_array($vars['class'])) { + $vars['class'] = array($vars['class']); + } + $vars['class'][] = 'elgg-requires-confirmation'; } else { - $class = ''; + $vars['class'] = 'elgg-requires-confirmation'; } -?> -<a href="<?php echo $link; ?>" <?php echo $class; ?> onclick="return confirm('<?php echo addslashes($confirm); ?>');"><?php echo htmlspecialchars($vars['text'], ENT_QUOTES, 'UTF-8'); ?></a> + +unset($vars['encode_text']); +unset($vars['text']); +unset($vars['confirm']); +unset($vars['is_trusted']); + +$attributes = elgg_format_attributes($vars); +echo "<a $attributes>$text</a>"; diff --git a/views/default/output/date.php b/views/default/output/date.php index bd8a65714..1644a3480 100644 --- a/views/default/output/date.php +++ b/views/default/output/date.php @@ -6,10 +6,12 @@ * @package Elgg * @subpackage Core * - * @uses $vars['value'] A UNIX epoch timestamp - * + * @uses $vars['value'] Date as text or a Unix timestamp in seconds */ -if ($vars['value'] > 86400) { - echo date("F j, Y",$vars['value']); -}
\ No newline at end of file +// convert timestamps to text for display +if (is_numeric($vars['value'])) { + $vars['value'] = gmdate('Y-m-d', $vars['value']); +} + +echo $vars['value']; diff --git a/views/default/output/dropdown.php b/views/default/output/dropdown.php new file mode 100644 index 000000000..8d68508ca --- /dev/null +++ b/views/default/output/dropdown.php @@ -0,0 +1,13 @@ +<?php +/** + * Elgg dropdown display + * Displays a value that was entered into the system via a dropdown + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['text'] The text to display + * + */ + +echo htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8', false); diff --git a/views/default/output/email.php b/views/default/output/email.php index 8f5c092b9..f5a8bc4b8 100644 --- a/views/default/output/email.php +++ b/views/default/output/email.php @@ -10,6 +10,8 @@ * */ +$encoded_value = htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8'); + if (!empty($vars['value'])) { - echo "<a href=\"mailto:" . $vars['value'] . "\">". htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8') ."</a>"; + echo "<a href=\"mailto:$encoded_value\">$encoded_value</a>"; }
\ No newline at end of file diff --git a/views/default/output/img.php b/views/default/output/img.php new file mode 100644 index 000000000..d3f596801 --- /dev/null +++ b/views/default/output/img.php @@ -0,0 +1,12 @@ +<?php +/** + * Elgg image view + * + * @uses string $vars['src'] The image src url. + */ + +$vars['src'] = elgg_normalize_url($vars['src']); +$vars['src'] = elgg_format_url($vars['src']); + +$attributes = elgg_format_attributes($vars); +echo "<img $attributes/>"; diff --git a/views/default/output/location.php b/views/default/output/location.php new file mode 100644 index 000000000..e1009f17d --- /dev/null +++ b/views/default/output/location.php @@ -0,0 +1,19 @@ +<?php +/** + * Display a location + * + * @uses $vars['entity'] The ElggEntity that has a location + * @uses $vars['value'] The location string if the entity is not passed + */ + +if (isset($vars['entity'])) { + $vars['value'] = $vars['entity']->location; + unset($vars['entity']); +} + +// Fixes #4566 we used to allow arrays of strings for location +if (is_array($vars['value'])) { + $vars['value'] = implode(', ', $vars['value']); +} + +echo elgg_view('output/tag', $vars); diff --git a/views/default/output/longtext.php b/views/default/output/longtext.php index 22a4ad46d..589100c4f 100644 --- a/views/default/output/longtext.php +++ b/views/default/output/longtext.php @@ -8,18 +8,31 @@ * * @uses $vars['value'] The text to display * @uses $vars['parse_urls'] Whether to turn urls into links. Default is true. + * @uses $vars['class'] */ -$parse_urls = isset($vars['parse_urls']) ? $vars['parse_urls'] : TRUE; +$class = 'elgg-output'; +$additional_class = elgg_extract('class', $vars, ''); +if ($additional_class) { + $vars['class'] = "$class $additional_class"; +} else { + $vars['class'] = $class; +} -$text = $vars['value']; +$parse_urls = elgg_extract('parse_urls', $vars, true); +unset($vars['parse_urls']); -$text = filter_tags($text); +$text = $vars['value']; +unset($vars['value']); if ($parse_urls) { $text = parse_urls($text); } -$text = autop($text); +$text = filter_tags($text); + +$text = elgg_autop($text); + +$attributes = elgg_format_attributes($vars); -echo $text; +echo "<div $attributes>$text</div>"; diff --git a/views/default/output/pulldown.php b/views/default/output/pulldown.php index c597eb5c9..7097a9a8d 100644 --- a/views/default/output/pulldown.php +++ b/views/default/output/pulldown.php @@ -8,6 +8,7 @@ * * @uses $vars['text'] The text to display * + * @deprecated 1.8 Use output/dropdown */ -echo htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8'); //$vars['value'];
\ No newline at end of file +echo elgg_view('output/dropdown', $vars);
\ No newline at end of file diff --git a/views/default/output/radio.php b/views/default/output/radio.php index dd3198b6d..0fae9977b 100644 --- a/views/default/output/radio.php +++ b/views/default/output/radio.php @@ -10,4 +10,4 @@ * */ -echo elgg_view('output/text',$vars);
\ No newline at end of file +echo elgg_view('output/text', $vars);
\ No newline at end of file diff --git a/views/default/output/rss_view.php b/views/default/output/rss_view.php deleted file mode 100644 index 530bb9684..000000000 --- a/views/default/output/rss_view.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php - /** - * View to display the RSS link - * @todo check this - it doesn't appear this view is ever called - **/ -?> -<div class="rss-link clearfix"><a href="" title="RSS feed for the wire">RSS feed for the wire</a></div>
\ No newline at end of file diff --git a/views/default/output/tag.php b/views/default/output/tag.php new file mode 100644 index 000000000..6bd9a72a7 --- /dev/null +++ b/views/default/output/tag.php @@ -0,0 +1,35 @@ +<?php +/** + * Elgg single tag output + * + * @uses $vars['value'] String + * @uses $vars['type'] The entity type, optional + * @uses $vars['subtype'] The entity subtype, optional + * + */ + +if (!empty($vars['type'])) { + $type = "&type=" . rawurlencode($vars['type']); +} else { + $type = ""; +} +if (!empty($vars['subtype'])) { + $subtype = "&subtype=" . rawurlencode($vars['subtype']); +} else { + $subtype = ""; +} +if (!empty($vars['object'])) { + $object = "&object=" . rawurlencode($vars['object']); +} else { + $object = ""; +} + +if (isset($vars['value'])) { + $url = elgg_get_site_url() . 'search?q=' . rawurlencode($vars['value']) . "&search_type=tags{$type}{$subtype}{$object}"; + $vars['value'] = htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8', false); + echo elgg_view('output/url', array( + 'href' => $url, + 'text' => $vars['value'], + 'rel' => 'tag', + )); +} diff --git a/views/default/output/tagcloud.php b/views/default/output/tagcloud.php index 5840eabe4..2fbf1cd0a 100644 --- a/views/default/output/tagcloud.php +++ b/views/default/output/tagcloud.php @@ -12,8 +12,6 @@ * @uses $vars['subtype'] Entity subtype */ -$context = elgg_get_context(); - if (!empty($vars['subtype'])) { $subtype = "&entity_subtype=" . urlencode($vars['subtype']); } else { @@ -41,6 +39,8 @@ if (!empty($vars['tagcloud']) && is_array($vars['tagcloud'])) { $cloud = ''; foreach ($vars['tagcloud'] as $tag) { + $tag->tag = htmlspecialchars($tag->tag, ENT_QUOTES, 'UTF-8', false); + if ($cloud != '') { $cloud .= ', '; } @@ -49,27 +49,18 @@ if (!empty($vars['tagcloud']) && is_array($vars['tagcloud'])) { if ($size < 100) { $size = 100; } - $url = elgg_get_site_url()."pg/search/?q=". urlencode($tag->tag) . "&search_type=tags$type$subtype"; - $cloud .= "<a href=\"$url\" style=\"font-size: $size%\" title=\"".addslashes($tag->tag)." ($tag->total)\" style=\"text-decoration:none;\">" . htmlspecialchars($tag->tag, ENT_QUOTES, 'UTF-8') . "</a>"; - } - - if ($context != 'tags') { - $text = elgg_echo('tagcloud:allsitetags'); - $cloud .= '<p class="elgg-tags">'; - $cloud .= "<a href=\"".elgg_get_site_url()."pg/tags\">$text</a>"; - $cloud .= '</p>'; + $url = "search?q=". urlencode($tag->tag) . "&search_type=tags$type$subtype"; + + $cloud .= elgg_view('output/url', array( + 'text' => $tag->tag, + 'href' => $url, + 'style' => "font-size: $size%;", + 'title' => "$tag->tag ($tag->total)", + 'rel' => 'tag' + )); } $cloud .= elgg_view('tagcloud/extend'); - if ($context != 'tags') { - $params = array( - 'title' => elgg_echo('tagcloud'), - 'body' => $cloud, - 'body_class' => 'elgg-tagcloud', - ); - echo elgg_view('layout/objects/module', $params); - } else { - echo "<div class=\"elgg-tagcloud\">$cloud</div>"; - } + echo "<div class=\"elgg-tagcloud\">$cloud</div>"; } diff --git a/views/default/output/tags.php b/views/default/output/tags.php index 1dbf14a7d..db096a3be 100644 --- a/views/default/output/tags.php +++ b/views/default/output/tags.php @@ -1,24 +1,34 @@ <?php /** * Elgg tags - * Displays a list of tags, separated by commas - * * Tags can be a single string (for one tag) or an array of strings * - * @package Elgg - * @subpackage Core - * - * @uses $vars['tags'] The tags to display - * @uses $vars['tagtype'] The tagtype, optionally + * @uses $vars['value'] Array of tags or a string + * @uses $vars['type'] The entity type, optional + * @uses $vars['subtype'] The entity subtype, optional + * @uses $vars['entity'] Optional. Entity whose tags are being displayed (metadata ->tags) + * @uses $vars['list_class'] Optional. Additional classes to be passed to <ul> element + * @uses $vars['item_class'] Optional. Additional classes to be passed to <li> elements + * @uses $vars['icon_class'] Optional. Additional classes to be passed to tags icon image */ +if (isset($vars['entity'])) { + $vars['tags'] = $vars['entity']->tags; + unset($vars['entity']); +} + +if (!empty($vars['type'])) { + $type = "&type=" . rawurlencode($vars['type']); +} else { + $type = ""; +} if (!empty($vars['subtype'])) { - $subtype = "&subtype=" . urlencode($vars['subtype']); + $subtype = "&subtype=" . rawurlencode($vars['subtype']); } else { $subtype = ""; } if (!empty($vars['object'])) { - $object = "&object=" . urlencode($vars['object']); + $object = "&object=" . rawurlencode($vars['object']); } else { $object = ""; } @@ -27,24 +37,46 @@ if (empty($vars['tags']) && !empty($vars['value'])) { $vars['tags'] = $vars['value']; } +if (empty($vars['tags']) && isset($vars['entity'])) { + $vars['tags'] = $vars['entity']->tags; +} + if (!empty($vars['tags'])) { - $tagstr = ""; if (!is_array($vars['tags'])) { $vars['tags'] = array($vars['tags']); } + $list_class = "elgg-tags"; + if (isset($vars['list_class'])) { + $list_class = "$list_class {$vars['list_class']}"; + } + + $item_class = "elgg-tag"; + if (isset($vars['item_class'])) { + $item_class = "$item_class {$vars['item_class']}"; + } + + $icon_class = elgg_extract('icon_class', $vars); + $list_items = '<li>' . elgg_view_icon('tag', $icon_class) . '</li>'; + foreach($vars['tags'] as $tag) { - if (!empty($tagstr)) { - $tagstr .= ", "; - } - if (!empty($vars['type'])) { - $type = "&type={$vars['type']}"; - } else { - $type = ""; - } + $url = elgg_get_site_url() . 'search?q=' . rawurlencode($tag) . "&search_type=tags{$type}{$subtype}{$object}"; if (is_string($tag)) { - $tagstr .= "<a rel=\"tag\" href=\"".elgg_get_site_url()."pg/search/?q=".urlencode($tag) . "&search_type=tags{$type}{$subtype}{$object}\">" . htmlspecialchars($tag, ENT_QUOTES, 'UTF-8') . "</a>"; + $tag = htmlspecialchars($tag, ENT_QUOTES, 'UTF-8', false); + $list_items .= "<li class=\"$item_class\">"; + $list_items .= elgg_view('output/url', array('href' => $url, 'text' => $tag, 'rel' => 'tag')); + $list_items .= '</li>'; } } - echo $tagstr; + + $list = <<<___HTML + <div class="clearfix"> + <ul class="$list_class"> + $list_items + </ul> + </div> +___HTML; + + echo $list; } + diff --git a/views/default/output/text.php b/views/default/output/text.php index f95e2d7fd..5cbfc35b0 100644 --- a/views/default/output/text.php +++ b/views/default/output/text.php @@ -6,8 +6,7 @@ * @package Elgg * @subpackage Core * - * @uses $vars['text'] The text to display - * + * @uses $vars['value'] The text to display */ -echo htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8'); // $vars['value'];
\ No newline at end of file +echo htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8', false);
\ No newline at end of file diff --git a/views/default/output/url.php b/views/default/output/url.php index 8ea84d3d6..81b02087d 100644 --- a/views/default/output/url.php +++ b/views/default/output/url.php @@ -8,41 +8,49 @@ * * @uses string $vars['text'] The string between the <a></a> tags. * @uses string $vars['href'] The unencoded url string - * @uses bool $vars['encode_text'] Run $vars['text'] through htmlspecialchars()? - * @uses bool $vars['is_action'] Is this a link to an action? - * + * @uses bool $vars['encode_text'] Run $vars['text'] through htmlspecialchars() (false) + * @uses bool $vars['is_action'] Is this a link to an action (false) + * @uses bool $vars['is_trusted'] Is this link trusted (false) */ -$url = trim($vars['href']); +$url = elgg_extract('href', $vars, null); if (!$url and isset($vars['value'])) { $url = trim($vars['value']); unset($vars['value']); } -if (!empty($url)) { - if (isset($vars['text'])) { - if (isset($vars['encode_text']) && $vars['encode_text']) { - $text = htmlspecialchars($vars['text'], ENT_QUOTES, 'UTF-8'); - } else { - $text = $vars['text']; - } - - unset($vars['text']); +if (isset($vars['text'])) { + if (elgg_extract('encode_text', $vars, false)) { + $text = htmlspecialchars($vars['text'], ENT_QUOTES, 'UTF-8', false); } else { - $text = htmlspecialchars($url, ENT_QUOTES, 'UTF-8'); + $text = $vars['text']; } + unset($vars['text']); +} else { + $text = htmlspecialchars($url, ENT_QUOTES, 'UTF-8', false); +} - unset($vars['encode_text']); +unset($vars['encode_text']); +if ($url) { $url = elgg_normalize_url($url); - if (isset($vars['is_action'])) { - $url = elgg_add_action_tokens_to_url($url, FALSE); - unset($vars['is_action']); + if (elgg_extract('is_action', $vars, false)) { + $url = elgg_add_action_tokens_to_url($url, false); + } + + if (!elgg_extract('is_trusted', $vars, false)) { + if (!isset($vars['rel'])) { + $vars['rel'] = 'nofollow'; + $url = strip_tags($url); + } } $vars['href'] = $url; +} + +unset($vars['is_action']); +unset($vars['is_trusted']); - $attributes = elgg_format_attributes($vars); - echo "<a $attributes>$text</a>"; -}
\ No newline at end of file +$attributes = elgg_format_attributes($vars); +echo "<a $attributes>$text</a>"; diff --git a/views/default/page/admin.php b/views/default/page/admin.php new file mode 100644 index 000000000..7045edd91 --- /dev/null +++ b/views/default/page/admin.php @@ -0,0 +1,66 @@ +<?php +/** + * Elgg pageshell for the admin area + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['title'] The page title + * @uses $vars['body'] The main content of the page + * @uses $vars['sysmessages'] A 2d array of various message registers, passed from system_messages() + */ + +$notices_html = ''; +$notices = elgg_get_admin_notices(); +if ($notices) { + foreach ($notices as $notice) { + $notices_html .= elgg_view_entity($notice); + } + + $notices_html = "<div class=\"elgg-admin-notices\">$notices_html</div>"; +} + +// render content before head so that JavaScript and CSS can be loaded. See #4032 +$messages = elgg_view('page/elements/messages', array('object' => $vars['sysmessages'])); +$header = elgg_view('admin/header', $vars); +$body = $vars['body']; +$footer = elgg_view('admin/footer', $vars); + + +// Set the content type +header("Content-type: text/html; charset=UTF-8"); + +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<?php echo elgg_view('page/elements/head', $vars); ?> +</head> +<body> + <div class="elgg-page elgg-page-admin"> + <div class="elgg-inner"> + <div class="elgg-page-header"> + <div class="elgg-inner clearfix"> + <?php echo $header; ?> + </div> + </div> + <div class="elgg-page-messages"> + <?php echo $messages; ?> + <?php echo $notices_html; ?> + </div> + <div class="elgg-page-body"> + <div class="elgg-inner"> + <?php echo $body; ?> + </div> + </div> + <div class="elgg-page-footer"> + <div class="elgg-inner"> + <?php echo $footer; ?> + </div> + </div> + </div> + </div> + <?php echo elgg_view('page/elements/foot'); ?> +</body> + +</html>
\ No newline at end of file diff --git a/views/default/page/components/gallery.php b/views/default/page/components/gallery.php new file mode 100644 index 000000000..e8b3f477e --- /dev/null +++ b/views/default/page/components/gallery.php @@ -0,0 +1,77 @@ +<?php +/** + * Gallery view + * + * Implemented as an unorder list + * + * @uses $vars['items'] Array of ElggEntity or ElggAnnotation objects + * @uses $vars['offset'] Index of the first list item in complete list + * @uses $vars['limit'] Number of items per page + * @uses $vars['count'] Number of items in the complete list + * @uses $vars['pagination'] Show pagination? (default: true) + * @uses $vars['position'] Position of the pagination: before, after, or both + * @uses $vars['full_view'] Show the full view of the items (default: false) + * @uses $vars['gallery_class'] Additional CSS class for the <ul> element + * @uses $vars['item_class'] Additional CSS class for the <li> elements + */ + +$items = $vars['items']; +if (!is_array($items) || sizeof($items) == 0) { + return true; +} + +elgg_push_context('gallery'); + +$offset = $vars['offset']; +$limit = $vars['limit']; +$count = $vars['count']; +$pagination = elgg_extract('pagination', $vars, true); +$offset_key = elgg_extract('offset_key', $vars, 'offset'); +$position = elgg_extract('position', $vars, 'after'); + +$gallery_class = 'elgg-gallery'; +if (isset($vars['gallery_class'])) { + $gallery_class = "$gallery_class {$vars['gallery_class']}"; +} + +$item_class = 'elgg-item'; +if (isset($vars['item_class'])) { + $item_class = "$item_class {$vars['item_class']}"; +} + +$nav = ''; +if ($pagination && $count) { + $nav .= elgg_view('navigation/pagination', array( + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + 'offset_key' => $offset_key, + )); +} + +if ($position == 'before' || $position == 'both') { + echo $nav; +} + +?> +<ul class="<?php echo $gallery_class; ?>"> + <?php + foreach ($items as $item) { + if (elgg_instanceof($item)) { + $id = "elgg-{$item->getType()}-{$item->getGUID()}"; + } else { + $id = "item-{$item->getType()}-{$item->id}"; + } + echo "<li id=\"$id\" class=\"$item_class\">"; + echo elgg_view_list_item($item, $vars); + echo "</li>"; + } + ?> +</ul> + +<?php +if ($position == 'after' || $position == 'both') { + echo $nav; +} + +elgg_pop_context(); diff --git a/views/default/page/components/image_block.php b/views/default/page/components/image_block.php new file mode 100644 index 000000000..a7f480aef --- /dev/null +++ b/views/default/page/components/image_block.php @@ -0,0 +1,52 @@ +<?php +/** + * Elgg image block pattern + * + * Common pattern where there is an image, icon, media object to the left + * and a descriptive block of text to the right. + * + * --------------------------------------------------------------- + * | | | alt | + * | image | body | image | + * | block | block | block | + * | | | (optional)| + * --------------------------------------------------------------- + * + * @uses $vars['body'] HTML content of the body block + * @uses $vars['image'] HTML content of the image block + * @uses $vars['image_alt'] HTML content of the alternate image block + * @uses $vars['class'] Optional additional class for media element + * @uses $vars['id'] Optional id for the media element + */ + +$body = elgg_extract('body', $vars, ''); +$image = elgg_extract('image', $vars, ''); +$alt_image = elgg_extract('image_alt', $vars, ''); + +$class = 'elgg-image-block'; +$additional_class = elgg_extract('class', $vars, ''); +if ($additional_class) { + $class = "$class $additional_class"; +} + +$id = ''; +if (isset($vars['id'])) { + $id = "id=\"{$vars['id']}\""; +} + + +$body = "<div class=\"elgg-body\">$body</div>"; + +if ($image) { + $image = "<div class=\"elgg-image\">$image</div>"; +} + +if ($alt_image) { + $alt_image = "<div class=\"elgg-image-alt\">$alt_image</div>"; +} + +echo <<<HTML +<div class="$class clearfix" $id> + $image$alt_image$body +</div> +HTML; diff --git a/views/default/page/components/list.php b/views/default/page/components/list.php new file mode 100644 index 000000000..28ed58ddf --- /dev/null +++ b/views/default/page/components/list.php @@ -0,0 +1,75 @@ +<?php +/** + * View a list of items + * + * @package Elgg + * + * @uses $vars['items'] Array of ElggEntity or ElggAnnotation objects + * @uses $vars['offset'] Index of the first list item in complete list + * @uses $vars['limit'] Number of items per page. Only used as input to pagination. + * @uses $vars['count'] Number of items in the complete list + * @uses $vars['base_url'] Base URL of list (optional) + * @uses $vars['pagination'] Show pagination? (default: true) + * @uses $vars['position'] Position of the pagination: before, after, or both + * @uses $vars['full_view'] Show the full view of the items (default: false) + * @uses $vars['list_class'] Additional CSS class for the <ul> element + * @uses $vars['item_class'] Additional CSS class for the <li> elements + */ + +$items = $vars['items']; +$offset = elgg_extract('offset', $vars); +$limit = elgg_extract('limit', $vars); +$count = elgg_extract('count', $vars); +$base_url = elgg_extract('base_url', $vars, ''); +$pagination = elgg_extract('pagination', $vars, true); +$offset_key = elgg_extract('offset_key', $vars, 'offset'); +$position = elgg_extract('position', $vars, 'after'); + +$list_class = 'elgg-list'; +if (isset($vars['list_class'])) { + $list_class = "$list_class {$vars['list_class']}"; +} + +$item_class = 'elgg-item'; +if (isset($vars['item_class'])) { + $item_class = "$item_class {$vars['item_class']}"; +} + +$html = ""; +$nav = ""; + +if ($pagination && $count) { + $nav .= elgg_view('navigation/pagination', array( + 'base_url' => $base_url, + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + 'offset_key' => $offset_key, + )); +} + +if (is_array($items) && count($items) > 0) { + $html .= "<ul class=\"$list_class\">"; + foreach ($items as $item) { + $li = elgg_view_list_item($item, $vars); + if ($li) { + if (elgg_instanceof($item)) { + $id = "elgg-{$item->getType()}-{$item->getGUID()}"; + } else { + $id = "item-{$item->getType()}-{$item->id}"; + } + $html .= "<li id=\"$id\" class=\"$item_class\">$li</li>"; + } + } + $html .= '</ul>'; +} + +if ($position == 'before' || $position == 'both') { + $html = $nav . $html; +} + +if ($position == 'after' || $position == 'both') { + $html .= $nav; +} + +echo $html; diff --git a/views/default/page/components/module.php b/views/default/page/components/module.php new file mode 100644 index 000000000..7e1eaff20 --- /dev/null +++ b/views/default/page/components/module.php @@ -0,0 +1,48 @@ +<?php +/** + * Elgg module element + * + * @uses $vars['title'] Optional title text (do not pass header with this option) + * @uses $vars['header'] Optional HTML content of the header + * @uses $vars['body'] HTML content of the body + * @uses $vars['footer'] Optional HTML content of the footer + * @uses $vars['class'] Optional additional class for module + * @uses $vars['id'] Optional id for module + * @uses $vars['show_inner'] Optional flag to leave out inner div (default: false) + */ + +$title = elgg_extract('title', $vars, ''); +$header = elgg_extract('header', $vars, ''); +$body = elgg_extract('body', $vars, ''); +$footer = elgg_extract('footer', $vars, ''); +$show_inner = elgg_extract('show_inner', $vars, false); + +$class = 'elgg-module'; +$additional_class = elgg_extract('class', $vars, ''); +if ($additional_class) { + $class = "$class $additional_class"; +} + +$id = ''; +if (isset($vars['id'])) { + $id = "id=\"{$vars['id']}\""; +} + +if (isset($vars['header'])) { + $header = "<div class=\"elgg-head\">$header</div>"; +} elseif ($title) { + $header = "<div class=\"elgg-head\"><h3>$title</h3></div>"; +} + +$body = "<div class=\"elgg-body\">$body</div>"; + +if ($footer) { + $footer = "<div class=\"elgg-foot\">$footer</div>"; +} + +$contents = $header . $body . $footer; +if ($show_inner) { + $contents = "<div class=\"elgg-inner\">$contents</div>"; +} + +echo "<div class=\"$class\" $id>$contents</div>"; diff --git a/views/default/page/components/summary.php b/views/default/page/components/summary.php new file mode 100644 index 000000000..ea61a6e4b --- /dev/null +++ b/views/default/page/components/summary.php @@ -0,0 +1,4 @@ +<?php + +// Deprecated in favor of type/elements/summary +echo elgg_view('object/elements/summary', $vars); diff --git a/views/default/page/default.php b/views/default/page/default.php new file mode 100644 index 000000000..567494d0c --- /dev/null +++ b/views/default/page/default.php @@ -0,0 +1,76 @@ +<?php +/** + * Elgg pageshell + * The standard HTML page shell that everything else fits into + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['title'] The page title + * @uses $vars['body'] The main content of the page + * @uses $vars['sysmessages'] A 2d array of various message registers, passed from system_messages() + */ + +// backward compatability support for plugins that are not using the new approach +// of routing through admin. See reportedcontent plugin for a simple example. +if (elgg_get_context() == 'admin') { + if (get_input('handler') != 'admin') { + elgg_deprecated_notice("admin plugins should route through 'admin'.", 1.8); + } + elgg_admin_add_plugin_settings_menu(); + elgg_unregister_css('elgg'); + echo elgg_view('page/admin', $vars); + return true; +} + +// render content before head so that JavaScript and CSS can be loaded. See #4032 +$topbar = elgg_view('page/elements/topbar', $vars); +$messages = elgg_view('page/elements/messages', array('object' => $vars['sysmessages'])); +$header = elgg_view('page/elements/header', $vars); +$body = elgg_view('page/elements/body', $vars); +$footer = elgg_view('page/elements/footer', $vars); + +// Set the content type +header("Content-type: text/html; charset=UTF-8"); + +$lang = get_current_language(); + +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $lang; ?>" lang="<?php echo $lang; ?>"> +<head> +<?php echo elgg_view('page/elements/head', $vars); ?> +</head> +<body> +<div class="elgg-page elgg-page-default"> + <div class="elgg-page-messages"> + <?php echo $messages; ?> + </div> + + <?php if (elgg_is_logged_in()){ ?> + <div class="elgg-page-topbar"> + <div class="elgg-inner"> + <?php echo $topbar; ?> + </div> + </div> + <?php } ?> + + <div class="elgg-page-header"> + <div class="elgg-inner"> + <?php echo $header; ?> + </div> + </div> + <div class="elgg-page-body"> + <div class="elgg-inner"> + <?php echo $body; ?> + </div> + </div> + <div class="elgg-page-footer"> + <div class="elgg-inner"> + <?php echo $footer; ?> + </div> + </div> +</div> +<?php echo elgg_view('page/elements/foot'); ?> +</body> +</html>
\ No newline at end of file diff --git a/views/default/page/elements/body.php b/views/default/page/elements/body.php new file mode 100644 index 000000000..14c3978d3 --- /dev/null +++ b/views/default/page/elements/body.php @@ -0,0 +1,8 @@ +<?php +/** + * Elgg page body wrapper + * + * @uses $vars['body'] The HTML of the page body + */ + +echo elgg_extract('body', $vars, '');
\ No newline at end of file diff --git a/views/default/page/elements/comments.php b/views/default/page/elements/comments.php new file mode 100644 index 000000000..97cb9574e --- /dev/null +++ b/views/default/page/elements/comments.php @@ -0,0 +1,42 @@ +<?php +/** + * List comments with optional add form + * + * @uses $vars['entity'] ElggEntity + * @uses $vars['show_add_form'] Display add form or not + * @uses $vars['id'] Optional id for the div + * @uses $vars['class'] Optional additional class for the div + */ + +$show_add_form = elgg_extract('show_add_form', $vars, true); + +$id = ''; +if (isset($vars['id'])) { + $id = "id=\"{$vars['id']}\""; +} + +$class = 'elgg-comments'; +if (isset($vars['class'])) { + $class = "$class {$vars['class']}"; +} + +// work around for deprecation code in elgg_view() +unset($vars['internalid']); + +echo "<div $id class=\"$class\">"; + +$options = array( + 'guid' => $vars['entity']->getGUID(), + 'annotation_name' => 'generic_comment' +); +$html = elgg_list_annotations($options); +if ($html) { + echo '<h3>' . elgg_echo('comments') . '</h3>'; + echo $html; +} + +if ($show_add_form) { + echo elgg_view_form('comments/add', array(), $vars); +} + +echo '</div>'; diff --git a/views/default/page/elements/comments_block.php b/views/default/page/elements/comments_block.php new file mode 100644 index 000000000..d0f8ab809 --- /dev/null +++ b/views/default/page/elements/comments_block.php @@ -0,0 +1,45 @@ +<?php +/** + * Display the latest related comments + * + * Generally used in a sidebar. Does not work with groups currently. + * + * @uses $vars['subtypes'] Object subtype string or array of subtypes + * @uses $vars['owner_guid'] The owner of the content being commented on + * @uses $vars['limit'] The number of comments to display + */ + +$owner_guid = elgg_extract('owner_guid', $vars, ELGG_ENTITIES_ANY_VALUE); +if (!$owner_guid) { + $owner_guid = ELGG_ENTITIES_ANY_VALUE; +} + +$owner_entity = get_entity($owner_guid); +if ($owner_entity && elgg_instanceof($owner_entity, 'group')) { + // not supporting groups so return + return true; +} + +$options = array( + 'annotation_name' => 'generic_comment', + 'owner_guid' => $owner_guid, + 'reverse_order_by' => true, + 'limit' => elgg_extract('limit', $vars, 4), + 'type' => 'object', + 'subtypes' => elgg_extract('subtypes', $vars, ELGG_ENTITIES_ANY_VALUE), +); + +$title = elgg_echo('generic_comments:latest'); +$comments = elgg_get_annotations($options); +if ($comments) { + $body = elgg_view('page/components/list', array( + 'items' => $comments, + 'pagination' => false, + 'list_class' => 'elgg-latest-comments', + 'full_view' => false, + )); +} else { + $body = '<p>' . elgg_echo('generic_comment:none') . '</p>'; +} + +echo elgg_view_module('aside', $title, $body); diff --git a/views/default/page/elements/foot.php b/views/default/page/elements/foot.php new file mode 100644 index 000000000..a56b373b4 --- /dev/null +++ b/views/default/page/elements/foot.php @@ -0,0 +1,11 @@ +<?php + +echo elgg_view('footer/analytics'); + +$js = elgg_get_loaded_js('footer'); +foreach ($js as $script) { ?> + <script type="text/javascript" src="<?php echo $script; ?>"></script> +<?php +} + +?>
\ No newline at end of file diff --git a/views/default/page/elements/footer.php b/views/default/page/elements/footer.php new file mode 100644 index 000000000..ded2cea9a --- /dev/null +++ b/views/default/page/elements/footer.php @@ -0,0 +1,22 @@ +<?php +/** + * Elgg footer + * The standard HTML footer that displays across the site + * + * @package Elgg + * @subpackage Core + * + */ + +echo elgg_view_menu('footer', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz')); + +$powered_url = elgg_get_site_url() . "_graphics/powered_by_elgg_badge_drk_bckgnd.gif"; + +echo '<div class="mts clearfloat float-alt">'; +echo elgg_view('output/url', array( + 'href' => 'http://elgg.org', + 'text' => "<img src=\"$powered_url\" alt=\"Powered by Elgg\" width=\"106\" height=\"15\" />", + 'class' => '', + 'is_trusted' => true, +)); +echo '</div>'; diff --git a/views/default/page/elements/head.php b/views/default/page/elements/head.php new file mode 100644 index 000000000..d4a95b4d0 --- /dev/null +++ b/views/default/page/elements/head.php @@ -0,0 +1,81 @@ +<?php +/** + * The standard HTML head + * + * @uses $vars['title'] The page title + */ + +// Set title +if (empty($vars['title'])) { + $title = elgg_get_config('sitename'); +} else { + $title = elgg_get_config('sitename') . ": " . $vars['title']; +} + +global $autofeed; +if (isset($autofeed) && $autofeed == true) { + $url = current_page_url(); + if (substr_count($url,'?')) { + $url .= "&view=rss"; + } else { + $url .= "?view=rss"; + } + $url = elgg_format_url($url); + $feedref = <<<END + + <link rel="alternate" type="application/rss+xml" title="RSS" href="{$url}" /> + +END; +} else { + $feedref = ""; +} + +$js = elgg_get_loaded_js('head'); +$css = elgg_get_loaded_css(); + +$version = get_version(); +$release = get_version(true); +?> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="ElggRelease" content="<?php echo $release; ?>" /> + <meta name="ElggVersion" content="<?php echo $version; ?>" /> + <title><?php echo $title; ?></title> + <?php echo elgg_view('page/elements/shortcut_icon', $vars); ?> + +<?php foreach ($css as $link) { ?> + <link rel="stylesheet" href="<?php echo $link; ?>" type="text/css" /> +<?php } ?> + +<?php + $ie_url = elgg_get_simplecache_url('css', 'ie'); + $ie7_url = elgg_get_simplecache_url('css', 'ie7'); + $ie6_url = elgg_get_simplecache_url('css', 'ie6'); +?> + <!--[if gt IE 7]> + <link rel="stylesheet" type="text/css" href="<?php echo $ie_url; ?>" /> + <![endif]--> + <!--[if IE 7]> + <link rel="stylesheet" type="text/css" href="<?php echo $ie7_url; ?>" /> + <![endif]--> + <!--[if IE 6]> + <link rel="stylesheet" type="text/css" href="<?php echo $ie6_url; ?>" /> + <![endif]--> + +<?php foreach ($js as $script) { ?> + <script type="text/javascript" src="<?php echo $script; ?>"></script> +<?php } ?> + +<script type="text/javascript"> +// <![CDATA[ + <?php echo elgg_view('js/initialize_elgg'); ?> +// ]]> +</script> + +<?php +echo $feedref; + +$metatags = elgg_view('metatags', $vars); +if ($metatags) { + elgg_deprecated_notice("The metatags view has been deprecated. Extend page/elements/head instead", 1.8); + echo $metatags; +} diff --git a/views/default/page/elements/header.php b/views/default/page/elements/header.php new file mode 100644 index 000000000..1a1f5d211 --- /dev/null +++ b/views/default/page/elements/header.php @@ -0,0 +1,14 @@ +<?php +/** + * Elgg page header + * In the default theme, the header lives between the topbar and main content area. + */ + +// link back to main site. +echo elgg_view('page/elements/header_logo', $vars); + +// drop-down login +echo elgg_view('core/account/login_dropdown'); + +// insert site-wide navigation +echo elgg_view_menu('site');
\ No newline at end of file diff --git a/views/default/page/elements/header_logo.php b/views/default/page/elements/header_logo.php new file mode 100644 index 000000000..7fe721c40 --- /dev/null +++ b/views/default/page/elements/header_logo.php @@ -0,0 +1,15 @@ +<?php +/** + * Elgg header logo + */ + +$site = elgg_get_site_entity(); +$site_name = $site->name; +$site_url = elgg_get_site_url(); +?> + +<h1> + <a class="elgg-heading-site" href="<?php echo $site_url; ?>"> + <?php echo $site_name; ?> + </a> +</h1> diff --git a/views/default/page_elements/messages.php b/views/default/page/elements/messages.php index f44d1204b..edd40d71e 100644 --- a/views/default/page_elements/messages.php +++ b/views/default/page/elements/messages.php @@ -9,20 +9,19 @@ * @uses $vars['object'] The array of message registers */ -if (isset($vars['object']) && is_array($vars['object']) && sizeof($vars['object']) > 0) { +echo '<ul class="elgg-system-messages">'; - echo '<ul class="elgg-system-messages">'; +// hidden li so we validate +echo '<li class="hidden"></li>'; +if (isset($vars['object']) && is_array($vars['object']) && sizeof($vars['object']) > 0) { foreach ($vars['object'] as $type => $list ) { foreach ($list as $message) { - echo "<li class=\"elgg-state-$type radius8\">"; - echo elgg_view('output/longtext', array( - 'value' => $message, - 'parse_urls' => false - )); + echo "<li class=\"elgg-message elgg-state-$type\">"; + echo elgg_autop($message); echo '</li>'; } } - - echo '</ul>'; } + +echo '</ul>'; diff --git a/views/default/page/elements/owner_block.php b/views/default/page/elements/owner_block.php new file mode 100644 index 000000000..fc7f0f6d2 --- /dev/null +++ b/views/default/page/elements/owner_block.php @@ -0,0 +1,31 @@ +<?php +/** + * Elgg owner block + * Displays page ownership information + * + * @package Elgg + * @subpackage Core + * + */ + +elgg_push_context('owner_block'); + +// groups and other users get owner block +$owner = elgg_get_page_owner_entity(); +if ($owner instanceof ElggGroup || + ($owner instanceof ElggUser && $owner->getGUID() != elgg_get_logged_in_user_guid())) { + + $header = elgg_view_entity($owner, array('full_view' => false)); + + $body = elgg_view_menu('owner_block', array('entity' => $owner)); + + $body .= elgg_view('page/elements/owner_block/extend', $vars); + + echo elgg_view('page/components/module', array( + 'header' => $header, + 'body' => $body, + 'class' => 'elgg-owner-block', + )); +} + +elgg_pop_context();
\ No newline at end of file diff --git a/views/default/page/elements/shortcut_icon.php b/views/default/page/elements/shortcut_icon.php new file mode 100644 index 000000000..12fe9c1f8 --- /dev/null +++ b/views/default/page/elements/shortcut_icon.php @@ -0,0 +1,6 @@ +<?php +/** + * Displays the default shortcut icon + */ +?> +<link rel="SHORTCUT ICON" href="<?php echo elgg_get_site_url(); ?>_graphics/favicon.ico" />
\ No newline at end of file diff --git a/views/default/page_elements/sidebar.php b/views/default/page/elements/sidebar.php index 8a5574da6..fe6bb450e 100644 --- a/views/default/page_elements/sidebar.php +++ b/views/default/page/elements/sidebar.php @@ -3,11 +3,16 @@ * Elgg sidebar contents * * @uses $vars['sidebar'] Optional content that is displayed at the bottom of sidebar - **/ + */ -echo elgg_view('page_elements/owner_block'); +echo elgg_view_menu('extras', array( + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', +)); -echo elgg_view('navigation/sidebar_menu'); +echo elgg_view('page/elements/owner_block', $vars); + +echo elgg_view_menu('page', array('sort_by' => 'name')); // optional 'sidebar' parameter if (isset($vars['sidebar'])) { diff --git a/views/default/page/elements/sidebar_alt.php b/views/default/page/elements/sidebar_alt.php new file mode 100644 index 000000000..6d91ca58b --- /dev/null +++ b/views/default/page/elements/sidebar_alt.php @@ -0,0 +1,12 @@ +<?php +/** + * Elgg secondary sidebar contents + * + * You can override, extend, or pass content to it + * + * @uses $vars['sidebar_alt] HTML content for the alternate sidebar + */ + +$sidebar = elgg_extract('sidebar_alt', $vars, ''); + +echo $sidebar; diff --git a/views/default/page/elements/tagcloud_block.php b/views/default/page/elements/tagcloud_block.php new file mode 100644 index 000000000..258951c41 --- /dev/null +++ b/views/default/page/elements/tagcloud_block.php @@ -0,0 +1,58 @@ +<?php +/** + * Display content-based tags + * + * Generally used in a sidebar. Does not work with groups currently. + * + * @uses $vars['subtypes'] Object subtype string or array of subtypes + * @uses $vars['owner_guid'] The owner of the content being tagged + * @uses $vars['limit'] The maxinum number of tags to display + */ + +$owner_guid = elgg_extract('owner_guid', $vars, ELGG_ENTITIES_ANY_VALUE); +if (!$owner_guid) { + $owner_guid = ELGG_ENTITIES_ANY_VALUE; +} + +$owner_entity = get_entity($owner_guid); +if ($owner_entity && elgg_instanceof($owner_entity, 'group')) { + // not supporting groups so return + return true; +} + +$options = array( + 'type' => 'object', + 'subtype' => elgg_extract('subtypes', $vars, ELGG_ENTITIES_ANY_VALUE), + 'owner_guid' => $owner_guid, + 'threshold' => 0, + 'limit' => elgg_extract('limit', $vars, 50), + 'tag_name' => 'tags', +); + +$title = elgg_echo('tagcloud'); +if (is_array($options['subtype']) && count($options['subtype']) > 1) { + // we cannot provide links to tagged objects with multiple types + $tag_data = elgg_get_tags($options); + $cloud = elgg_view("output/tagcloud", array( + 'value' => $tag_data, + 'type' => $type, + )); +} else { + $cloud = elgg_view_tagcloud($options); +} +if (!$cloud) { + return true; +} + +// add a link to all site tags +$cloud .= '<p class="small">'; +$cloud .= elgg_view_icon('tag'); +$cloud .= elgg_view('output/url', array( + 'href' => 'tags', + 'text' => elgg_echo('tagcloud:allsitetags'), + 'is_trusted' => true, +)); +$cloud .= '</p>'; + + +echo elgg_view_module('aside', $title, $cloud); diff --git a/views/default/page/elements/title.php b/views/default/page/elements/title.php new file mode 100644 index 000000000..19f47f4e6 --- /dev/null +++ b/views/default/page/elements/title.php @@ -0,0 +1,14 @@ +<?php +/** + * Elgg title element + * + * @uses $vars['title'] The page title + * @uses $vars['class'] Optional class for heading + */ + +$class= ''; +if (isset($vars['class'])) { + $class = " class=\"{$vars['class']}\""; +} + +echo "<h2{$class}>{$vars['title']}</h2>"; diff --git a/views/default/page/elements/topbar.php b/views/default/page/elements/topbar.php new file mode 100644 index 000000000..e4c6c86bb --- /dev/null +++ b/views/default/page/elements/topbar.php @@ -0,0 +1,16 @@ +<?php +/** + * Elgg topbar + * The standard elgg top toolbar + */ + +// Elgg logo +echo elgg_view_menu('topbar', array('sort_by' => 'priority', array('elgg-menu-hz'))); + +// elgg tools menu +// need to echo this empty view for backward compatibility. +$content = elgg_view("navigation/topbar_tools"); +if ($content) { + elgg_deprecated_notice('navigation/topbar_tools was deprecated. Extend the topbar menus or the page/elements/topbar view directly', 1.8); + echo $content; +} diff --git a/views/default/page/elements/wrapper.php b/views/default/page/elements/wrapper.php new file mode 100644 index 000000000..61828832d --- /dev/null +++ b/views/default/page/elements/wrapper.php @@ -0,0 +1,22 @@ +<?php +/** + * Deprecated content wrapper view from Elgg 1.5 through 1.7 + * + * @uses $vars['body'] The content to display inside content wrapper + * @uses $vars['subclass'] Additional css class + */ + +elgg_deprecated_notice("The 'page_elements/contentwrapper' has been deprecated", 1.8); +?> + +<div class="contentWrapper<?php + + if (isset($vars['subclass'])) { + echo ' ' . $vars['subclass']; + } + +?>"> +<?php + echo $vars['body']; +?> +</div> diff --git a/views/default/page/error.php b/views/default/page/error.php new file mode 100644 index 000000000..b7ba3ae9b --- /dev/null +++ b/views/default/page/error.php @@ -0,0 +1,14 @@ +<?php +/** + * Page shell for errors + * + * This is for errors that are not unhandled exceptions. Those are handled + * through the failsafe viewtype to guarantee that no further exceptions occur. + * An example error would be 404 (page not found). + * + * @uses $vars['title'] The page title + * @uses $vars['body'] The main content of the page + * @uses $vars['sysmessages'] A 2d array of various message registers, passed from system_messages() + */ + +echo elgg_view('page/default', $vars); diff --git a/views/default/page/layouts/admin.php b/views/default/page/layouts/admin.php new file mode 100644 index 000000000..8dbdc27e6 --- /dev/null +++ b/views/default/page/layouts/admin.php @@ -0,0 +1,40 @@ +<?php +/** + * Elgg Admin Area Canvas + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['content'] Content string + * @uses $vars['sidebar'] Optional sidebar content + * @uses $vars['title'] Title string + */ + +?> + +<div class="elgg-layout elgg-layout-one-sidebar"> + <div class="elgg-sidebar clearfix"> + <?php + echo elgg_view('admin/sidebar', $vars); + ?> + </div> + <div class="elgg-main elgg-body"> + <div class="elgg-head"> + <?php + echo elgg_view_menu('title', array( + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', + )); + + if (isset($vars['title'])) { + echo elgg_view_title($vars['title']); + } + ?> + </div> + <?php + if (isset($vars['content'])) { + echo $vars['content']; + } + ?> + </div> +</div>
\ No newline at end of file diff --git a/views/default/layout/shells/content.php b/views/default/page/layouts/content.php index b46f09ac1..c406c9faf 100644 --- a/views/default/layout/shells/content.php +++ b/views/default/page/layouts/content.php @@ -10,44 +10,44 @@ * @uses $vars['filter'] HTML of the content area filter (override) * @uses $vars['title'] Title text (override) * @uses $vars['context'] Page context (override) - * @uses $vars['buttons'] Content header buttons (override) * @uses $vars['filter_context'] Filter context: everyone, friends, mine + * @uses $vars['class'] Additional class to apply to layout */ // give plugins an opportunity to add to content sidebars -$sidebar_content = elgg_get_array_value('sidebar', $vars, ''); +$sidebar_content = elgg_extract('sidebar', $vars, ''); $params = $vars; $params['content'] = $sidebar_content; -$sidebar = elgg_view('layout/shells/content/sidebar', $params); - -// navigation defaults to breadcrumbs -$nav = elgg_get_array_value('nav', $vars, elgg_view('navigation/breadcrumbs')); +$sidebar = elgg_view('page/layouts/content/sidebar', $params); // allow page handlers to override the default header if (isset($vars['header'])) { $vars['header_override'] = $vars['header']; } -$header = elgg_view('layout/shells/content/header', $vars); +$header = elgg_view('page/layouts/content/header', $vars); // allow page handlers to override the default filter if (isset($vars['filter'])) { $vars['filter_override'] = $vars['filter']; } -$filter = elgg_view('layout/shells/content/filter', $vars); +$filter = elgg_view('page/layouts/content/filter', $vars); // the all important content -$content = elgg_get_array_value('content', $vars, ''); +$content = elgg_extract('content', $vars, ''); // optional footer for main content area -$footer_content = elgg_get_array_value('footer', $vars, ''); +$footer_content = elgg_extract('footer', $vars, ''); $params = $vars; $params['content'] = $footer_content; -$footer = elgg_view('layout/shells/content/footer', $params); +$footer = elgg_view('page/layouts/content/footer', $params); -$body = $nav . $header . $filter . $content . $footer; +$body = $header . $filter . $content . $footer; $params = array( - 'body' => $body, + 'content' => $body, 'sidebar' => $sidebar, ); +if (isset($vars['class'])) { + $params['class'] = $vars['class']; +} echo elgg_view_layout('one_sidebar', $params); diff --git a/views/default/page/layouts/content/filter.php b/views/default/page/layouts/content/filter.php new file mode 100644 index 000000000..701c6418a --- /dev/null +++ b/views/default/page/layouts/content/filter.php @@ -0,0 +1,52 @@ +<?php +/** + * Main content filter + * + * Select between user, friends, and all content + * + * @uses $vars['filter_context'] Filter context: all, friends, mine + * @uses $vars['filter_override'] HTML for overriding the default filter (override) + * @uses $vars['context'] Page context (override) + */ + +if (isset($vars['filter_override'])) { + echo $vars['filter_override']; + return true; +} + +$context = elgg_extract('context', $vars, elgg_get_context()); + +if (elgg_is_logged_in() && $context) { + $username = elgg_get_logged_in_user_entity()->username; + $filter_context = elgg_extract('filter_context', $vars, 'all'); + + // generate a list of default tabs + $tabs = array( + 'all' => array( + 'text' => elgg_echo('all'), + 'href' => (isset($vars['all_link'])) ? $vars['all_link'] : "$context/all", + 'selected' => ($filter_context == 'all'), + 'priority' => 200, + ), + 'mine' => array( + 'text' => elgg_echo('mine'), + 'href' => (isset($vars['mine_link'])) ? $vars['mine_link'] : "$context/owner/$username", + 'selected' => ($filter_context == 'mine'), + 'priority' => 300, + ), + 'friend' => array( + 'text' => elgg_echo('friends'), + 'href' => (isset($vars['friend_link'])) ? $vars['friend_link'] : "$context/friends/$username", + 'selected' => ($filter_context == 'friends'), + 'priority' => 400, + ), + ); + + foreach ($tabs as $name => $tab) { + $tab['name'] = $name; + + elgg_register_menu_item('filter', $tab); + } + + echo elgg_view_menu('filter', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz')); +} diff --git a/views/default/layout/shells/content/footer.php b/views/default/page/layouts/content/footer.php index 66f5d3ff8..66f5d3ff8 100644 --- a/views/default/layout/shells/content/footer.php +++ b/views/default/page/layouts/content/footer.php diff --git a/views/default/page/layouts/content/header.php b/views/default/page/layouts/content/header.php new file mode 100644 index 000000000..1e66e52db --- /dev/null +++ b/views/default/page/layouts/content/header.php @@ -0,0 +1,43 @@ +<?php +/** + * Main content header + * + * Title and title menu + * + * @uses $vars['header_override'] HTML for overriding the default header (override) + * @uses $vars['title'] Title text (override) + * @uses $vars['context'] Page context (override) + */ + +if (isset($vars['buttons'])) { + // it was a bad idea to implement buttons with a pass through + elgg_deprecated_notice("Use elgg_register_menu_item() to register for the title menu", 1.0); +} + +if (isset($vars['header_override'])) { + echo $vars['header_override']; + return true; +} + +$context = elgg_extract('context', $vars, elgg_get_context()); + +$title = elgg_extract('title', $vars, ''); +if (!$title) { + $title = elgg_echo($context); +} +$title = elgg_view_title($title, array('class' => 'elgg-heading-main')); + +if (isset($vars['buttons']) && $vars['buttons']) { + $buttons = $vars['buttons']; +} else { + $buttons = elgg_view_menu('title', array( + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', + )); +} + +echo <<<HTML +<div class="elgg-head clearfix"> + $title$buttons +</div> +HTML; diff --git a/views/default/layout/shells/content/sidebar.php b/views/default/page/layouts/content/sidebar.php index 86ca8435f..86ca8435f 100644 --- a/views/default/layout/shells/content/sidebar.php +++ b/views/default/page/layouts/content/sidebar.php diff --git a/views/default/layout/shells/default.php b/views/default/page/layouts/default.php index 60dc90b0d..60dc90b0d 100644 --- a/views/default/layout/shells/default.php +++ b/views/default/page/layouts/default.php diff --git a/views/default/page/layouts/error.php b/views/default/page/layouts/error.php new file mode 100644 index 000000000..cdce28a8e --- /dev/null +++ b/views/default/page/layouts/error.php @@ -0,0 +1,12 @@ +<?php +/** + * Error layout + */ + +$class = 'elgg-layout-error'; +if (isset($vars['class'])) { + $class = "$class {$vars['class']}"; +} +$vars['class'] = $class; + +echo elgg_view('page/layouts/one_column', $vars); diff --git a/views/default/page/layouts/one_column.php b/views/default/page/layouts/one_column.php new file mode 100644 index 000000000..491d5b459 --- /dev/null +++ b/views/default/page/layouts/one_column.php @@ -0,0 +1,38 @@ +<?php +/** + * Elgg one-column layout + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['content'] Content string + * @uses $vars['class'] Additional class to apply to layout + */ + +$class = 'elgg-layout elgg-layout-one-column clearfix'; +if (isset($vars['class'])) { + $class = "$class {$vars['class']}"; +} + +// navigation defaults to breadcrumbs +$nav = elgg_extract('nav', $vars, elgg_view('navigation/breadcrumbs')); + +?> +<div class="<?php echo $class; ?>"> + <div class="elgg-body elgg-main"> + <?php + echo $nav; + + if (isset($vars['title'])) { + echo elgg_view_title($vars['title']); + } + + echo $vars['content']; + + // @deprecated 1.8 + if (isset($vars['area1'])) { + echo $vars['area1']; + } + ?> + </div> +</div>
\ No newline at end of file diff --git a/views/default/page/layouts/one_sidebar.php b/views/default/page/layouts/one_sidebar.php new file mode 100644 index 000000000..d74dad53d --- /dev/null +++ b/views/default/page/layouts/one_sidebar.php @@ -0,0 +1,48 @@ +<?php +/** + * Layout for main column with one sidebar + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['content'] Content HTML for the main column + * @uses $vars['sidebar'] Optional content that is displayed in the sidebar + * @uses $vars['title'] Optional title for main content area + * @uses $vars['class'] Additional class to apply to layout + * @uses $vars['nav'] HTML of the page nav (override) (default: breadcrumbs) + */ + +$class = 'elgg-layout elgg-layout-one-sidebar clearfix'; +if (isset($vars['class'])) { + $class = "$class {$vars['class']}"; +} + +// navigation defaults to breadcrumbs +$nav = elgg_extract('nav', $vars, elgg_view('navigation/breadcrumbs')); + +?> + +<div class="<?php echo $class; ?>"> + <div class="elgg-sidebar"> + <?php + echo elgg_view('page/elements/sidebar', $vars); + ?> + </div> + + <div class="elgg-main elgg-body"> + <?php + echo $nav; + + if (isset($vars['title'])) { + echo elgg_view_title($vars['title']); + } + // @todo deprecated so remove in Elgg 2.0 + if (isset($vars['area1'])) { + echo $vars['area1']; + } + if (isset($vars['content'])) { + echo $vars['content']; + } + ?> + </div> +</div> diff --git a/views/default/page/layouts/two_column_left_sidebar.php b/views/default/page/layouts/two_column_left_sidebar.php new file mode 100644 index 000000000..e395a5053 --- /dev/null +++ b/views/default/page/layouts/two_column_left_sidebar.php @@ -0,0 +1,26 @@ +<?php +/** + * Deprecated layout from 1.0-1.7 + * + * Use one_sidebar instead + */ + +if (!isset($vars['content'])) { + $vars['content'] = $vars['area2']; +} +if (!isset($vars['content'])) { + $vars['sidebar'] = $vars['area1'] . $vars['area3']; +} + +unset($vars['area1']); +unset($vars['area2']); +unset($vars['area3']); + +// backward compatability support for plugins that are not using the new approach +// of routing through 'admin' +if (elgg_get_context() == 'admin') { + echo elgg_view('page/layouts/admin', $vars); + return true; +} + +echo elgg_view('page/layouts/one_sidebar', $vars); diff --git a/views/default/page/layouts/two_sidebar.php b/views/default/page/layouts/two_sidebar.php new file mode 100644 index 000000000..7521dd44f --- /dev/null +++ b/views/default/page/layouts/two_sidebar.php @@ -0,0 +1,43 @@ +<?php +/** + * Elgg 2 sidebar layout + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['content'] The content string for the main column + * @uses $vars['sidebar'] Optional content that is displayed in the sidebar + * @uses $vars['sidebar_alt'] Optional content that is displayed in the alternate sidebar + * @uses $vars['class'] Additional class to apply to layout + */ + +$class = 'elgg-layout elgg-layout-two-sidebar clearfix'; +if (isset($vars['class'])) { + $class = "$class {$vars['class']}"; +} +?> + +<div class="<?php echo $class; ?>"> + <div class="elgg-sidebar"> + <?php + echo elgg_view('page/elements/sidebar', $vars); + ?> + </div> + <div class="elgg-sidebar-alt"> + <?php + echo elgg_view('page/elements/sidebar_alt', $vars); + ?> + </div> + + <div class="elgg-main elgg-body"> + <?php + // @todo deprecated so remove in Elgg 2.0 + if (isset($vars['area1'])) { + echo $vars['area1']; + } + if (isset($vars['content'])) { + echo $vars['content']; + } + ?> + </div> +</div> diff --git a/views/default/page/layouts/walled_garden.php b/views/default/page/layouts/walled_garden.php new file mode 100644 index 000000000..6ecd941ef --- /dev/null +++ b/views/default/page/layouts/walled_garden.php @@ -0,0 +1,16 @@ +<?php +/** + * Walled Garden layout + * + * @uses $vars['content'] Main content + * @uses $vars['class'] CSS classes + * @uses $vars['id'] CSS id + */ + +$class = elgg_extract('class', $vars, 'elgg-walledgarden-single'); +echo elgg_view_module('walledgarden', '', $vars['content'], array( + 'class' => $class, + 'id' => elgg_extract('id', $vars, ''), + 'header' => ' ', + 'footer' => ' ', +)); diff --git a/views/default/page/layouts/widgets.php b/views/default/page/layouts/widgets.php new file mode 100644 index 000000000..c6b162516 --- /dev/null +++ b/views/default/page/layouts/widgets.php @@ -0,0 +1,62 @@ +<?php +/** + * Elgg widgets layout + * + * @uses $vars['content'] Optional display box at the top of layout + * @uses $vars['num_columns'] Number of widget columns for this layout (3) + * @uses $vars['show_add_widgets'] Display the add widgets button and panel (true) + * @uses $vars['exact_match'] Widgets must match the current context (false) + * @uses $vars['show_access'] Show the access control (true) + */ + +$num_columns = elgg_extract('num_columns', $vars, 3); +$show_add_widgets = elgg_extract('show_add_widgets', $vars, true); +$exact_match = elgg_extract('exact_match', $vars, false); +$show_access = elgg_extract('show_access', $vars, true); + +$owner = elgg_get_page_owner_entity(); + +$widget_types = elgg_get_widget_types(); + +$context = elgg_get_context(); +elgg_push_context('widgets'); + +$widgets = elgg_get_widgets($owner->guid, $context); + +if (elgg_can_edit_widget_layout($context)) { + if ($show_add_widgets) { + echo elgg_view('page/layouts/widgets/add_button'); + } + $params = array( + 'widgets' => $widgets, + 'context' => $context, + 'exact_match' => $exact_match, + 'show_access' => $show_access, + ); + echo elgg_view('page/layouts/widgets/add_panel', $params); +} + +echo $vars['content']; + +$widget_class = "elgg-col-1of{$num_columns}"; +for ($column_index = 1; $column_index <= $num_columns; $column_index++) { + if (isset($widgets[$column_index])) { + $column_widgets = $widgets[$column_index]; + } else { + $column_widgets = array(); + } + + echo "<div class=\"$widget_class elgg-widgets\" id=\"elgg-widget-col-$column_index\">"; + if (sizeof($column_widgets) > 0) { + foreach ($column_widgets as $widget) { + if (array_key_exists($widget->handler, $widget_types)) { + echo elgg_view_entity($widget, array('show_access' => $show_access)); + } + } + } + echo '</div>'; +} + +elgg_pop_context(); + +echo elgg_view('graphics/ajax_loader', array('id' => 'elgg-widget-loader')); diff --git a/views/default/page/layouts/widgets/add_button.php b/views/default/page/layouts/widgets/add_button.php new file mode 100644 index 000000000..c33a45f99 --- /dev/null +++ b/views/default/page/layouts/widgets/add_button.php @@ -0,0 +1,16 @@ +<?php +/** + * Button area for showing the add widgets panel + */ +?> +<div class="elgg-widget-add-control"> +<?php + echo elgg_view('output/url', array( + 'href' => '#widgets-add-panel', + 'text' => elgg_echo('widgets:add'), + 'class' => 'elgg-button elgg-button-action', + 'rel' => 'toggle', + 'is_trusted' => true, + )); +?> +</div> diff --git a/views/default/page/layouts/widgets/add_panel.php b/views/default/page/layouts/widgets/add_panel.php new file mode 100644 index 000000000..d9b11342a --- /dev/null +++ b/views/default/page/layouts/widgets/add_panel.php @@ -0,0 +1,62 @@ +<?php +/** + * Widget add panel + * + * @uses $vars['widgets'] Array of current widgets + * @uses $vars['context'] The context for this widget layout + * @uses $vars['exact_match'] Only use widgets that match the context + */ + +$widgets = $vars['widgets']; +$context = $vars['context']; +$exact = elgg_extract('exact_match', $vars, false); + +$widget_types = elgg_get_widget_types($context, $exact); +uasort($widget_types, create_function('$a,$b', 'return strcmp($a->name,$b->name);')); + +$current_handlers = array(); +foreach ($widgets as $column_widgets) { + foreach ($column_widgets as $widget) { + $current_handlers[] = $widget->handler; + } +} + +?> +<div class="elgg-widgets-add-panel hidden clearfix" id="widgets-add-panel"> + <p> + <?php echo elgg_echo('widgets:add:description'); ?> + </p> + <ul> +<?php + foreach ($widget_types as $handler => $widget_type) { + $id = "elgg-widget-type-$handler"; + // check if widget added and only one instance allowed + if ($widget_type->multiple == false && in_array($handler, $current_handlers)) { + $class = 'elgg-state-unavailable'; + $tooltip = elgg_echo('widget:unavailable'); + } else { + $class = 'elgg-state-available'; + $tooltip = $widget_type->description; + } + + if ($widget_type->multiple) { + $class .= ' elgg-widget-multiple'; + } else { + $class .= ' elgg-widget-single'; + } + + echo "<li title=\"$tooltip\" id=\"$id\" class=\"$class\">$widget_type->name</li>"; + } +?> + </ul> +<?php + echo elgg_view('input/hidden', array( + 'name' => 'widget_context', + 'value' => $context + )); + echo elgg_view('input/hidden', array( + 'name' => 'show_access', + 'value' => (int)$vars['show_access'] + )); +?> +</div> diff --git a/views/default/page/upgrade.php b/views/default/page/upgrade.php new file mode 100644 index 000000000..1a92042be --- /dev/null +++ b/views/default/page/upgrade.php @@ -0,0 +1,18 @@ +<?php +/** + * Page shell for upgrade script + * + * Displays an ajax loader until upgrade is complete + */ +?> +<html> + <head> + <?php echo elgg_view('page/elements/head', $vars); ?> + <meta http-equiv="refresh" content="1;url=<?php echo elgg_get_site_url(); ?>upgrade.php?upgrade=upgrade"/> + </head> + <body> + <div style="margin-top:200px"> + <?php echo elgg_view('graphics/ajax_loader', array('hidden' => false)); ?> + </div> + </body> +</html>
\ No newline at end of file diff --git a/views/default/page/walled_garden.php b/views/default/page/walled_garden.php new file mode 100644 index 000000000..b280cf6b2 --- /dev/null +++ b/views/default/page/walled_garden.php @@ -0,0 +1,40 @@ +<?php +/** + * Walled garden page shell + * + * Used for the walled garden index page + */ + +$is_sticky_register = elgg_is_sticky_form('register'); +$wg_body_class = 'elgg-body-walledgarden'; +if ($is_sticky_register) { + $wg_body_class .= ' hidden'; +} + +// Set the content type +header("Content-type: text/html; charset=UTF-8"); +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<?php echo elgg_view('page/elements/head', $vars); ?> +</head> +<body> +<div class="elgg-page elgg-page-walledgarden"> + <div class="elgg-page-messages"> + <?php echo elgg_view('page/elements/messages', array('object' => $vars['sysmessages'])); ?> + </div> + <div class="<?php echo $wg_body_class; ?>"> + <?php echo $vars['body']; ?> + </div> +</div> +<?php if ($is_sticky_register): ?> +<script type="text/javascript"> +elgg.register_hook_handler('init', 'system', function() { + $('.registration_link').trigger('click'); +}); +</script> +<?php endif; ?> +<?php echo elgg_view('page/elements/foot'); ?> +</body> +</html>
\ No newline at end of file diff --git a/views/default/page_elements/body.php b/views/default/page_elements/body.php deleted file mode 100644 index 6f7691693..000000000 --- a/views/default/page_elements/body.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -/** - * Elgg page body wrapper - * - * @uses $vars['body'] The HTML of the page body - */ - -$body = elgg_get_array_value('body', $vars, ''); - -echo <<<HTML -<div class="elgg-page-body"> - $body -</div> -HTML; diff --git a/views/default/page_elements/content.php b/views/default/page_elements/content.php deleted file mode 100644 index f82720c2f..000000000 --- a/views/default/page_elements/content.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -/** - * Elgg content wrapper - * - * @uses $vars['body'] The main content HTML - */ - -$body = elgg_get_array_value('body', $vars, ''); - -echo <<<HTML -<div class="elgg-page-body"> - $body -</div> -HTML; diff --git a/views/default/page_elements/content_header.php b/views/default/page_elements/content_header.php deleted file mode 100644 index 8809ad8b7..000000000 --- a/views/default/page_elements/content_header.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/** - * Displays the Add New button, and the All, Mine, My Friends tabs for plugins - * If a user is not logged in, this only displays the All tab. - * If this is in a group context, it doesn't display any tabs - * - * @uses string $vars['type'] The section type. Should be the same as the page handler. Used for generating URLs. - * @uses string $vars['context'] Which filter we're looking at: all, mine, friends, or action. Nothing to do with get_context(). - * - * @uses string $vars['all_link'] Optional. The URL to use for the "All" tab link. Defaults to mod/$type/all.php - * @uses string $vars['mine_link'] Optional. The URL to use for the "Mine" tab link. Defaults to pg/$type/$username - * @uses string $vars['friends_link'] Optional. The URL to use for the "Friends" tab link. Defaults to pg/$type/$username/friends - * @uses string $vars['new_link'] Optional. The URL to use for the "New" button. Defaults to pg/$type/$username/new - * @uses array $vars['tabs'] Optional. Override all tab generation. See view:navgiation/tabs for formatting - * - * @package Elgg - * @subpackage Core - */ - -$page_owner = elgg_get_page_owner(); -$logged_in_user = get_loggedin_user(); -$username = $logged_in_user->username; - -if (!$page_owner) { - $page_owner = $logged_in_user; -} - -// so we know if the user is looking at their own, everyone's or all friends -$filter_context = $vars['context']; - -// get the object type -$type = $vars['type']; - -// create an empty string to start with -$new_button = ''; - -// generate a list of default tabs -$default_tabs = array( - 'all' => array( - 'title' => elgg_echo('all'), - 'url' => (isset($vars['all_link'])) ? $vars['all_link'] : "mod/$type/all.php", - 'selected' => ($filter_context == 'everyone'), - ), - 'mine' => array( - 'title' => elgg_echo('mine'), - 'url' => (isset($vars['mine_link'])) ? $vars['mine_link'] : "pg/$type/$username", - 'selected' => ($filter_context == 'mine'), - ), - 'friend' => array( - 'title' => elgg_echo('friends'), - 'url' => (isset($vars['friend_link'])) ? $vars['friend_link'] : "pg/$type/$username/friends", - 'selected' => ($filter_context == 'friends'), - ), -); - -// determine if using default or overwritten tabs -$tabs = (isset($vars['tabs'])) ? $vars['tabs'] : $default_tabs; -$tab_list = elgg_view('navigation/tabs', array('tabs' => $tabs)); - -$title = elgg_echo($type); -$title = '<div class="content-header-title">' . elgg_view_title($title) . '</div>'; - -// must be logged in to see any action buttons -if (isloggedin()) { - // only show the new button when not on the add form. - // hide the tabs when on the add form. - if ($filter_context == 'action') { - $tab_list = ''; - } else { - // @todo remove the hard coded reference to the videolist plugin - if (elgg_get_context() == "videolist"){ - $video_link = elgg_get_site_url() . "pg/videolist/browse/$username/"; - $new_button = "<a href=\"{$video_link}\" class='action-button'>" . elgg_echo('videolist:browsemenu') . '</a>'; - } else { - $new_link = elgg_normalize_url((isset($vars['new_link'])) ? $vars['new_link'] : "pg/$type/$username/new"); - $new_button = "<a href=\"{$new_link}\" class='action-button'>" . elgg_echo($type . ':new') . '</a>'; - } - $new_button = "<div class='content-header-options'>$new_button</div>"; - } - - // also hide the tabs if in a group context (ie, listing groups) or - // when viewing tools belonging to a group - if (elgg_get_context() == 'groups' || $page_owner instanceof ElggGroup) { - $tab_list = ''; - } -} - -echo <<<HTML -<div id="content-header" class="clearfix"> - $title $new_button -</div> -HTML; - -echo $tab_list; diff --git a/views/default/page_elements/content_header_member.php b/views/default/page_elements/content_header_member.php deleted file mode 100644 index 4cfee9258..000000000 --- a/views/default/page_elements/content_header_member.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php
-/**
- * When looking at a users blog, bookmarks, video etc only show
- * the users name and the tool you are viewing
- *
- * @package Elgg
- * @subpackage Core
- *
- */
-
-$page_owner = elgg_get_page_owner();
-$name = elgg_get_page_owner()->name;
-
-// get the object type
-$type = $vars['type'];
-
-$title = elgg_echo($type);
-$title = $name . "'s " . $type;
-?>
-
-<div id="content-header" class="clearfix">
- <?php echo '<div class="content-header-title">' . elgg_view_title($title) . '</div>'; ?>
-</div>
-
diff --git a/views/default/page_elements/footer.php b/views/default/page_elements/footer.php deleted file mode 100644 index 6c9cdc55e..000000000 --- a/views/default/page_elements/footer.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -/** - * Elgg footer - * The standard HTML footer that displays across the site - * - * @package Elgg - * @subpackage Core - * - */ - -?> -<div class="elgg-page-footer"> - <div class="elgg-page-footer-inner elgg-center elgg-width-classic clearfix"> - <?php echo elgg_view('footer/links'); ?> - <a href="http://www.elgg.org" class="right"> - <img src="<?php echo elgg_get_site_url(); ?>_graphics/powered_by_elgg_badge_drk_bckgnd.gif" alt="Powered by Elgg" /> - </a> - </div> -</div> - -<?php echo elgg_view('footer/analytics'); ?> diff --git a/views/default/page_elements/header.php b/views/default/page_elements/header.php deleted file mode 100644 index df23fcbff..000000000 --- a/views/default/page_elements/header.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * Elgg header contents - * This file holds the header output that a user will see - **/ - -?> -<div class="elgg-page-header"> - <div class="elgg-page-header-inner elgg-center elgg-width-classic"> - <?php - // link back to main site. - echo elgg_view('page_elements/header_logo', $vars); - - // drop-down login - echo elgg_view('account/login-dropdown'); - - // insert site-wide navigation - echo elgg_view('navigation/site_nav'); - - // insert a view which can be extended - echo elgg_view('header/extend'); - ?> - </div> -</div> diff --git a/views/default/page_elements/header_logo.php b/views/default/page_elements/header_logo.php deleted file mode 100644 index 6ae6a0fab..000000000 --- a/views/default/page_elements/header_logo.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php -/** - * Elgg header logo - * The logo to display in elgg-header. - */ -?> - -<h1> - <a href="<?php echo elgg_get_site_url(); ?>"> - <span class='network-title'><?php echo $vars['config']->sitename; ?></span> - </a> -</h1> diff --git a/views/default/page_elements/html_begin.php b/views/default/page_elements/html_begin.php deleted file mode 100644 index 23879dde8..000000000 --- a/views/default/page_elements/html_begin.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php -/** - * Start html output. - * The standard HTML header that displays across the site - * - * @uses $vars['config'] The site configuration settings, imported - * @uses $vars['title'] The page title - * @uses $vars['body'] The main content of the page - */ - -// Set title -if (empty($vars['title'])) { - $title = $vars['config']->sitename; -} else if (empty($vars['config']->sitename)) { - $title = $vars['title']; -} else { - $title = $vars['config']->sitename . ": " . $vars['title']; -} - -global $autofeed; -if (isset($autofeed) && $autofeed == true) { - $url = full_url(); - if (substr_count($url,'?')) { - $url .= "&view=rss"; - } else { - $url .= "?view=rss"; - } - $url = elgg_format_url($url); - $feedref = <<<END - - <link rel="alternate" type="application/rss+xml" title="RSS" href="{$url}" /> - -END; -} else { - $feedref = ""; -} - -$js = elgg_get_js('head'); -$css = elgg_get_css(); - -// we won't trust server configuration but specify utf-8 -header('Content-type: text/html; charset=utf-8'); - -$version = get_version(); -$release = get_version(true); -?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <meta name="ElggRelease" content="<?php echo $release; ?>" /> - <meta name="ElggVersion" content="<?php echo $version; ?>" /> - <title><?php echo $title; ?></title> - <link rel="SHORTCUT ICON" href="<?php echo elgg_get_site_url(); ?>_graphics/favicon.ico" /> - -<?php -foreach ($js as $script) { -?> - <script type="text/javascript" src="<?php echo $script; ?>"></script> -<?php -} - -foreach ($css as $link) { -?> - <link rel="stylesheet" href="<?php echo $link; ?>" type="text/css" /> -<?php -} - -$ie_url = elgg_view_get_simplecache_url('css', 'ie'); -$ie6_url = elgg_view_get_simplecache_url('css', 'ie6'); -?> - <!--[if IE 6]> - <link rel="stylesheet" type="text/css" href="<?php echo $ie_url; ?>" /> - <![endif]--> - - <!--[if gt IE 6]> - <link rel="stylesheet" type="text/css" href="<?php echo $ie6_url; ?>" /> - <![endif]--> -<?php - -echo elgg_view('scripts/initialize_elgg'); -echo $feedref; - -$metatags = elgg_view('metatags', $vars); -if ($metatags) { - elgg_deprecated_notice("The metatags view has been deprecated for html_head/extend", 1.8); - echo $metatags; -} -echo elgg_view('html_head/extend', $vars); -?> -</head> - -<body> diff --git a/views/default/page_elements/html_end.php b/views/default/page_elements/html_end.php deleted file mode 100644 index 0862934cf..000000000 --- a/views/default/page_elements/html_end.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * Start html output. - * The standard HTML header that displays across the site - * @uses $vars['config'] The site configuration settings, imported - * @uses $vars['title'] The page title - * @uses $vars['body'] The main content of the page - */ -?> -</body> -</html> diff --git a/views/default/page_elements/owner_block.php b/views/default/page_elements/owner_block.php deleted file mode 100644 index 66fc180dd..000000000 --- a/views/default/page_elements/owner_block.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -/** - * Elgg owner block - * Displays page ownership information - * - * @package Elgg - * @subpackage Core - * - */ - -$contents = ""; - -// Are there feeds to display? -global $autofeed; -if (isset($autofeed) && $autofeed == true) { - $url = full_url(); - if (substr_count($url,'?')) { - $url .= "&view=rss"; - } else { - $url .= "?view=rss"; - } - $url = elgg_format_url($url); - $label = elgg_echo('feed:rss'); - $contents .= <<<END - <div class="rss-link clearfix"><a href="{$url}" rel="nofollow" title="{$label}">{$label}</a></div> -END; -} - -if(is_plugin_enabled('profile')) { - // Is there a page owner? - $owner = elgg_get_page_owner(); - if ($owner instanceof ElggGroup || - ($owner instanceof ElggUser && $owner->getGUID() != get_loggedin_userid()) - ) { - $icon = elgg_view('profile/icon', array('entity' => $owner, 'size' => 'tiny')); - $owner_url = $owner->getURL(); - $display = "<div class='owner_block_icon'>$icon</div>"; - $display .= '<div class="owner_block_contents clearfix">'; - $display .= "<h3><a href=\"$owner_url\">{$owner->name}</a></h3>"; - - if ($owner->briefdescription) { - $display .= "<p class=\"profile_info briefdescription\">{$owner->briefdescription}</p>"; - } - - $location = elgg_view('output/tags', array('value' => $owner->location)); - $display .= "<p class=\"profile_info location\">$location</p>"; - - $display .= '</div>'; - - // Trigger owner block menu - $params = array('owner' => $owner); - $links = elgg_trigger_plugin_hook('profile_menu', 'profile', $params, array()); - if (is_array($links) && !empty($links)) { - // sort the links by name - usort($links, create_function( - '$a, $b', - 'return strnatcasecmp($a[\'text\'], $b[\'text\']);' - )); - - $display .= '<div class="owners_content_links"><ul>'; - foreach ($links as $link) { - $display .= "<li><a href=\"{$link['href']}\">{$link['text']}</a></li>"; - } - $display .= '</ul></div>'; - } - - // Allow plugins to extend the owner block contents - $display .= elgg_view('owner_block/profile_extend'); - - $contents .= "<div id='owner_block' class='clearfix'>$display</div>"; - } -} - -$contents .= elgg_view('owner_block/extend'); - - -echo $contents; diff --git a/views/default/page_elements/title.php b/views/default/page_elements/title.php deleted file mode 100644 index c5eeb9e0e..000000000 --- a/views/default/page_elements/title.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Elgg title element - * @uses $vars['title'] The page title - */ - -$page_owner = elgg_get_page_owner_guid(); -$page_owner_entity = get_entity($page_owner); - -$display = "<h2>" . $vars['title'] . "</h2>"; - -$submenu = elgg_get_submenu(); -if (!empty($submenu)) { - $submenu = "<ul class='submenu extended'>" . $submenu . "</ul>"; -} - -if (!empty($submenu) && $vars['submenu'] == true) { - // plugins can extend this to add menu options - $display .= $submenu; -} - -echo $display;
\ No newline at end of file diff --git a/views/default/page_elements/topbar.php b/views/default/page_elements/topbar.php deleted file mode 100644 index 83ffdf54b..000000000 --- a/views/default/page_elements/topbar.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * Elgg top toolbar - * The standard elgg top toolbar - */ - -$user = get_loggedin_user(); -if (($user instanceof ElggUser) && ($user->guid > 0)) { - echo '<div class="elgg-page-topbar">'; - echo '<div class="elgg-page-topbar-inner">'; - - // Elgg logo - echo '<a href="http://www.elgg.org">'; - echo "<img class=\"site-logo\" src=\"".elgg_get_site_url()."_graphics/elgg_toolbar_logo.gif\" alt=\"Elgg logo\" />"; - echo '</a>'; - - // avatar - $user_link = $user->getURL(); - $user_image = $user->getIcon('topbar'); - echo "<a href=\"$user_link\"><img class=\"user-mini-avatar\" src=\"$user_image\" alt=\"User avatar\" /></a>"; - - // logout link - echo elgg_view('page_elements/topbar_logout', $vars); - - // elgg tools menu - // need to echo this empty view for backward compatibility. - echo elgg_view("navigation/topbar_tools"); - - // enable elgg topbar extending - echo elgg_view('elgg_topbar/extend', $vars); - - // user settings - $settings = elgg_echo('settings'); - echo "<a href=\"".elgg_get_site_url()."pg/settings\" class=\"settings\">$settings</a>"; - - // The administration link is for admin or site admin users only - if ($user->isAdmin()) { - $admin = elgg_echo("admin"); - echo "<a href=\"".elgg_get_site_url()."pg/admin\" class=\"admin\">$admin</a>"; - } - - echo '</div>'; - echo '</div>'; -} diff --git a/views/default/page_elements/topbar_logout.php b/views/default/page_elements/topbar_logout.php deleted file mode 100644 index 2d2ecf67c..000000000 --- a/views/default/page_elements/topbar_logout.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -/** - * A standard logout link - * - * Called within the Elgg topbar view. - */ - -echo '<div class="log-out">'; -echo elgg_view('output/url', array( - 'href' => "action/logout", - 'text' => elgg_echo('logout'), - 'is_action' => TRUE -)); -echo '</div>'; diff --git a/views/default/page_shells/admin.php b/views/default/page_shells/admin.php deleted file mode 100644 index ff427a6b7..000000000 --- a/views/default/page_shells/admin.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php
-/**
- * Elgg pageshell for the admin area
- *
- * @package Elgg
- * @subpackage Core
- *
- * @uses $vars['title'] The page title
- * @uses $vars['body'] The main content of the page
- * @uses $vars['sysmessages'] A 2d array of various message registers, passed from system_messages()
- */
-
-// Set the content type
-header("Content-type: text/html; charset=UTF-8");
-
-// Set title
-$site_title = elgg_get_config('sitename');
-if (empty($vars['title'])) {
- $title = $site_title;
-} else if (empty($site_title)) {
- $title = $vars['title'];
-} else {
- $title = $site_title . ": " . $vars['title'];
-}
-
-echo elgg_view('page_elements/html_begin', $vars);
-echo elgg_view('page_elements/messages', array('object' => $vars['sysmessages']));
-echo elgg_view('page_elements/content', $vars);
-echo elgg_view('page_elements/html_end', $vars);
\ No newline at end of file diff --git a/views/default/page_shells/default.php b/views/default/page_shells/default.php deleted file mode 100644 index 3380188d9..000000000 --- a/views/default/page_shells/default.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php -/** - * Elgg pageshell - * The standard HTML page shell that everything else fits into - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['title'] The page title - * @uses $vars['body'] The main content of the page - * @uses $vars['sysmessages'] A 2d array of various message registers, passed from system_messages() - */ - -// Set the content type -header("Content-type: text/html; charset=UTF-8"); - -// Set title -$site_title = elgg_get_config('sitename'); -if (empty($vars['title'])) { - $title = $site_title; -} else if (empty($site_title)) { - $title = $vars['title']; -} else { - $title = $site_title . ": " . $vars['title']; -} - -echo elgg_view('page_elements/html_begin', $vars); - -echo '<div class="elgg-page">'; -echo elgg_view('page_elements/messages', array('object' => $vars['sysmessages'])); -echo elgg_view('page_elements/topbar', $vars); -echo elgg_view('page_elements/header', $vars); -echo elgg_view('page_elements/body', $vars); -echo elgg_view('page_elements/footer', $vars); -echo '</div>'; - -echo elgg_view('page_elements/html_end', $vars); diff --git a/views/default/page_shells/walled_garden.php b/views/default/page_shells/walled_garden.php deleted file mode 100644 index dbd8d3ac0..000000000 --- a/views/default/page_shells/walled_garden.php +++ /dev/null @@ -1,281 +0,0 @@ -<?php -/** - * - */ - -// Set the content type -header("Content-type: text/html; charset=UTF-8"); - -// Set title -$site_title = elgg_get_config('sitename'); -if (empty($vars['title'])) { - $title = $site_title; -} else if (empty($site_title)) { - $title = $vars['title']; -} else { - $title = $site_title . ": " . $vars['title']; -} - -echo elgg_view('page_elements/html_begin', $vars); -// @todo - move the css below into it's own style-sheet -// that is called when running as a private network -?> -<style type="text/css"> -body {background: white;} -/* *************************************** - WalledGarden -*************************************** */ -#walledgarden_container { - margin:100px auto 0 auto; - position:relative; - padding:0; - width:563px; - background: url(<?php echo elgg_get_site_url(); ?>_graphics/walled_garden_background_extend.gif) repeat-y left top; - text-align: left; - word-wrap:break-word; -} -#walledgarden { - position: relative; - padding:0; - width:563px; - min-height:230px; - background: url(<?php echo elgg_get_site_url(); ?>_graphics/walled_garden_background_top.gif) no-repeat left top; -} -#walledgarden_bottom { - margin:0 auto; - background: url(<?php echo elgg_get_site_url(); ?>_graphics/walled_garden_background_bottom.gif) no-repeat left bottom; - width:563px; - height:54px; - /* position: relative; */ -} -.walledgardenintro { - float:left; - min-height:200px; - width:223px; - padding:15px; - margin:19px 0 0 23px; -} -.walledgardenlogin { - float:left; - min-height:200px; - width:223px; - padding:15px 15px 0 15px; - margin:19px 0 0 11px; -} -.walledgardenintro h1 { - color:#666666; - margin-top:80px; - line-height: 1.1em; -} -.walledgardenlogin h2 { - color:#666666; - border-bottom:1px solid #CCCCCC; - margin-bottom:5px; - padding-bottom:5px; -} -.walledgardenlogin form input.login-textarea { - margin:0 0 10px 0; - width:210px; -} -.walledgardenlogin form label { - color:#666666; -} -.walledgardenlogin .remember_me label { - font-size:1em; - font-weight:normal; -} -.walledgardenlogin .remember_me { - display:block; - float:right; - margin-left:0; - margin-top:-34px; - text-align:right; - width:100%; -} -.walledgardenlogin .lost_password { - margin-bottom: 10px; - color:#999999; -} -.walledgardenlogin a.forgotten_password_link, -.walledgardenlogin a.registration_link { - color:#999999; -} - -/* override default form styles (for when a theme is running) */ -.walledgardenlogin input { - font: 120% Arial, Helvetica, sans-serif; - padding: 5px; - border: 1px solid #cccccc; - color:#666666; - background-color: white; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; -} -.walledgardenlogin textarea { - font: 120% Arial, Helvetica, sans-serif; - border: solid 1px #cccccc; - padding: 5px; - color:#666666; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; -} -.walledgardenlogin textarea:focus, -.walledgardenlogin input[type="text"]:focus { - border: solid 1px #4690d6; - background: #e4ecf5; - color:#333333; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; -} -.walledgardenlogin .input-password { - width:200px; -} -.walledgardenlogin input.input-password:focus { - border: solid 1px #4690d6; - background-color: #e4ecf5; - color:#333333; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; -} -.walledgardenlogin input[type="password"]:focus { - border: solid 1px #4690d6; - background-color: #e4ecf5; - color:#333333; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; -} -.walledgardenlogin .submit_button { - font-size: 14px; - font-weight: bold; - color: white; - text-shadow:1px 1px 0px black; - text-decoration:none; - border: 1px solid #4690d6; - background-color:#4690d6; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png); - background-repeat: repeat-x; - background-position: left 10px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - width: auto; - padding: 2px 4px; - margin:0 10px 10px 0; - cursor: pointer; - -webkit-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.40); - -moz-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.40); -} -.walledgardenlogin .submit_button:hover { - color: white; - border-color: #0054a7; - text-decoration:none; - background-color:#0054a7; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png); - background-repeat: repeat-x; - background-position: left 10px; -} -.walledgardenlogin input.action_button { - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - background-color:#cccccc; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_background.gif); - background-repeat: repeat-x; - background-position: 0 0; - border:1px solid #999999; - color:#333333; - padding:2px 15px 2px 15px; - text-align:center; - font-weight:bold; - text-decoration:none; - text-shadow:0 1px 0 white; - cursor:pointer; - -webkit-box-shadow: none; - -moz-box-shadow: none; -} -.walledgardenlogin input.action_button:hover, -.walledgardenlogin input.action_button:focus { - background-position:0 -15px; - background-image: url(<?php echo elgg_get_site_url(); ?>_graphics/button_background.gif); - background-repeat: repeat-x; - color:#111111; - text-decoration: none; - background-color:#cccccc; - border:1px solid #999999; -} -.walledgardenlogin .action_button.disabled { - color:#999999; - padding:2px 7px; -} - -/* override some elgg system message styles */ -#walledgarden_sysmessages { - position: absolute; - width:100%; - text-align: center; - margin:0 auto; - top:0; - z-index:9600; -} -#walledgarden_sysmessages #elgg-system-message { - width: 515px; - max-width: 515px; - right:auto; - margin:30px auto 0 auto; - position: relative; -} - - -#lostpassword_form, -#registration_form { - right:0; - position:absolute; - top:0; - width:260px; - background-color: white; - padding:0; - background: url(<?php echo elgg_get_site_url(); ?>_graphics/walled_garden_backgroundfull_top.gif) no-repeat left top; - height:auto; -} -#hiddenform_body { - padding:30px 40px 0 40px; - height:auto; -} -#hiddenform_bottom { - margin:0 auto; - background: url(<?php echo elgg_get_site_url(); ?>_graphics/walled_garden_backgroundfull_bottom.gif) no-repeat left bottom; - width:563px; - height:54px; - position: relative; -} - -#hiddenform_body .cancel_request { - margin-left:15px; -} - -/* override some visual_captcha styles */ -.walledgardenlogin .visual_captcha_choices { - margin:10px 0 0 0; - padding:0; - height:60px; -} -.walledgardenlogin ul.visual_captcha_choices li img { - width:50px; - height:auto; -} - -</style> - -<?php -$view = elgg_view('page_elements/messages', array('object' => $vars['sysmessages'])); - -echo "<div id='walledgarden_sysmessages' class='clearfix'>$view</div>"; -echo '<div id="walledgarden_container"><div id="walledgarden" class="clearfix">'; -echo "<div class=\"walledgardenintro clearfix\"><h1>Welcome to:<br />$title</h1></div>"; -echo "<div class=\"walledgardenlogin clearfix\">{$vars['body']}</div>"; -echo '</div>'; -echo '<div id="walledgarden_bottom"></div>'; -echo '</div>'; - -echo elgg_view('page_elements/html_end', $vars); diff --git a/views/default/profile/icon.php b/views/default/profile/icon.php new file mode 100644 index 000000000..5f06cfd54 --- /dev/null +++ b/views/default/profile/icon.php @@ -0,0 +1,17 @@ +<?php +/** + * Elgg profile icon + * + * @deprecated 1.8 use elgg_view_entity_icon() + * + * @uses $vars['entity'] The user entity. If none specified, the current user is assumed. + * @uses $vars['size'] The size - small, medium or large. If none specified, medium is assumed. + * @uses $vars['override'] + * @uses $vars['js'] + */ +elgg_deprecated_notice('The profile/icon view was deprecated. Use elgg_view_entity_icon()', 1.8); + +$override = elgg_extract('override', $vars, false); +$vars['use_hover'] = !$override; + +echo elgg_view('icon/user/default', $vars); diff --git a/views/default/river/annotation/generic_comment/create.php b/views/default/river/annotation/generic_comment/create.php new file mode 100644 index 000000000..7d586450d --- /dev/null +++ b/views/default/river/annotation/generic_comment/create.php @@ -0,0 +1,11 @@ +<?php +/** + * Post comment river view + */ +$object = $vars['item']->getObjectEntity(); +$comment = $vars['item']->getAnnotation(); + +echo elgg_view('river/elements/layout', array( + 'item' => $vars['item'], + 'message' => elgg_get_excerpt($comment->value), +)); diff --git a/views/default/river/elements/body.php b/views/default/river/elements/body.php new file mode 100644 index 000000000..2cd7f2289 --- /dev/null +++ b/views/default/river/elements/body.php @@ -0,0 +1,67 @@ +<?php +/** + * Body of river item + * + * @uses $vars['item'] ElggRiverItem + * @uses $vars['summary'] Alternate summary (the short text summary of action) + * @uses $vars['message'] Optional message (usually excerpt of text) + * @uses $vars['attachments'] Optional attachments (displaying icons or other non-text data) + * @uses $vars['responses'] Alternate respones (comments, replies, etc.) + */ + +$item = $vars['item']; + +$menu = elgg_view_menu('river', array( + 'item' => $item, + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', +)); + +// river item header +$timestamp = elgg_view_friendly_time($item->getPostedTime()); + +$summary = elgg_extract('summary', $vars, elgg_view('river/elements/summary', array('item' => $vars['item']))); +if ($summary === false) { + $subject = $item->getSubjectEntity(); + $summary = elgg_view('output/url', array( + 'href' => $subject->getURL(), + 'text' => $subject->name, + 'class' => 'elgg-river-subject', + 'is_trusted' => true, + )); +} + +$message = elgg_extract('message', $vars, false); +if ($message !== false) { + $message = "<div class=\"elgg-river-message\">$message</div>"; +} + +$attachments = elgg_extract('attachments', $vars, false); +if ($attachments !== false) { + $attachments = "<div class=\"elgg-river-attachments clearfix\">$attachments</div>"; +} + +$responses = elgg_view('river/elements/responses', $vars); +if ($responses) { + $responses = "<div class=\"elgg-river-responses\">$responses</div>"; +} + +$group_string = ''; +$object = $item->getObjectEntity(); +$container = $object->getContainerEntity(); +if ($container instanceof ElggGroup && $container->guid != elgg_get_page_owner_guid()) { + $group_link = elgg_view('output/url', array( + 'href' => $container->getURL(), + 'text' => $container->name, + 'is_trusted' => true, + )); + $group_string = elgg_echo('river:ingroup', array($group_link)); +} + +echo <<<RIVER +$menu +<div class="elgg-river-summary">$summary $group_string <span class="elgg-river-timestamp">$timestamp</span></div> +$message +$attachments +$responses +RIVER; diff --git a/views/default/river/elements/image.php b/views/default/river/elements/image.php new file mode 100644 index 000000000..6f6aeae65 --- /dev/null +++ b/views/default/river/elements/image.php @@ -0,0 +1,16 @@ +<?php +/** + * Elgg river image + * + * Displayed next to the body of each river item + * + * @uses $vars['item'] + */ + +$subject = $vars['item']->getSubjectEntity(); + +if (elgg_in_context('widgets')) { + echo elgg_view_entity_icon($subject, 'tiny'); +} else { + echo elgg_view_entity_icon($subject, 'small'); +} diff --git a/views/default/river/elements/layout.php b/views/default/river/elements/layout.php new file mode 100644 index 000000000..94622e272 --- /dev/null +++ b/views/default/river/elements/layout.php @@ -0,0 +1,14 @@ +<?php +/** + * Layout of a river item + * + * @uses $vars['item'] ElggRiverItem + */ + +$item = $vars['item']; + +echo elgg_view('page/components/image_block', array( + 'image' => elgg_view('river/elements/image', $vars), + 'body' => elgg_view('river/elements/body', $vars), + 'class' => 'elgg-river-item', +)); diff --git a/views/default/river/elements/responses.php b/views/default/river/elements/responses.php new file mode 100644 index 000000000..f6c32e142 --- /dev/null +++ b/views/default/river/elements/responses.php @@ -0,0 +1,63 @@ +<?php +/** + * River item footer + * + * @uses $vars['item'] ElggRiverItem + * @uses $vars['responses'] Alternate override for this item + */ + +// allow river views to override the response content +$responses = elgg_extract('responses', $vars, false); +if ($responses) { + echo $responses; + return true; +} + +$item = $vars['item']; +$object = $item->getObjectEntity(); + +// annotations do not have comments +if ($item->annotation_id != 0 || !$object) { + return true; +} + +$comment_count = $object->countComments(); + +$options = array( + 'guid' => $object->getGUID(), + 'annotation_name' => 'generic_comment', + 'limit' => 3, + 'order_by' => 'n_table.time_created desc' +); +$comments = elgg_get_annotations($options); + +if ($comments) { + // why is this reversing it? because we're asking for the 3 latest + // comments by sorting desc and limiting by 3, but we want to display + // these comments with the latest at the bottom. + $comments = array_reverse($comments); + +?> + <span class="elgg-river-comments-tab"><?php echo elgg_echo('comments'); ?></span> + +<?php + + echo elgg_view_annotation_list($comments, array('list_class' => 'elgg-river-comments')); + + if ($comment_count > count($comments)) { + $num_more_comments = $comment_count - count($comments); + $url = $object->getURL(); + $params = array( + 'href' => $url, + 'text' => elgg_echo('river:comments:more', array($num_more_comments)), + 'is_trusted' => true, + ); + $link = elgg_view('output/url', $params); + echo "<div class=\"elgg-river-more\">$link</div>"; + } +} + +// inline comment form +$form_vars = array('id' => "comments-add-{$object->getGUID()}", 'class' => 'hidden'); +$body_vars = array('entity' => $object, 'inline' => true); +echo elgg_view_form('comments/add', $form_vars, $body_vars); diff --git a/views/default/river/elements/summary.php b/views/default/river/elements/summary.php new file mode 100644 index 000000000..d7bde51dd --- /dev/null +++ b/views/default/river/elements/summary.php @@ -0,0 +1,54 @@ +<?php +/** + * Short summary of the action that occurred + * + * @vars['item'] ElggRiverItem + */ + +$item = $vars['item']; + +$subject = $item->getSubjectEntity(); +$object = $item->getObjectEntity(); +$target = $object->getContainerEntity(); + +$subject_link = elgg_view('output/url', array( + 'href' => $subject->getURL(), + 'text' => $subject->name, + 'class' => 'elgg-river-subject', + 'is_trusted' => true, +)); + +$object_text = $object->title ? $object->title : $object->name; +$object_link = elgg_view('output/url', array( + 'href' => $object->getURL(), + 'text' => elgg_get_excerpt($object_text, 100), + 'class' => 'elgg-river-object', + 'is_trusted' => true, +)); + +$action = $item->action_type; +$type = $item->type; +$subtype = $item->subtype ? $item->subtype : 'default'; + +$container = $object->getContainerEntity(); +if ($container instanceof ElggGroup) { + $params = array( + 'href' => $container->getURL(), + 'text' => $container->name, + 'is_trusted' => true, + ); + $group_link = elgg_view('output/url', $params); + $group_string = elgg_echo('river:ingroup', array($group_link)); +} + +// check summary translation keys. +// will use the $type:$subtype if that's defined, otherwise just uses $type:default +$key = "river:$action:$type:$subtype"; +$summary = elgg_echo($key, array($subject_link, $object_link)); + +if ($summary == $key) { + $key = "river:$action:$type:default"; + $summary = elgg_echo($key, array($subject_link, $object_link)); +} + +echo $summary;
\ No newline at end of file diff --git a/views/default/river/item.php b/views/default/river/item.php new file mode 100644 index 000000000..75767e08d --- /dev/null +++ b/views/default/river/item.php @@ -0,0 +1,30 @@ +<?php +/** + * Primary river item view + * + * Calls the individual view saved for that river item. Most of these + * individual river views then use the views in river/elements. + * + * @uses $vars['item'] ElggRiverItem + */ + +// @todo remove this in Elgg 1.9 +global $_elgg_special_river_catch; +if (!isset($_elgg_special_river_catch)) { + $_elgg_special_river_catch = false; +} +if ($_elgg_special_river_catch) { + // we changed the views a little in 1.8.1 so this catches the plugins that + // were updated in 1.8.0 and redirects to the layout view + echo elgg_view('river/elements/layout', $vars); + return true; +} +$_elgg_special_river_catch = true; + + +$item = $vars['item']; + +echo elgg_view($item->getView(), $vars); + + +$_elgg_special_river_catch = false; diff --git a/views/default/river/item/list.php b/views/default/river/item/list.php deleted file mode 100644 index d791c74e8..000000000 --- a/views/default/river/item/list.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php -/** - * - * @package Elgg - * @subpackage Core - * - */ -?> -<div class="river_item_list"> -<?php - if (isset($vars['items']) && is_array($vars['items'])) { - - $i = 0; - if (!empty($vars['items'])) { - foreach($vars['items'] as $item) { - echo elgg_view_river_item($item); - $i++; - if ($i >= $vars['limit']) { - break; - } - } - } - } - - if ($vars['pagination'] !== false) { - $baseurl = $_SERVER['REQUEST_URI']; - - $nav = ''; - - if (sizeof($vars['items']) > $vars['limit']) { - $newoffset = $vars['offset'] + $vars['limit']; - $nexturl = elgg_http_add_url_query_elements($baseurl, array('offset' => $newoffset)); - - $nav .= '<a class="back" href="'.$nexturl.'">« ' . elgg_echo('previous') . '</a> '; - } - - if ($vars['offset'] > 0) { - $newoffset = $vars['offset'] - $vars['limit']; - if ($newoffset < 0) { - $newoffset = 0; - } - $prevurl = elgg_http_add_url_query_elements($baseurl, array('offset' => $newoffset)); - - $nav .= '<a class="forward" href="'.$prevurl.'">' . elgg_echo('next') . ' »</a> '; - } - - if (!empty($nav)) { - echo '<div class="river_pagination"><p>'.$nav.'</p></div>'; - } - } -?> -</div>
\ No newline at end of file diff --git a/views/default/river/item/wrapper.php b/views/default/river/item/wrapper.php deleted file mode 100644 index 0bdf2f4aa..000000000 --- a/views/default/river/item/wrapper.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php -/** - * Elgg river item wrapper. - * Wraps all river items. - * - * @package Elgg - */ - -//get the site admins choice avatars or action icons -$avatar_icon = get_plugin_setting("avatar_icon","riverdashboard"); -if(!$avatar_icon) { - $avatar_icon = "icon"; -} - -if($avatar_icon == "icon"){ - - ?> - <div class="river_item"> - <div class="river_<?php echo $vars['item']->type; ?>"> - <div class="river_<?php echo $vars['item']->subtype; ?>"> - <div class="river_<?php echo $vars['item']->action_type; ?>"> - <div class="river_<?php echo $vars['item']->type; ?>_<?php if($vars['item']->subtype) echo $vars['item']->subtype . "_"; ?><?php echo $vars['item']->action_type; ?>"> - <p> - <?php - echo $vars['body']; - ?> - <span class="entity-subtext"> - (<?php - echo elgg_view_friendly_time($vars['item']->posted); - ?>) - </span> - </p> - </div> - </div> - </div> - </div> - </div> - - <?php -} else { - ?> - <div class="river_item"> - <span class="river_item_useravatar"> - <?php - echo elgg_view("profile/icon",array('entity' => get_entity($vars['item']->subject_guid), 'size' => 'tiny')); - ?> - </span> - <p class="river_item_body"> - <?php - echo $vars['body']; - ?> - <span class="entity-subtext"> - (<?php - echo elgg_view_friendly_time($vars['item']->posted); - ?>) - </span> - </p> - </div> - <?php -} -?>
\ No newline at end of file diff --git a/views/default/river/relationship/friend/create.php b/views/default/river/relationship/friend/create.php new file mode 100644 index 000000000..0408d79e1 --- /dev/null +++ b/views/default/river/relationship/friend/create.php @@ -0,0 +1,14 @@ +<?php +/** + * Create friend river view + */ +$subject = $vars['item']->getSubjectEntity(); +$object = $vars['item']->getObjectEntity(); + +$subject_icon = elgg_view_entity_icon($subject, 'tiny'); +$object_icon = elgg_view_entity_icon($object, 'tiny'); + +echo elgg_view('river/elements/layout', array( + 'item' => $vars['item'], + 'attachments' => $subject_icon . elgg_view_icon('arrow-right') . $object_icon, +)); diff --git a/views/default/river/user/default/profileiconupdate.php b/views/default/river/user/default/profileiconupdate.php new file mode 100644 index 000000000..271064a06 --- /dev/null +++ b/views/default/river/user/default/profileiconupdate.php @@ -0,0 +1,24 @@ +<?php +/** + * Update avatar river view + */ + +$subject = $vars['item']->getSubjectEntity(); + +$subject_link = elgg_view('output/url', array( + 'href' => $subject->getURL(), + 'text' => $subject->name, + 'class' => 'elgg-river-subject', + 'is_trusted' => true, +)); + +$string = elgg_echo('river:update:user:avatar', array($subject_link)); + +echo elgg_view('river/elements/layout', array( + 'item' => $vars['item'], + 'summary' => $string, + 'attachments' => elgg_view_entity_icon($subject, 'tiny', array( + 'use_hover' => false, + 'use_link' => false, + )), +)); diff --git a/views/default/river/user/default/profileupdate.php b/views/default/river/user/default/profileupdate.php new file mode 100644 index 000000000..ce72970d6 --- /dev/null +++ b/views/default/river/user/default/profileupdate.php @@ -0,0 +1,20 @@ +<?php +/** + * Update profile river view + */ + +$subject = $vars['item']->getSubjectEntity(); + +$subject_link = elgg_view('output/url', array( + 'href' => $subject->getURL(), + 'text' => $subject->name, + 'class' => 'elgg-river-subject', + 'is_trusted' => true, +)); + +$string = elgg_echo('river:update:user:profile', array($subject_link)); + +echo elgg_view('river/elements/layout', array( + 'item' => $vars['item'], + 'summary' => $string, +)); diff --git a/views/default/scripts/initialize_elgg.php b/views/default/scripts/initialize_elgg.php deleted file mode 100644 index 03d5adc5a..000000000 --- a/views/default/scripts/initialize_elgg.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * - */ - -?> -<script type="text/javascript"> -/** - * Don't want to cache these -- they could change for every request - */ -elgg.config.lastcache = <?php echo (int)($vars['config']->lastcache); ?>; - -elgg.security.token.__elgg_ts = <?php echo $ts = time(); ?>; -elgg.security.token.__elgg_token = '<?php echo generate_action_token($ts); ?>'; - -<?php -$page_owner = elgg_get_page_owner(); - -if ($page_owner instanceof ElggEntity) { - $page_owner_json = array(); - foreach ($page_owner->getExportableValues() as $v) { - $page_owner_json[$v] = $page_owner->$v; - } - - $page_owner_json['subtype'] = $page_owner->getSubtype(); - $page_owner_json['url'] = $page_owner->getURL(); - - echo 'elgg.page_owner = '.json_encode($page_owner_json).';'; -} - -$user = get_loggedin_user(); - -if ($user instanceof ElggUser) { - $user_json = array(); - foreach ($user->getExportableValues() as $v) { - $user_json[$v] = $user->$v; - } - - $user_json['subtype'] = $user->getSubtype(); - $user_json['url'] = $user->getURL(); - - echo 'elgg.session.user = new elgg.ElggUser('.json_encode($user_json).');'; -} -?>; -</script>
\ No newline at end of file diff --git a/views/default/settings/system.php b/views/default/settings/system.php deleted file mode 100644 index 362f504cc..000000000 --- a/views/default/settings/system.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * Elgg system settings form - * The form to change system settings - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['action'] If set, the place to forward the form to (usually action/systemsettings/save) - */ - -// Set action appropriately -if (!isset($vars['action'])) { - $action = elgg_get_site_url() . "action/systemsettings/save"; -} else { - $action = $vars['action']; -} - -$form_body = ""; -foreach(array('sitename','sitedescription', 'siteemail', 'wwwroot','path','dataroot', 'view') as $field) { - $form_body .= "<p>"; - $form_body .= elgg_echo('installation:' . $field) . "<br />"; - $warning = elgg_echo('installation:warning:' . $field); - if ($warning != 'installation:warning:' . $field) echo "<b>" . $warning . "</b><br />"; - $value = $vars['config']->$field; - $form_body .= elgg_view("input/text",array('internalname' => $field, 'value' => $value)); - $form_body .= "</p>"; -} - -$languages = get_installed_translations(); -$form_body .= "<p>" . elgg_echo('installation:language') . elgg_view("input/pulldown", array('internalname' => 'language', 'value' => $vars['config']->language, 'options_values' => $languages)) . "</p>"; - -$form_body .= "<p>" . elgg_echo('admin:site:access:warning') . "<br />"; -$form_body .= elgg_echo('installation:sitepermissions') . elgg_view('input/access', array('internalname' => 'default_access','value' => $vars['config']->default_access)) . "</p>"; -$form_body .= "<p>" . elgg_echo('installation:allow_user_default_access:description') . "<br />" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:allow_user_default_access:label')), 'internalname' => 'allow_user_default_access', 'value' => ($vars['config']->allow_user_default_access ? elgg_echo('installation:allow_user_default_access:label') : "") )) . "</p>"; -$form_body .= "<p>" . elgg_echo('installation:simplecache:description') . "<br />" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:simplecache:label')), 'internalname' => 'simplecache_enabled', 'value' => ($vars['config']->simplecache_enabled ? elgg_echo('installation:simplecache:label') : "") )) . "</p>"; -$form_body .= "<p>" . elgg_echo('installation:viewpathcache:description') . "<br />" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:viewpathcache:label')), 'internalname' => 'viewpath_cache_enabled', 'value' => (($vars['config']->viewpath_cache_enabled) ? elgg_echo('installation:viewpathcache:label') : "") )) . "</p>"; - -$debug_options = array('0' => elgg_echo('installation:debug:none'), 'ERROR' => elgg_echo('installation:debug:error'), 'WARNING' => elgg_echo('installation:debug:warning'), 'NOTICE' => elgg_echo('installation:debug:notice')); -$form_body .= "<p>" . elgg_echo('installation:debug'); -$form_body .= elgg_view('input/pulldown', array('options_values' => $debug_options, 'internalname' => 'debug', 'value' => $vars['config']->debug)); -$form_body .= '</p>'; - -$form_body .= "<p>" . elgg_echo('installation:httpslogin') . "<br />" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:httpslogin:label')), 'internalname' => 'https_login', 'value' => ($vars['config']->https_login ? elgg_echo('installation:httpslogin:label') : "") )) . "</p>"; - -$form_body .= "<p>" . elgg_echo('installation:disableapi') . "<br />"; -$on = elgg_echo('installation:disableapi:label'); -if ((isset($CONFIG->disable_api)) && ($CONFIG->disable_api == true)) { - $on = ($vars['config']->disable_api ? "" : elgg_echo('installation:disableapi:label')); -} -$form_body .= elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:disableapi:label')), 'internalname' => 'api', 'value' => $on )); -$form_body .= "</p>"; - -$form_body .= elgg_view('input/hidden', array('internalname' => 'settings', 'value' => 'go')); - -$form_body .= "<div class='divider'></div>".elgg_view('input/submit', array('value' => elgg_echo("save"))); -$form_body = "<div class='admin_settings site_admin margin-top'>".$form_body."</div>"; -echo elgg_view('input/form', array('action' => $action, 'body' => $form_body)); diff --git a/views/default/settings/upgrading.php b/views/default/settings/upgrading.php deleted file mode 100644 index 4d39f29d9..000000000 --- a/views/default/settings/upgrading.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * @package Elgg - * @subpackage Core - */ -?> - -<html> - <head> - <title><?php echo elgg_echo('upgrading'); ?></title> - <meta http-equiv="refresh" content="1;url=<?php echo elgg_get_site_url(); ?>upgrade.php?upgrade=upgrade"/> - </head> - <body bgcolor="white"> - <table width="100%" height="100%" border="0" style="margin: 0px; padding: 0px"> - <tr> - <td width="100%" height="100%" valign="middle" align="center"> - <img src="<?php echo elgg_get_site_url(); ?>_graphics/ajax-loader_bw.gif" /> - </td> - </tr> - </table> - </body> -</html>
\ No newline at end of file diff --git a/views/default/spotlight/default.php b/views/default/spotlight/default.php deleted file mode 100644 index 6c872985d..000000000 --- a/views/default/spotlight/default.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** - * Elgg default spotlight - * The spotlight area that displays across the site - * - * @package Elgg - * @subpackage Core - * - */ -?> - -<div id="spotlight_table"> - <!-- spotlight RHS content --> - <div class="spotlightRHS"> - <h2>Information</h2> - <ul> - <li><a href="http://docs.elgg.org/wiki/Views/SystemViews">Populating this spotlight area</a></li> - <li><a href="http://community.elgg.org">Elgg open source community</a></li> - <li><a href="http://elgg.com">Elgg commercial services</a></li> - </ul> - </div> - <!-- spotlight LHS content --> - <div class="spotlightLHS"> - <h2>Welcome to Elgg</h2> - <p> - Elgg allows you to run your own social networking site, whether publicly (like - Facebook) or privately within your company or organization. - <a href="http://elgg.com/">Support and commercial services</a> are available, - or you can find new tools for your Elgg site at the - <a href="http://community.elgg.org/">Elgg community</a>. - </p> - </div><!-- /spotlight LHS content --> -</div>
\ No newline at end of file diff --git a/views/default/upload/upload_form_content.php b/views/default/upload/upload_form_content.php deleted file mode 100644 index 5b66a9bf3..000000000 --- a/views/default/upload/upload_form_content.php +++ /dev/null @@ -1,123 +0,0 @@ -<?php -/** - * Elgg system settings form - * The form to change system settings - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['action'] If set, the place to forward the form to (usually action/systemsettings/save) - */ -?> - -<input type="hidden" name="number_of_files" value="1"> -<?php - -if (isset($vars['entity'])) { - $title = $vars['entity']->title; - $description = $vars['entity']->description; - $tags = $vars['entity']->tags; - $access_id = $vars['entity']->access_id; -} else { - $title = ""; - $description = ""; - $tags = ""; - $access_id = get_default_access(); -} - -$plugin = $vars['plugin']; - -if (!$vars['entity']) { - -?> - <div id="option_container"> - <p> - <label><?php echo elgg_echo("title"); ?><br /> - <?php - - echo elgg_view("input/text", array("internalname" => "title_0")); - - ?> - </label> - </p> - <p> - <label><?php echo elgg_echo("$plugin:file"); ?><br /> - <?php - - echo elgg_view("input/file",array('internalname' => 'upload_0')); - - ?> - </label> - </p> - </div> - <p><input type="button" onclick="javascript:file_addtoform()" value="<?php echo elgg_echo("$plugin:add_to_form"); ?>"></p> -<?php - } else { - -?> - <p> - <label><?php echo elgg_echo("title"); ?><br /> - <?php - - echo elgg_view("input/text", array( - "internalname" => "title", - "value" => $title, - )); - - ?> - </label> - </p> -<?php - } -?> - <p class="longtext_inputarea"> - <label><?php echo elgg_echo("description"); ?></label> - <?php - - echo elgg_view("input/longtext",array( - "internalname" => "description", - "value" => $description, - )); - ?> - </p> - <p> - <label><?php echo elgg_echo("tags"); ?><br /> - <?php - - echo elgg_view("input/tags", array( - "internalname" => "tags", - "value" => $tags, - )); - - ?> - </label></p> -<?php - - $categories = elgg_view('categories',$vars); - if (!empty($categories)) { -?> - - <p> - <?php echo $categories; ?> - </p> - -<?php - } - //remove folders until they are ready to use - //echo elgg_view("$plugin/folders/select",$vars); -?> - <p> - <label> - <?php echo elgg_echo('access'); ?><br /> - <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id)); ?> - </label> - </p> - -<?php - - if (isset($vars['container_guid'])) { - echo "<input type=\"hidden\" name=\"container_guid\" value=\"{$vars['container_guid']}\" />"; - } - if (isset($vars['entity'])) { - echo "<input type=\"hidden\" name=\"file_guid\" value=\"{$vars['entity']->getGUID()}\" />"; - }
\ No newline at end of file diff --git a/views/default/user/default.php b/views/default/user/default.php index 744a54595..6c84e84ad 100644 --- a/views/default/user/default.php +++ b/views/default/user/default.php @@ -2,16 +2,56 @@ /** * Elgg user display * - * @package Elgg - * @subpackage Core + * @uses $vars['entity'] ElggUser entity + * @uses $vars['size'] Size of the icon */ -if ($vars['full']) { - echo elgg_view("profile/userdetails",$vars); +$entity = $vars['entity']; +$size = elgg_extract('size', $vars, 'tiny'); + +$icon = elgg_view_entity_icon($entity, $size, $vars); + +// Simple XFN +$rel = ''; +if (elgg_get_logged_in_user_guid() == $entity->guid) { + $rel = 'rel="me"'; +} elseif (check_entity_relationship(elgg_get_logged_in_user_guid(), 'friend', $entity->guid)) { + $rel = 'rel="friend"'; +} + +$title = "<a href=\"" . $entity->getUrl() . "\" $rel>" . $entity->name . "</a>"; + +$metadata = elgg_view_menu('entity', array( + 'entity' => $entity, + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', +)); + +if (elgg_in_context('owner_block') || elgg_in_context('widgets')) { + $metadata = ''; +} + +if (elgg_get_context() == 'gallery') { + echo $icon; } else { - if (get_input('listtype') == "gallery") { - echo elgg_view('profile/gallery',$vars); + if ($entity->isBanned()) { + $banned = elgg_echo('banned'); + $params = array( + 'entity' => $entity, + 'title' => $title, + 'metadata' => $metadata, + ); } else { - echo elgg_view("profile/listing",$vars); + $params = array( + 'entity' => $entity, + 'title' => $title, + 'metadata' => $metadata, + 'subtitle' => $entity->briefdescription, + 'content' => elgg_view('user/status', array('entity' => $entity)), + ); } + + $list_body = elgg_view('user/elements/summary', $params); + + echo elgg_view_image_block($icon, $list_body, $vars); } diff --git a/views/default/user/elements/summary.php b/views/default/user/elements/summary.php new file mode 100644 index 000000000..46d11c14c --- /dev/null +++ b/views/default/user/elements/summary.php @@ -0,0 +1,13 @@ +<?php +/** + * User summary + * + * @uses $vars['entity'] ElggEntity + * @uses $vars['title'] Title link (optional) false = no title, '' = default + * @uses $vars['metadata'] HTML for entity metadata and actions (optional) + * @uses $vars['subtitle'] HTML for the subtitle (optional) + * @uses $vars['tags'] HTML for the tags (optional) + * @uses $vars['content'] HTML for the entity content (optional) + */ + +echo elgg_view('object/elements/summary', $vars); diff --git a/views/default/user/search/finishblurb.php b/views/default/user/search/finishblurb.php index 1e48d6145..a3878a803 100644 --- a/views/default/user/search/finishblurb.php +++ b/views/default/user/search/finishblurb.php @@ -10,7 +10,7 @@ elgg_deprecated_notice('view user/search/finishblurb was deprecated.', 1.7); if ($vars['count'] > $vars['threshold']) { ?> -<a href="<?php echo elgg_get_site_url(); ?>pg/search/users/?tag=<?php echo urlencode($vars['tag']); ?>"><?php +<a href="<?php echo elgg_get_site_url(); ?>search/users?tag=<?php echo urlencode($vars['tag']); ?>"><?php echo elgg_echo("user:search:finishblurb"); ?></a> <?php diff --git a/views/default/user/settings/default_access.php b/views/default/user/settings/default_access.php deleted file mode 100644 index e7c280198..000000000 --- a/views/default/user/settings/default_access.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php -/** - * Provide a way of setting your default access - * - * @package Elgg - * @subpackage Core - */ -if ($vars['config']->allow_user_default_access) { - $user = elgg_get_page_owner(); - - if ($user) { - if (false === ($default_access = $user->getPrivateSetting('elgg_default_access'))) { - $default_access = $vars['config']->default_access; - } -?> -<div class="user-settings access"> - <h3><?php echo elgg_echo('default_access:settings'); ?></h3> - <p> - <?php echo elgg_echo('default_access:label'); ?>: - <?php - - echo elgg_view('input/access',array('internalname' => 'default_access', 'value' => $default_access)); - - ?> - </p> -</div> -<?php - } -}
\ No newline at end of file diff --git a/views/default/user/settings/email.php b/views/default/user/settings/email.php deleted file mode 100644 index 396f8e79b..000000000 --- a/views/default/user/settings/email.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -/** - * Provide a way of setting your email - * - * @package Elgg - * @subpackage Core - */ - -$user = elgg_get_page_owner(); - -if ($user) { -?> -<div class="user-settings email"> -<h3><?php echo elgg_echo('email:settings'); ?></h3> -<p> - <?php echo elgg_echo('email:address:label'); ?>: - <?php - - echo elgg_view('input/email',array('internalname' => 'email', 'value' => $user->email)); - - ?> -</p> -</div> -<?php -}
\ No newline at end of file diff --git a/views/default/user/settings/language.php b/views/default/user/settings/language.php deleted file mode 100644 index ada133791..000000000 --- a/views/default/user/settings/language.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php -/** - * Provide a way of setting your language prefs - * - * @package Elgg - * @subpackage Core - */ - -global $CONFIG; -$user = elgg_get_page_owner(); - -if ($user) { -?> -<div class="user-settings language"> -<h3><?php echo elgg_echo('user:set:language'); ?></h3> -<p> - - <?php echo elgg_echo('user:language:label'); ?>: <?php - - $value = $CONFIG->language; - if ($user->language) { - $value = $user->language; - } - - echo elgg_view("input/pulldown", array('internalname' => 'language', 'value' => $value, 'options_values' => get_installed_translations())); - - ?> - -</p> -</div> -<?php -}
\ No newline at end of file diff --git a/views/default/user/settings/name.php b/views/default/user/settings/name.php deleted file mode 100644 index fad6c488f..000000000 --- a/views/default/user/settings/name.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -/** - * Provide a way of setting your full name. - * - * @package Elgg - * @subpackage Core - - - */ - -$user = elgg_get_page_owner(); - -// all hidden, but necessary for properly updating user details -echo elgg_view('input/hidden', array('internalname' => 'name', 'value' => $user->name)); -echo elgg_view('input/hidden', array('internalname' => 'guid', 'value' => $user->guid)); diff --git a/views/default/user/settings/password.php b/views/default/user/settings/password.php deleted file mode 100644 index 0bd7f38f8..000000000 --- a/views/default/user/settings/password.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * Provide a way of setting your password - * - * @package Elgg - * @subpackage Core - */ - -$user = elgg_get_page_owner(); - -if ($user) { -?> -<div class="user-settings password"> -<h3><?php echo elgg_echo('user:set:password'); ?></h3> - - <?php - // only make the admin user enter current password for changing his own password. - if (!isadminloggedin() || isadminloggedin() && $user->guid == get_loggedin_userid()) { - ?> - <p> - <?php echo elgg_echo('user:current_password:label'); ?>: - <?php - echo elgg_view('input/password', array('internalname' => 'current_password')); - ?> - </p> - <?php } ?> - - <p> - <?php echo elgg_echo('user:password:label'); ?>: - <?php - echo elgg_view('input/password', array('internalname' => 'password')); - ?> - </p> - - <p> - <?php echo elgg_echo('user:password2:label'); ?>: <?php - echo elgg_view('input/password', array('internalname' => 'password2')); - ?> - </p> -</div> -<?php -}
\ No newline at end of file diff --git a/views/default/usersettings/form.php b/views/default/usersettings/form.php deleted file mode 100644 index 2e3526aa3..000000000 --- a/views/default/usersettings/form.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php -/** - * @package Elgg - * @subpackage Core - */ - -$form_body = elgg_view("usersettings/user"); -$form_body .= "<div class='divider'></div>".elgg_view('input/submit', array('value' => elgg_echo('save'), 'class' => 'submit-button usersettings_save')); - -echo elgg_view('input/form', array('action' => "action/usersettings/save", 'body' => $form_body));
\ No newline at end of file diff --git a/views/default/usersettings/main.php b/views/default/usersettings/main.php deleted file mode 100644 index d1cf85448..000000000 --- a/views/default/usersettings/main.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * Elgg user main settings page. - * Functions for adding and manipulating options on the user settings panel. - * - * @package Elgg - * @subpackage Core - */ - -// Description of what's going on -echo elgg_view('output/longtext', array('value' => elgg_echo("usersettings:description"))); diff --git a/views/default/usersettings/main_opt/plugins.php b/views/default/usersettings/main_opt/plugins.php deleted file mode 100644 index ab5743d36..000000000 --- a/views/default/usersettings/main_opt/plugins.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -/** - * Elgg plugin sub-component on the main menu. - * - * @package Elgg - * @subpackage Core - */ - -global $CONFIG; -?> -<div class="menu_admin_option"> - <h2><?php echo elgg_echo('usersettings:plugins'); ?> </h2> - <p><?php echo elgg_echo('usersettings:plugins:opt:description'); ?><br /> - <a href="<?php echo elgg_get_site_url() . "pg/settings/plugins/"; ?>"><?php echo elgg_echo('usersettings:plugins:opt:linktext'); ?></a></p> -</div>
\ No newline at end of file diff --git a/views/default/usersettings/main_opt/statistics.php b/views/default/usersettings/main_opt/statistics.php deleted file mode 100644 index 0f3872143..000000000 --- a/views/default/usersettings/main_opt/statistics.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg satistics sub-component on the main menu. - * - * @package Elgg - * @subpackage Core - */ -?> -<div class="menu_admin_option"> - <h2><?php echo elgg_echo('usersettings:statistics'); ?> </h2> - <p><?php echo elgg_echo('usersettings:statistics:opt:description'); ?><br /> - <a href="<?php echo elgg_get_site_url() . "pg/settings/statistics/"; ?>"><?php echo elgg_echo('usersettings:statistics:opt:linktext'); ?></a></p> -</div> diff --git a/views/default/usersettings/main_opt/user.php b/views/default/usersettings/main_opt/user.php deleted file mode 100644 index d9f2b5677..000000000 --- a/views/default/usersettings/main_opt/user.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg user sub-component on the main menu. - * - * @package Elgg - * @subpackage Core - */ -?> -<div class="menu_admin_option"> - <h2><?php echo elgg_echo('usersettings:user'); ?> </h2> - <p><?php echo elgg_echo('usersettings:user:opt:description'); ?><br /> - <a href="<?php echo elgg_get_site_url() . "pg/settings/user/"; ?>"><?php echo elgg_echo('usersettings:user:opt:linktext'); ?></a></p> -</div>
\ No newline at end of file diff --git a/views/default/usersettings/plugins.php b/views/default/usersettings/plugins.php deleted file mode 100644 index c4df9e26b..000000000 --- a/views/default/usersettings/plugins.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -/** - * Elgg plugin specific user settings. - * - * @package Elgg - * @subpackage Core - */ - -// Description of what's going on -echo "<div class='user-settings margin-top'>".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)); - } -}
\ No newline at end of file diff --git a/views/default/usersettings/plugins_opt/plugin.php b/views/default/usersettings/plugins_opt/plugin.php deleted file mode 100644 index 981d8d937..000000000 --- a/views/default/usersettings/plugins_opt/plugin.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * Elgg plugin manifest class - * - * This file renders a plugin for the admin screen, including active/deactive, manifest details & display plugin - * settings. - * - * @package Elgg - * @subpackage Core - */ - - -$plugin = $vars['plugin']; -$details = $vars['details']; - -$active = $details['active']; -$manifest = $details['manifest']; - -$user_guid = $details['user_guid']; -if ($user_guid) { - $user_guid = get_loggedin_userid(); -} - -if (elgg_view("usersettings/{$plugin}/edit")) { -?> -<div class="user-settings"> - <h3><?php echo elgg_echo($plugin); ?></h3> - - <div id="<?php echo $plugin; ?>_settings"> - <?php echo elgg_view("object/plugin", array('plugin' => $plugin, 'entity' => find_plugin_usersettings($plugin, $user_guid), 'prefix' => 'user')) ?> - </div> -</div> -<?php -}
\ No newline at end of file diff --git a/views/default/usersettings/statistics.php b/views/default/usersettings/statistics.php deleted file mode 100644 index c90d14c6d..000000000 --- a/views/default/usersettings/statistics.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php -/** - * Elgg settings specific user settings. - * - * @package Elgg - * @subpackage Core - */ - -?>
\ No newline at end of file diff --git a/views/default/usersettings/statistics_opt/numentities.php b/views/default/usersettings/statistics_opt/numentities.php deleted file mode 100644 index 10d2b7c68..000000000 --- a/views/default/usersettings/statistics_opt/numentities.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/** - * Elgg statistics screen - * - * @package Elgg - * @subpackage Core - */ - -// Get entity statistics -$entity_stats = get_entity_statistics(get_loggedin_userid()); - -if ($entity_stats) { -?> -<div class="user-settings statistics"> - <h3><?php echo elgg_echo('usersettings:statistics:label:numentities'); ?></h3> - <table class="styled"> - <?php - foreach ($entity_stats as $k => $entry) { - foreach ($entry as $a => $b) { - - //This function controls the alternating class - $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; - - if ($a == "__base__") { - $a = elgg_echo("item:{$k}"); - if (empty($a)) { - $a = $k; - } - } else { - $a = elgg_echo("item:{$k}:{$a}"); - if (empty($a)) { - $a = "$k $a"; - } - } - echo <<< END - <tr class="{$even_odd}"> - <td class="column-one"><b>{$a}:</b></td> - <td>{$b}</td> - </tr> -END; - } - } - ?> - </table> -</div> -<?php -}
\ No newline at end of file diff --git a/views/default/usersettings/statistics_opt/online.php b/views/default/usersettings/statistics_opt/online.php deleted file mode 100644 index dc24130cd..000000000 --- a/views/default/usersettings/statistics_opt/online.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * Elgg statistics screen showing online users. - * - * @package Elgg - * @subpackage Core - */ - -$user = get_loggedin_user(); - -$logged_in = 0; -$log = get_system_log($user->guid, "login", "", 'user', '', 1); - -if ($log) { - $logged_in = $log[0]->time_created; -} - -?> -<div class="user-settings details"> - <h3><?php echo elgg_echo('usersettings:statistics:yourdetails'); ?></h3> - - <table class="styled"> - <tr class="odd"><td class="column-one"><?php echo elgg_echo('usersettings:statistics:label:name'); ?></td><td><?php echo $user->name; ?></td></tr> - <tr class="even"><td class="column-one"><?php echo elgg_echo('usersettings:statistics:label:email'); ?></td><td><?php echo $user->email; ?></td></tr> - <tr class="odd"><td class="column-one"><?php echo elgg_echo('usersettings:statistics:label:membersince'); ?></td><td><?php echo date("r",$user->time_created); ?></td></tr> - <tr class="even"><td class="column-one"><?php echo elgg_echo('usersettings:statistics:label:lastlogin'); ?></td><td><?php echo date("r",$logged_in); ?></td></tr> - </table> -</div>
\ No newline at end of file diff --git a/views/default/usersettings/user.php b/views/default/usersettings/user.php deleted file mode 100644 index c6a56a14e..000000000 --- a/views/default/usersettings/user.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -/** - * @package Elgg - * @subpackage Core - */ -?>
\ No newline at end of file diff --git a/views/default/widgets/add_button.php b/views/default/widgets/add_button.php deleted file mode 100644 index 92de8a99f..000000000 --- a/views/default/widgets/add_button.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -?> -<div id="widget-add-button"> -<?php -$options = array( - 'href' => '#', - 'text' => elgg_echo('widgets:add'), - 'class' => 'action-button', -); -echo elgg_view('output/url', $options); -?> -</div> diff --git a/views/default/widgets/add_panel.php b/views/default/widgets/add_panel.php deleted file mode 100644 index d9acc5518..000000000 --- a/views/default/widgets/add_panel.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -$widgets = $vars['widgets']; -$context = $vars['context']; - -$widget_types = elgg_get_widget_types($context); - -$current_handlers = array(); -foreach ($widgets as $column_widgets) { - foreach ($column_widgets as $widget) { - $current_handlers[] = $widget->handler; - } -} - -?> -<div class="widgets-add-panel hidden"> - <p> - <?php echo elgg_echo('widgets:add:description'); ?> - </p> - <ul> -<?php - foreach ($widget_types as $handler => $widget_type) { - $id = "widget-type-$handler"; - // check if widget added and only one instance allowed - if ($widget_type->multiple == false && in_array($handler, $current_handlers)) { - $class = 'widget-unavailable'; - $tooltip = elgg_echo('widget:unavailable'); - } else { - $class = 'widget-available'; - $tooltip = $widget_type->description; - } - - if ($widget_type->multiple) { - $class .= ' widget-multiple'; - } else { - $class .= ' widget-single'; - } - - echo "<li title=\"$tooltip\" id=\"$id\" class=\"$class\">$widget_type->name</li>"; - } -?> - </ul> -<?php - $params = array( - 'internalname' => 'widget-context', - 'value' => $context - ); - echo elgg_view('input/hidden', $params); -?> - <div class="clearfloat"></div> -</div> diff --git a/views/default/widgets/admin_welcome/content.php b/views/default/widgets/admin_welcome/content.php new file mode 100644 index 000000000..f4b92ea66 --- /dev/null +++ b/views/default/widgets/admin_welcome/content.php @@ -0,0 +1,19 @@ +<?php +/** + * Welcome widget for admins + */ + +// section => string replacements. +$sections = array( + 'intro' => array(), + 'admin_overview' => array(), + 'outro' => array() +); + +// don't use longtext because it filters output. +// that's annoying. +echo '<div class="elgg-output">'; +foreach ($sections as $section => $strings) { + echo '<p>' . elgg_echo("admin:widget:admin_welcome:$section", $strings) . '</p>'; +} +echo '</div>';
\ No newline at end of file diff --git a/views/default/widgets/content_stats/content.php b/views/default/widgets/content_stats/content.php new file mode 100644 index 000000000..56772047d --- /dev/null +++ b/views/default/widgets/content_stats/content.php @@ -0,0 +1,28 @@ +<?php +/** + * Content stats widget + */ + +$max = $vars['entity']->num_display; + +$entity_stats = get_entity_statistics(); +$object_stats = $entity_stats['object']; +arsort($object_stats); +$object_stats = array_slice($object_stats, 0, $max); + +echo '<table class="elgg-table-alt">'; +echo '<tr><th>' . elgg_echo('widget:content_stats:type') . '</th>'; +echo '<th>' . elgg_echo('widget:content_stats:number') . '</th></tr>'; +foreach ($object_stats as $subtype => $num) { + $name = elgg_echo("item:object:$subtype"); + echo "<tr><td>$name</td><td>$num</td></tr>"; +} +echo '</table>'; + +echo '<div class="mtm">'; +echo elgg_view('output/url', array( + 'href' => 'admin/statistics/overview', + 'text' => elgg_echo('more'), + 'is_trusted' => true, +)); +echo '</div>'; diff --git a/views/default/widgets/content_stats/edit.php b/views/default/widgets/content_stats/edit.php new file mode 100644 index 000000000..f1a050df8 --- /dev/null +++ b/views/default/widgets/content_stats/edit.php @@ -0,0 +1,23 @@ +<?php +/** + * Content statistics widget edit view + */ + + +// set default value +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 8; +} + +$params = array( + 'name' => 'params[num_display]', + 'value' => $vars['entity']->num_display, + 'options' => array(5, 8, 10, 12, 15, 20), +); +$dropdown = elgg_view('input/dropdown', $params); + +?> +<p> + <?php echo elgg_echo('widget:numbertodisplay'); ?>: + <?php echo $dropdown; ?> +</p> diff --git a/views/default/widgets/control_panel/content.php b/views/default/widgets/control_panel/content.php new file mode 100644 index 000000000..a348d612f --- /dev/null +++ b/views/default/widgets/control_panel/content.php @@ -0,0 +1,38 @@ +<?php +/** + * Admin control panel widget + */ + +elgg_register_menu_item('admin_control_panel', array( + 'name' => 'flush', + 'text' => elgg_echo('admin:cache:flush'), + 'href' => 'action/admin/site/flush_cache', + 'is_action' => true, + 'link_class' => 'elgg-button elgg-button-action', +)); + +// @todo Move in this in ElggUpgradeManager::isLocked() when #4682 fixed +$is_locked = _elgg_upgrade_is_locked(); + +if (!$is_locked) { + elgg_register_menu_item('admin_control_panel', array( + 'name' => 'upgrade', + 'text' => elgg_echo('upgrade'), + 'href' => 'upgrade.php', + 'link_class' => 'elgg-button elgg-button-action', + )); +} else { + elgg_register_menu_item('admin_control_panel', array( + 'name' => 'unlock_upgrade', + 'text' => elgg_echo('upgrade:unlock'), + 'href' => 'action/admin/site/unlock_upgrade', + 'is_action' => true, + 'link_class' => 'elgg-button elgg-button-action', + 'confirm' => elgg_echo('upgrade:unlock:confirm'), + )); +} + +echo elgg_view_menu('admin_control_panel', array( + 'class' => 'elgg-menu-hz', + 'item_class' => 'mrm', +)); diff --git a/views/default/widgets/controls.php b/views/default/widgets/controls.php deleted file mode 100644 index 5e6aaf193..000000000 --- a/views/default/widgets/controls.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * Elgg widget controls - * - * @package Elgg - * @subpackage Core - */ - -$widget = $vars['widget']; - -$params = array( - 'text' => ' ', - 'href' => "#", - 'class' => 'widget-collapse-button', - 'internalid' => "widget-collapse-button_$widget->guid" -); -$collapse_link = elgg_view('output/url', $params); - -$params = array( - 'text' => ' ', - 'title' => elgg_echo('widget:delete', array($widget->getTitle())), - 'href' => elgg_get_site_url() . "action/widgets/delete?guid=$widget->guid", - 'is_action' => true, - 'class' => 'widget-delete-button', - 'internalid' => "widget-delete-button_$widget->guid" -); -$delete_link = elgg_view('output/url', $params); - -$params = array( - 'text' => ' ', - 'title' => elgg_echo('widget:edit'), - 'href' => "#", - 'class' => 'widget-edit-button', - 'internalid' => "widget-edit-button_$widget->guid" -); -$edit_link = elgg_view('output/url', $params); - -echo <<<___END -<div class="widget-controls"> - $collapse_link - $delete_link - $edit_link -</div> -___END; diff --git a/views/default/widgets/friends/content.php b/views/default/widgets/friends/content.php new file mode 100644 index 000000000..98814c244 --- /dev/null +++ b/views/default/widgets/friends/content.php @@ -0,0 +1,25 @@ +<?php +/** + * Friend widget display view + * + */ + +// owner of the widget +$owner = $vars['entity']->getOwnerEntity(); + +// the number of friends to display +$num = (int) $vars['entity']->num_display; + +// get the correct size +$size = $vars['entity']->icon_size; + +if (elgg_instanceof($owner, 'user')) { + $html = $owner->listFriends('', $num, array( + 'size' => $size, + 'list_type' => 'gallery', + 'pagination' => false + )); + if ($html) { + echo $html; + } +} diff --git a/views/default/widgets/friends/edit.php b/views/default/widgets/friends/edit.php new file mode 100644 index 000000000..c7e6b06ff --- /dev/null +++ b/views/default/widgets/friends/edit.php @@ -0,0 +1,52 @@ +<?php +/** + * Friend widget options + * + */ + +// set default value for display number +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 12; +} + +$params = array( + 'name' => 'params[num_display]', + 'value' => $vars['entity']->num_display, + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 20, 30, 50, 100), +); +$display_dropdown = elgg_view('input/dropdown', $params); + + +// handle upgrade to 1.7.2 from previous versions +if ($vars['entity']->icon_size == 1) { + $vars['entity']->icon_size = 'small'; +} elseif ($vars['entity']->icon_size == 2) { + $vars['entity']->icon_size = 'tiny'; +} + +// set default value for icon size +if (!isset($vars['entity']->icon_size)) { + $vars['entity']->icon_size = 'small'; +} + +$params = array( + 'name' => 'params[icon_size]', + 'value' => $vars['entity']->icon_size, + 'options_values' => array( + 'small' => elgg_echo('friends:small'), + 'tiny' => elgg_echo('friends:tiny'), + ), +); +$size_dropdown = elgg_view('input/dropdown', $params); + + +?> +<p> + <?php echo elgg_echo('friends:num_display'); ?>: + <?php echo $display_dropdown; ?> +</p> + +<p> + <?php echo elgg_echo('friends:icon_size'); ?>: + <?php echo $size_dropdown; ?> +</p> diff --git a/views/default/widgets/new_users/content.php b/views/default/widgets/new_users/content.php new file mode 100644 index 000000000..ba85e7421 --- /dev/null +++ b/views/default/widgets/new_users/content.php @@ -0,0 +1,11 @@ +<?php +/** + * New users admin widget + */ + +echo elgg_list_entities(array( + 'type' => 'user', + 'subtype'=> null, + 'full_view' => false, + 'pagination' => false, +));
\ No newline at end of file diff --git a/views/default/widgets/new_users/edit.php b/views/default/widgets/new_users/edit.php new file mode 100644 index 000000000..ed07213cb --- /dev/null +++ b/views/default/widgets/new_users/edit.php @@ -0,0 +1,23 @@ +<?php +/** + * New users widget edit view + */ + + +// set default value +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 5; +} + +$params = array( + 'name' => 'params[num_display]', + 'value' => $vars['entity']->num_display, + 'options' => array(5, 8, 10, 12, 15, 20), +); +$dropdown = elgg_view('input/dropdown', $params); + +?> +<p> + <?php echo elgg_echo('widget:numbertodisplay'); ?>: + <?php echo $dropdown; ?> +</p> diff --git a/views/default/widgets/online_users/content.php b/views/default/widgets/online_users/content.php new file mode 100644 index 000000000..6e0cc7abb --- /dev/null +++ b/views/default/widgets/online_users/content.php @@ -0,0 +1,15 @@ +<?php +/** + * Online users widget + */ + +$count = find_active_users(600, 10, 0, true); +$objects = find_active_users(600, 10); + +if ($objects) { + echo elgg_view_entity_list($objects, array( + 'count' => $count, + 'limit' => 10, + 'pagination' => false, + )); +} diff --git a/views/default/widgets/online_users/edit.php b/views/default/widgets/online_users/edit.php new file mode 100644 index 000000000..66f03a745 --- /dev/null +++ b/views/default/widgets/online_users/edit.php @@ -0,0 +1,22 @@ +<?php +/** + * Online users widget edit view + */ + +// set default value +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 8; +} + +$params = array( + 'name' => 'params[num_display]', + 'value' => $vars['entity']->num_display, + 'options' => array(5, 8, 10, 12, 15, 20), +); +$dropdown = elgg_view('input/dropdown', $params); + +?> +<p> + <?php echo elgg_echo('widget:numbertodisplay'); ?>: + <?php echo $dropdown; ?> +</p> diff --git a/views/default/widgets/river_widget/content.php b/views/default/widgets/river_widget/content.php new file mode 100644 index 000000000..867fc9db6 --- /dev/null +++ b/views/default/widgets/river_widget/content.php @@ -0,0 +1,27 @@ +<?php +/** + * Activity widget content view + */ + +$num = (int) $vars['entity']->num_display; + +$options = array( + 'limit' => $num, + 'pagination' => false, +); + +if (elgg_in_context('dashboard')) { + if ($vars['entity']->content_type == 'friends') { + $options['relationship_guid'] = elgg_get_page_owner_guid(); + $options['relationship'] = 'friend'; + } +} else { + $options['subject_guid'] = elgg_get_page_owner_guid(); +} + +$content = elgg_list_river($options); +if (!$content) { + $content = elgg_echo('river:none'); +} + +echo $content; diff --git a/views/default/widgets/river_widget/edit.php b/views/default/widgets/river_widget/edit.php new file mode 100644 index 000000000..228212e47 --- /dev/null +++ b/views/default/widgets/river_widget/edit.php @@ -0,0 +1,58 @@ +<?php +/** + * Edit settings for river widget + */ + +// dashboard widget has type parameter +if (elgg_in_context('dashboard')) { + if (!isset($vars['entity']->content_type)) { + $vars['entity']->content_type = 'friends'; + } + $params = array( + 'name' => 'params[content_type]', + 'value' => $vars['entity']->content_type, + 'options_values' => array( + 'friends' => elgg_echo('river:widgets:friends'), + 'all' => elgg_echo('river:widgets:all'), + ), + ); + $type_dropdown = elgg_view('input/dropdown', $params); + ?> + <div> + <?php echo elgg_echo('river:widget:type'); ?>: + <?php echo $type_dropdown; ?> + </div> + <?php +} + + +// set default value for number to display +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 8; +} + +$params = array( + 'name' => 'params[num_display]', + 'value' => $vars['entity']->num_display, + 'options' => array(5, 8, 10, 12, 15, 20), +); +$num_dropdown = elgg_view('input/dropdown', $params); + +?> +<div> + <?php echo elgg_echo('widget:numbertodisplay'); ?>: + <?php echo $num_dropdown; ?> +</div> + +<?php +// pass the context so we have the correct output upon save. +if (elgg_in_context('dashboard')) { + $context = 'dashboard'; +} else { + $context = 'profile'; +} + +echo elgg_view('input/hidden', array( + 'name' => 'context', + 'value' => $context +));
\ No newline at end of file diff --git a/views/default/widgets/settings.php b/views/default/widgets/settings.php deleted file mode 100644 index 5814e5821..000000000 --- a/views/default/widgets/settings.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * Elgg widget edit settings - * - * @package Elgg - * @subpackage Core - */ - -$widget = $vars['widget']; - -$edit_view = "widgets/$widget->handler/edit"; -$custom_form_section = elgg_view($edit_view, array('entity' => $widget)); - -$access_label = elgg_echo('access'); -$access = elgg_view('input/access', array('internalname' => 'params[access_id]','value' => $widget->access_id)); -$access_html = "<p><label>$access_label:</label> $access</p>"; - -$hidden = elgg_view('input/hidden', array('internalname' => 'guid', 'value' => $widget->guid)); -$submit = elgg_view('input/submit', array('value' => elgg_echo('save'))); - -// dashboard widgets do not get access controls -if (elgg_in_context('dashboard')) { - $access = ''; -} - -$body = <<<___END - $custom_form_section - $access - <p> - $hidden - $submit - </p> -___END; - -?> -<div class="widget-edit"> -<?php -$params = array( - 'body' => $body, - 'action' => "action/widgets/save" -); -echo elgg_view('input/form', $params); -?> -</div> diff --git a/views/default/widgets/wrapper.php b/views/default/widgets/wrapper.php deleted file mode 100644 index 5c71aa8f8..000000000 --- a/views/default/widgets/wrapper.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * Elgg widget wrapper - * - * @package Elgg - * @subpackage Core - */ - -$widget = $vars['entity']; -if (!elgg_instanceof($widget, 'object', 'widget')) { - return true; -} - -// @todo catch for disabled plugins -$widgettypes = elgg_get_widget_types('all'); - -$handler = $widget->handler; - -$title = $widget->getTitle(); - -$can_edit = $widget->canEdit(); - -$widget_id = "widget-$widget->guid"; -$widget_instance = "widget-instance-$handler"; - -?> -<div class="widget draggable <?php echo $widget_instance?>" id="<?php echo $widget_id; ?>"> - <div class="widget-title drag-handle"> - <h3><?php echo $title; ?></h3> - </div> - <?php - if ($can_edit) { - echo elgg_view('widgets/controls', array('widget' => $widget)); - } - ?> - <div class="widget-container"> - <?php - if ($can_edit) { - echo elgg_view('widgets/settings', array('widget' => $widget)); - } - ?> - <div class="widget-content"> - <?php - if (elgg_view_exists("widgets/$handler/content")) { - echo elgg_view("widgets/$handler/content", $vars); - } else { - elgg_deprecated_notice("widgets use content as the display view", 1.8); - echo elgg_view("widgets/$handler/view", $vars); - } - ?> - </div> - </div> -</div> diff --git a/views/failsafe/canvas/default.php b/views/failsafe/canvas/default.php deleted file mode 100644 index 4b8d12e6d..000000000 --- a/views/failsafe/canvas/default.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ - -for ($i = 1; $i < 8; $i++) { - if (isset($vars["area{$i}"])) { - echo $vars["area{$i}"]; - } -}
\ No newline at end of file diff --git a/views/failsafe/messages/exceptions/admin_exception.php b/views/failsafe/messages/exceptions/admin_exception.php new file mode 100644 index 000000000..57665d9c0 --- /dev/null +++ b/views/failsafe/messages/exceptions/admin_exception.php @@ -0,0 +1,30 @@ +<?php +/** + * Elgg exception (failsafe mode) + * Displays a single exception + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['object'] An exception + */ + +?> + +<p class="elgg-messages-exception"> + <span title="<?php echo get_class($vars['object']); ?>"> + <?php + + echo nl2br($vars['object']->getMessage()); + + ?> + </span> +</p> + +<p class="elgg-messages-exception"> + <?php + + echo nl2br(htmlentities(print_r($vars['object'], true), ENT_QUOTES, 'UTF-8')); + + ?> +</p>
\ No newline at end of file diff --git a/views/failsafe/messages/exceptions/exception.php b/views/failsafe/messages/exceptions/exception.php index e14eb629d..1873ca0d9 100644 --- a/views/failsafe/messages/exceptions/exception.php +++ b/views/failsafe/messages/exceptions/exception.php @@ -11,28 +11,10 @@ ?> -<p class="messages_exception"> - <span title="<?php echo get_class($vars['object']); ?>"> - <?php - - echo nl2br($vars['object']->getMessage()); - - ?> +<p class="elgg-messages-exception"> + <span title="Unrecoverable Error"> + <?php echo elgg_echo('exception:contact_admin'); ?> + <br /><br /> + Exception #<?php echo $vars['ts']; ?>. </span> </p> - -<?php -global $CONFIG; -if (isset($CONFIG->debug)) { -?> - -<p class="messages_exception"> - <?php - - echo nl2br(htmlentities(print_r($vars['object'], true), ENT_QUOTES, 'UTF-8')); - - ?> -</p> -<?php - -} diff --git a/views/failsafe/page_shells/default.php b/views/failsafe/page/default.php index 0ce63cc1d..6d628ebbb 100644 --- a/views/failsafe/page_shells/default.php +++ b/views/failsafe/page/default.php @@ -33,7 +33,7 @@ header('Content-type: text/html; charset=utf-8'); p { margin: 0px 0px 15px 0; } - #wrapper { + #elgg-wrapper { background:white; width:570px; margin:auto; @@ -43,7 +43,7 @@ header('Content-type: text/html; charset=utf-8'); border-right: 1px solid #666666; border-bottom: 1px solid #666666; } - .messages_exception { + .elgg-messages-exception { background:#FDFFC3; display:block; padding:10px; @@ -52,7 +52,7 @@ header('Content-type: text/html; charset=utf-8'); </head> <body> - <div id="wrapper"> + <div id="elgg-wrapper"> <h1><?php echo $vars['title']; ?></h1> <?php echo $vars['body']; ?> </div> diff --git a/views/foaf/canvas/default.php b/views/foaf/canvas/default.php deleted file mode 100644 index 4b8d12e6d..000000000 --- a/views/foaf/canvas/default.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ - -for ($i = 1; $i < 8; $i++) { - if (isset($vars["area{$i}"])) { - echo $vars["area{$i}"]; - } -}
\ No newline at end of file diff --git a/views/foaf/page_shells/default.php b/views/foaf/page/default.php index 7bd69b875..fad46ed35 100644 --- a/views/foaf/page_shells/default.php +++ b/views/foaf/page/default.php @@ -1,10 +1,12 @@ <?php /** - * Elgg XML output pageshell + * FOAF pageshell * * @package Elgg * @subpackage Core * + * // @todo removed below because blog is a plugin + * <foaf:weblog rdf:resource="<?php echo elgg_get_site_url(); ?>blog/<?php echo $owner->username; ?>" /> */ header("Content-Type: text/xml"); @@ -12,11 +14,11 @@ header("Content-Type: text/xml"); echo "<?xml version='1.0'?>\n"; -if (!$owner = elgg_get_page_owner()) { - if (!isloggedin()) { +if (!$owner = elgg_get_page_owner_entity()) { + if (!elgg_is_logged_in()) { exit; } else { - $owner = get_loggedin_user(); + $owner = elgg_get_logged_in_user_entity(); } } @@ -39,10 +41,7 @@ if (!$owner = elgg_get_page_owner()) { <foaf:nick><?php echo $owner->username; ?></foaf:nick> <foaf:name><?php echo $owner->name; ?></foaf:name> <foaf:homepage rdf:resource="<?php echo $owner->getURL(); ?>" /> - <foaf:depiction rdf:resource="<?php echo elgg_format_url($owner->getIcon('large')); ?>" /> - <foaf:weblog rdf:resource="<?php echo elgg_get_site_url(); ?>pg/blog/<?php echo $owner->username; ?>" /> - <?php - echo $vars['body']; - ?> + <foaf:depiction rdf:resource="<?php echo elgg_format_url($owner->getIconURL('large')); ?>" /> +<?php echo $vars['body']; ?> </foaf:Person> </rdf:RDF> diff --git a/views/foaf/page_elements/contentwrapper.php b/views/foaf/page_elements/contentwrapper.php deleted file mode 100644 index 643492a92..000000000 --- a/views/foaf/page_elements/contentwrapper.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * - * @package Elgg - * @subpackage Core - */ - -echo $vars['body'];
\ No newline at end of file diff --git a/views/foaf/search/entity_list.php b/views/foaf/search/entity_list.php deleted file mode 100644 index b786865d7..000000000 --- a/views/foaf/search/entity_list.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ -$entities = $vars['entities']; -if (is_array($entities) && sizeof($entities) > 0) { - foreach($entities as $entity) { - echo elgg_view_entity($entity); - } -}
\ No newline at end of file diff --git a/views/foaf/user/default.php b/views/foaf/user/default.php index 3be763a73..dcba55562 100644 --- a/views/foaf/user/default.php +++ b/views/foaf/user/default.php @@ -6,7 +6,8 @@ * @subpackage Core */ -$friends=get_user_friends(elgg_get_page_owner_guid(), $subtype = "", $limit = 10000, $offset = 0); +// @todo update when get_user_friends is deprecated in 1.9 +$friends = get_user_friends(elgg_get_page_owner_guid(), $subtype = "", $limit = 10000, $offset = 0); foreach ($friends as $friend) { ?> @@ -15,7 +16,7 @@ foreach ($friends as $friend) { <foaf:Person> <foaf:nick><?php echo $friend->username; ?></foaf:nick> <foaf:name><?php echo $friend->name; ?></foaf:name> - <rdfs:seeAlso rdf:resource="<?php echo elgg_get_site_url() . "pg/profile/" . $friend->username . "?view=foaf" ?>" /> + <rdfs:seeAlso rdf:resource="<?php echo $friend->getURL() . "?view=foaf" ?>" /> </foaf:Person> </foaf:knows> diff --git a/views/ical/canvas/default.php b/views/ical/canvas/default.php deleted file mode 100644 index 833b46e74..000000000 --- a/views/ical/canvas/default.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -/** - * Elgg ICAL output - * - * @package Elgg - * @subpackage Core - * - */ - -for ($i = 1; $i < 8; $i++) { - if (isset($vars["area{$i}"])) { - echo $vars["area{$i}"]; - } -}
\ No newline at end of file diff --git a/views/ical/export/entity.php b/views/ical/export/entity.php index caa60c7a5..eaa3b56d8 100644 --- a/views/ical/export/entity.php +++ b/views/ical/export/entity.php @@ -9,23 +9,25 @@ $entity = $vars['entity']; -if ( - ($entity instanceof Notable) && - ($entity->getCalendarStartTime()) && - ($entity->getCalendarEndTime()) -) -{ -?> +if ($entity instanceof Notable && + $entity->getCalendarStartTime() && + $entity->getCalendarEndTime()) { + + $timestamp = date("Ymd\THis\Z", $entity->getTimeCreated()); + $start = date("Ymd\THis\Z", $entity->getCalendarStartTime()); + $end = date("Ymd\THis\Z", $entity->getCalendarEndTime()); + $summary = $entity->title; + $modified = date("Ymd\THis\Z", $entity->getTimeUpdated()); + + echo <<< ICAL BEGIN:VEVENT -DTSTAMP:<?php echo date("Ymd\THis\Z", $entity->getTimeCreated()); ?> -DTSTART:<?php echo date("Ymd\THis\Z", $entity->getCalendarStartTime()); ?> -DTEND:<?php echo date("Ymd\THis\Z", $entity->getCalendarEndTime()); ?> -SUMMARY:<?php echo $event->title; ?> -LAST-MODIFIED:<?php echo date("Ymd\THis\Z", $entity->getTimeUpdated()); ?> +DTSTAMP:$timestamp +DTSTART:$start +DTEND:$end +SUMMARY:$summary +LAST-MODIFIED:$modified END:VEVENT -<?php -} -?> - if ( - )
\ No newline at end of file +ICAL; + +} diff --git a/views/ical/object/default.php b/views/ical/object/default.php index 678676133..77183bb8a 100644 --- a/views/ical/object/default.php +++ b/views/ical/object/default.php @@ -7,4 +7,4 @@ * */ -elgg_view('export/entity', $vars);
\ No newline at end of file +echo elgg_view('export/entity', $vars);
\ No newline at end of file diff --git a/views/ical/pageshells/pageshell.php b/views/ical/page/default.php index 9a529b24f..01bd9e86e 100644 --- a/views/ical/pageshells/pageshell.php +++ b/views/ical/page/default.php @@ -7,12 +7,13 @@ * */ +$site = elgg_get_site_entity(); + header("Content-Type: text/calendar"); -echo $vars['body']; ?> BEGIN:VCALENDAR VERSION:2.0 -PRODID:-//Curverider Ltd//NONSGML Elgg <?php echo get_version(true); ?>//EN +PRODID:-//Elgg//NONSGML <?php echo $site->name; ?>//EN <?php echo $vars['body']; ?> END:VCALENDAR diff --git a/views/ical/search/entity_list.php b/views/ical/search/entity_list.php deleted file mode 100644 index 38c19fbb7..000000000 --- a/views/ical/search/entity_list.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ - -$entities = $vars['entities']; -if (is_array($entities) && sizeof($entities) > 0) { - foreach($entities as $entity) - echo elgg_view_entity($entity); -}
\ No newline at end of file diff --git a/views/installation/canvas/default.php b/views/installation/canvas/default.php deleted file mode 100644 index 4b8d12e6d..000000000 --- a/views/installation/canvas/default.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ - -for ($i = 1; $i < 8; $i++) { - if (isset($vars["area{$i}"])) { - echo $vars["area{$i}"]; - } -}
\ No newline at end of file diff --git a/views/installation/install/forms/template.php b/views/installation/forms/install/template.php index 626bfc6c8..a01914f12 100644 --- a/views/installation/install/forms/template.php +++ b/views/installation/forms/install/template.php @@ -13,30 +13,18 @@ $form_body = ''; foreach ($variables as $field => $params) { $label = elgg_echo("install:$type:label:$field"); $help = elgg_echo("install:$type:help:$field"); - $params['internalname'] = $field; + $params['name'] = $field; - $form_body .= '<p>'; + $form_body .= '<div>'; $form_body .= "<label>$label</label>"; $form_body .= elgg_view("input/{$params['type']}", $params); $form_body .= "<span class=\"install-help\">$help</span>"; - $form_body .= '</p>'; + $form_body .= '</div>'; } $submit_params = array( - 'value' => elgg_echo('next'), + 'value' => elgg_echo('install:next'), ); $form_body .= elgg_view('input/submit', $submit_params); echo $form_body; - -?> -<script type="text/javascript"> - var was_submitted = false; - function elggCheckFormSubmission() { - if (was_submitted == false) { - was_submitted = true; - return true; - } - return false; - } -</script> diff --git a/views/installation/input/access.php b/views/installation/input/access.php index 51b8dfa00..c3d4713bc 100644 --- a/views/installation/input/access.php +++ b/views/installation/input/access.php @@ -1,23 +1,14 @@ <?php /** * Elgg access level input - * Displays a pulldown input field - * - * @package Elgg - * @subpackage Core + * Displays a dropdown input field * * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field + * @uses $vars['name'] The name of the input field * */ -if (isset($vars['class'])) { - $class = $vars['class']; -} -if (!$class) { - $class = "input-access"; -} +$class = "elgg-input-access"; if ((!isset($vars['options'])) || (!is_array($vars['options']))) { $vars['options'] = array(); @@ -28,7 +19,7 @@ if (is_array($vars['options']) && sizeof($vars['options']) > 0) { ?> - <select name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['js'])) echo $vars['js']; ?> <?php if ((isset($vars['disabled'])) && ($vars['disabled'])) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>"> + <select name="<?php echo $vars['name']; ?>" class="<?php echo $class; ?>"> <?php foreach($vars['options'] as $key => $option) { @@ -44,4 +35,4 @@ if (is_array($vars['options']) && sizeof($vars['options']) > 0) { <?php -}
\ No newline at end of file +} diff --git a/views/installation/input/button.php b/views/installation/input/button.php index 759752c8c..ec90fed9d 100644 --- a/views/installation/input/button.php +++ b/views/installation/input/button.php @@ -1,25 +1,22 @@ <?php /** * Create a input button - * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides - * extra security which help prevent CSRF attacks. - * - * @package Elgg - * @subpackage Core * * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['type'] Submit or reset, defaults to submit. - * @uses $vars['src'] Src of an image - * + * @uses $vars['name'] The name of the input field + * @uses $vars['type'] submit or button. */ -global $CONFIG; +if (isset($vars['class'])) { + $class = $vars['class']; +} else { + $class = "elgg-button-submit"; +} -$class = $vars['class']; -if (!$class) { - $class = "submit-button"; +if (isset($vars['name'])) { + $name = $vars['name']; +} else { + $name = ''; } if (isset($vars['type'])) { @@ -32,20 +29,12 @@ switch ($type) { case 'button' : $type='button'; break; - case 'reset' : - $type='reset'; - break; case 'submit': default: $type = 'submit'; } $value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); -$name = $vars['internalname']; -$src = $vars['src']; -// blank src if trying to access an offsite image. -if (strpos($src,elgg_get_site_url())===false) { - $src = ""; -} + ?> -<input type="<?php echo $type; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\"";?> <?php echo $vars['js']; ?> value="<?php echo $value; ?>" src="<?php echo $src; ?>" class="<?php echo $class; ?>" />
\ No newline at end of file +<input type="<?php echo $type; ?>" value="<?php echo $value; ?>" class="<?php echo $class; ?>" />
\ No newline at end of file diff --git a/views/installation/input/checkbox.php b/views/installation/input/checkbox.php new file mode 100644 index 000000000..6fbe25169 --- /dev/null +++ b/views/installation/input/checkbox.php @@ -0,0 +1,24 @@ +<?php +/** + * Elgg checkbox input + * Displays a checkbox input tag + * + * @uses $var['name'] + * @uses $vars['value'] + * @uses $vars['class'] + */ + + +if (isset($vars['class'])) { + $id = "class=\"{$vars['class']}\""; +} else { + $id = ''; +} + +if (!isset($vars['value'])) { + $vars['value'] = $vars['name']; +} + +?> + +<input type="checkbox" <?php echo $class; ?> name="<?php echo $vars['name']; ?>" value="<?php echo $vars['value']; ?>" />
\ No newline at end of file diff --git a/views/installation/input/checkboxes.php b/views/installation/input/checkboxes.php deleted file mode 100644 index d4e1b494d..000000000 --- a/views/installation/input/checkboxes.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Elgg checkbox input - * Displays a checkbox input field - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['options'] An array of strings representing the options for the checkbox field - * - */ - -$class = $vars['class']; -if (!$class) { - $class = "input-checkboxes"; -} - -foreach($vars['options'] as $label => $option) { - //if (!in_array($option,$vars['value'])) { - if (is_array($vars['value'])) { - if (!in_array($option,$vars['value'])) { - $selected = ""; - } else { - $selected = "checked = \"checked\""; - } - } else { - if ($option != $vars['value']) { - $selected = ""; - } else { - $selected = "checked = \"checked\""; - } - } - - // handle indexed array where label is not specified - // @todo deprecate in Elgg 1.8 - if (is_integer($label)) { - $label = $option; - } - - $disabled = ""; - if ($vars['disabled']) { - $disabled = ' disabled="yes" '; - } - echo "<label><input type=\"checkbox\" $disabled {$vars['js']} name=\"{$vars['internalname']}[]\" {$selected} value=\"".htmlentities($option, ENT_QUOTES, 'UTF-8')."\" {$selected} class=\"$class\" />{$label}</label><br />"; -}
\ No newline at end of file diff --git a/views/installation/input/combo.php b/views/installation/input/combo.php new file mode 100644 index 000000000..508dbcd01 --- /dev/null +++ b/views/installation/input/combo.php @@ -0,0 +1,19 @@ +<?php +/** + * Combination of text box and check box. When the checkbox is checked, the + * text field is cleared and disabled. + * + */ + +$label = elgg_echo('install:label:combo:' . $vars['name']); + +$vars['class'] = "elgg-combo-text"; +echo elgg_view('input/text', $vars); + +$vars['class'] = "elgg-combo-checkbox"; +$vars['value'] = "{$vars['name']}-checkbox"; +echo elgg_view('input/checkbox', $vars); + +echo "<label class=\"elgg-combo-label\">$label</label>"; + +echo '<div class="clearfloat"></div>';
\ No newline at end of file diff --git a/views/installation/input/pulldown.php b/views/installation/input/dropdown.php index 70e961c4d..cf875492e 100644 --- a/views/installation/input/pulldown.php +++ b/views/installation/input/dropdown.php @@ -1,29 +1,22 @@ <?php /** - * Elgg pulldown input - * Displays a pulldown input field - * - * @package Elgg - * @subpackage Core + * Elgg dropdown input + * Displays a dropdown input field * * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['options'] An array of strings representing the options for the pulldown field + * @uses $vars['name'] The name of the input field + * @uses $vars['options'] An array of strings representing the options for the dropdown field * @uses $vars['options_values'] An associative array of "value" => "option" where "value" is an internal name and "option" is * the value displayed on the button. Replaces $vars['options'] when defined. */ +$class = "elgg-input-dropdown"; -$class = $vars['class']; -if (!$class) { - $class = "input-pulldown"; -} ?> -<select name="<?php echo $vars['internalname']; ?>" <?php echo $vars['js']; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>"> +<select name="<?php echo $vars['name']; ?>" class="<?php echo $class; ?>"> <?php -if ($vars['options_values']) { - foreach($vars['options_values'] as $value => $option) { +if (isset($vars['options_values'])) { + foreach ($vars['options_values'] as $value => $option) { if ($value != $vars['value']) { echo "<option value=\"$value\">{$option}</option>"; } else { @@ -31,7 +24,7 @@ if ($vars['options_values']) { } } } else { - foreach($vars['options'] as $option) { + foreach ($vars['options'] as $option) { if ($option != $vars['value']) { echo "<option>{$option}</option>"; } else { @@ -40,4 +33,4 @@ if ($vars['options_values']) { } } ?> -</select>
\ No newline at end of file +</select> diff --git a/views/installation/input/form.php b/views/installation/input/form.php index a4707f257..3556413a8 100644 --- a/views/installation/input/form.php +++ b/views/installation/input/form.php @@ -1,36 +1,21 @@ <?php /** * Create a form for data submission. - * Use this view for forms rather than creating a form tag in the wild as it provides - * extra security which help prevent CSRF attacks. * - * @package Elgg - * @subpackage Core - * - * @uses $vars['body'] The body of the form (made up of other input/xxx views and html - * @uses $vars['method'] Method (default POST) - * @uses $vars['enctype'] How the form is encoded, default blank + * @uses $vars['body'] The body of the form (made up of other input/xxx views and html * @uses $vars['action'] URL of the action being called - * + * @uses $vars['method'] Method (default POST) + * @uses $vars['name'] Form name */ -if (isset($vars['internalid'])) { - $id = $vars['internalid']; -} else { - $id = ''; -} -if (isset($vars['internalname'])) { - $name = $vars['internalname']; +if (isset($vars['name'])) { + $name = "name=\"{$vars['name']}\""; } else { $name = ''; } + $body = $vars['body']; $action = $vars['action']; -if (isset($vars['enctype'])) { - $enctype = $vars['enctype']; -} else { - $enctype = ''; -} if (isset($vars['method'])) { $method = $vars['method']; } else { @@ -39,13 +24,7 @@ if (isset($vars['method'])) { $method = strtolower($method); -// Generate a security header -$security_header = ""; -if (!isset($vars['disable_security']) || $vars['disable_security'] != true) { - $security_header = elgg_view('input/securitytoken'); -} ?> -<form <?php if ($id) { ?>id="<?php echo $id; ?>" <?php } ?> <?php if ($name) { ?>name="<?php echo $name; ?>" <?php } ?> action="<?php echo $action; ?>" method="<?php echo $method; ?>" <?php if ($enctype!="") echo "enctype=\"$enctype\""; ?> <?php echo $vars['js']; ?>> -<?php echo $security_header; ?> +<form <?php echo $name; ?> action="<?php echo $action; ?>" method="<?php echo $method; ?>"> <?php echo $body; ?> </form>
\ No newline at end of file diff --git a/views/installation/input/hidden.php b/views/installation/input/hidden.php deleted file mode 100644 index 7a0798e48..000000000 --- a/views/installation/input/hidden.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Create a hidden data field - * Use this view for forms rather than creating a hidden tag in the wild as it provides - * extra security which help prevent CSRF attacks. - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * - */ -?> -<input type="hidden" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" />
\ No newline at end of file diff --git a/views/installation/input/longtext.php b/views/installation/input/longtext.php deleted file mode 100644 index c7e465e9f..000000000 --- a/views/installation/input/longtext.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Elgg long text input - * Displays a long text input field - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * - */ - -$class = $vars['class']; -if (!$class) { - $class = "input-textarea"; -} - -?> - -<textarea class="<?php echo $class; ?>" name="<?php echo $vars['internalname']; ?>" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?>><?php echo $vars['value']; ?></textarea>
\ No newline at end of file diff --git a/views/installation/input/password.php b/views/installation/input/password.php index 541728ee3..2265ab117 100644 --- a/views/installation/input/password.php +++ b/views/installation/input/password.php @@ -3,19 +3,15 @@ * Elgg password input * Displays a password input field * - * @package Elgg - * @subpackage Core - * * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field + * @uses $vars['name'] The name of the input field * */ -$class = $vars['class']; -if (!$class) { - $class = "input-password"; -} +$class = "input-password"; + +$value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); + ?> -<input type="password" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>" /> +<input type="password" name="<?php echo $vars['name']; ?>" value="<?php echo $value; ?>" class="<?php echo $class; ?>" /> diff --git a/views/installation/input/reset.php b/views/installation/input/reset.php deleted file mode 100644 index 0c83a92ca..000000000 --- a/views/installation/input/reset.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Create a reset input button - * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides - * extra security which help prevent CSRF attacks. - * - * @package Elgg - * @subpackage Core - */ - -$vars['type'] = 'reset'; - -echo elgg_view('input/button', $vars);
\ No newline at end of file diff --git a/views/installation/input/securitytoken.php b/views/installation/input/securitytoken.php deleted file mode 100644 index 9a8cb1ebe..000000000 --- a/views/installation/input/securitytoken.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -/** - * CSRF security token view for use with secure forms. - * - * It is still recommended that you use input/form. - * - * @package Elgg - * @subpackage Core - */ - -$ts = time(); -$token = generate_action_token($ts); - -echo elgg_view('input/hidden', array('internalname' => '__elgg_token', 'value' => $token)); -echo elgg_view('input/hidden', array('internalname' => '__elgg_ts', 'value' => $ts)); diff --git a/views/installation/input/submit.php b/views/installation/input/submit.php index aefb2ada6..5d891c380 100644 --- a/views/installation/input/submit.php +++ b/views/installation/input/submit.php @@ -1,11 +1,9 @@ <?php /** * Create a submit input button - * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides - * extra security which help prevent CSRF attacks. * - * @package Elgg - * @subpackage Core + * @uses $vars['value'] The current value, if any + * @uses $vars['name'] The name of the input field */ $vars['type'] = 'submit'; diff --git a/views/installation/input/text.php b/views/installation/input/text.php index 73801dcf7..375b91c44 100644 --- a/views/installation/input/text.php +++ b/views/installation/input/text.php @@ -3,22 +3,18 @@ * Elgg text input * Displays a text input field * - * @package Elgg - * @subpackage Core - - - * * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['disabled'] If true then control is read-only - * @uses $vars['class'] Class override + * @uses $vars['name'] The name of the input field + * @uses $vars['class'] CSS class */ -$class = $vars['class']; -if (!$class) { - $class = "input-text"; +if (isset($vars['class'])) { + $class = "class=\"{$vars['class']}\""; +} else { + $class = "elgg-input-text"; } +$value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); + ?> -<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class ?>"/>
\ No newline at end of file +<input type="text" name="<?php echo $vars['name']; ?>" value="<?php echo $value; ?>" <?php echo $class; ?> />
\ No newline at end of file diff --git a/views/installation/install/footer.php b/views/installation/install/footer.php deleted file mode 100644 index 69cd27f66..000000000 --- a/views/installation/install/footer.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php -/** - * Install footer - offers help links - */ -?> -<ul> - <li><a href="http://docs.elgg.org/wiki/Installation">Install instructions</a></li> - <li><a href="http://docs.elgg.org/wiki/Install_Troubleshooting">Install troubleshooting</a></li> - <li><a href="http://community.elgg.org/pg/groups/world/">Elgg community forums</a></li> -</ul>
\ No newline at end of file diff --git a/views/installation/install/forms/admin.php b/views/installation/install/forms/admin.php deleted file mode 100644 index 1ecb389a3..000000000 --- a/views/installation/install/forms/admin.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Admin account form - * - * @uses $vars['variables'] Array of form variables. See ElggInstaller. - */ - -$vars['type'] = 'admin'; -$form_body = elgg_view('install/forms/template', $vars); - -$url = current_page_url(); - -$params = array( - 'body' => $form_body, - 'action' => $url, - 'disable_security' => TRUE, - 'js' => 'onsubmit="return elggCheckFormSubmission()"', -); -echo elgg_view('input/form', $params); diff --git a/views/installation/install/forms/database.php b/views/installation/install/forms/database.php deleted file mode 100644 index 0e798db09..000000000 --- a/views/installation/install/forms/database.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Database form - * - * @uses $vars['variables'] Array of form variables. See ElggInstaller. - */ - -$vars['type'] = 'database'; -$form_body = elgg_view('install/forms/template', $vars); - -$url = current_page_url(); - -$params = array( - 'body' => $form_body, - 'action' => $url, - 'disable_security' => TRUE, - 'js' => 'onsubmit="return elggCheckFormSubmission()"', -); -echo elgg_view('input/form', $params); diff --git a/views/installation/install/forms/settings.php b/views/installation/install/forms/settings.php deleted file mode 100644 index e9a818b92..000000000 --- a/views/installation/install/forms/settings.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Site settings form - * - * @uses $vars['variables'] Array of form variables. See ElggInstaller. - */ - -$vars['type'] = 'settings'; -$form_body = elgg_view('install/forms/template', $vars); - -$url = current_page_url(); - -$params = array( - 'body' => $form_body, - 'action' => $url, - 'disable_security' => TRUE, - 'js' => 'onsubmit="return elggCheckFormSubmission()"', -); -echo elgg_view('input/form', $params); diff --git a/views/installation/install/js_rewrite_check.php b/views/installation/install/js_rewrite_check.php new file mode 100644 index 000000000..04d81171d --- /dev/null +++ b/views/installation/install/js_rewrite_check.php @@ -0,0 +1,12 @@ +<?php +/** + * Some servers don't allow PHP to check the rewrite, so try via AJAX + */ +?> +<script type="text/javascript"> + elgg.installer.rewriteTest( + '<?php echo $vars['url'];?>', + '<?php echo elgg_echo('install:check:rewrite:success'); ?>', + '<?php echo $vars['config']->wwwroot; ?>install.php?step=database' + ); +</script>
\ No newline at end of file diff --git a/views/installation/install/nav.php b/views/installation/install/nav.php index 1ecc07d1c..c150cb2cb 100644 --- a/views/installation/install/nav.php +++ b/views/installation/install/nav.php @@ -12,22 +12,22 @@ // has a refresh button been requested $refresh = ''; if (isset($vars['refresh']) && $vars['refresh']) { - $refresh_text = elgg_echo('Refresh'); + $refresh_text = elgg_echo('install:refresh'); $refresh = "<a href=\"\">$refresh_text</a>"; } // create next button and selectively disable -$next_text = elgg_echo('next'); +$next_text = elgg_echo('install:next'); $next_link = elgg_get_site_url()."install.php?step={$vars['next_step']}"; $next = "<a href=\"$next_link\">$next_text</a>"; if (isset($vars['advance']) && !$vars['advance']) { // disable the next button - $next = "<a class=\"disabled\">$next_text</a>"; + $next = "<a class=\"elgg-state-disabled\">$next_text</a>"; } echo <<<___END -<div class="install-nav"> +<div class="elgg-install-nav"> $next $refresh </div> diff --git a/views/installation/install/pages/admin.php b/views/installation/install/pages/admin.php index 1fdd5dced..e810aa701 100644 --- a/views/installation/install/pages/admin.php +++ b/views/installation/install/pages/admin.php @@ -3,6 +3,15 @@ * Install create admin account page */ -echo autop(elgg_echo('install:admin:instructions')); +echo elgg_autop(elgg_echo('install:admin:instructions')); -echo elgg_view('install/forms/admin', $vars); +$vars['type'] = 'admin'; + +$url = current_page_url(); + +$form_vars = array( + 'action' => $url, + 'disable_security' => TRUE, +); + +echo elgg_view_form('install/template', $form_vars, $vars); diff --git a/views/installation/install/pages/complete.php b/views/installation/install/pages/complete.php index 0c9821fc2..80f8e7434 100644 --- a/views/installation/install/pages/complete.php +++ b/views/installation/install/pages/complete.php @@ -3,11 +3,11 @@ * Install completion page */ -echo autop(elgg_echo('install:complete:instructions')); +echo elgg_autop(elgg_echo('install:complete:instructions')); ?> -<div class="install-nav"> +<div class="elgg-install-nav"> <?php $url = elgg_get_site_url() . $vars['destination']; $text = elgg_echo('install:complete:gotosite'); diff --git a/views/installation/install/pages/database.php b/views/installation/install/pages/database.php index 7765c6e48..d24b4f57b 100644 --- a/views/installation/install/pages/database.php +++ b/views/installation/install/pages/database.php @@ -6,11 +6,21 @@ */ if (isset($vars['failure']) && $vars['failure']) { - echo autop(elgg_echo('install:database:error')); + echo elgg_autop(elgg_echo('install:database:error')); $vars['refresh'] = TRUE; $vars['advance'] = FALSE; echo elgg_view('install/nav', $vars); } else { - echo autop(elgg_echo('install:database:instructions')); - echo elgg_view('install/forms/database', $vars); + echo elgg_autop(elgg_echo('install:database:instructions')); + + $vars['type'] = 'database'; + + $url = current_page_url(); + + $form_vars = array( + 'action' => $url, + 'disable_security' => TRUE, + ); + + echo elgg_view_form('install/template', $form_vars, $vars); }
\ No newline at end of file diff --git a/views/installation/install/pages/requirements.php b/views/installation/install/pages/requirements.php index b6516840f..3f0941c95 100644 --- a/views/installation/install/pages/requirements.php +++ b/views/installation/install/pages/requirements.php @@ -14,26 +14,26 @@ if ($vars['num_failures'] != 0) { $instruct_text = elgg_echo('install:requirements:instructions:success'); } -echo autop($instruct_text); +echo elgg_autop($instruct_text); $report = $vars['report']; foreach ($report as $category => $checks) { $title = elgg_echo("install:require:$category"); echo "<h3>$title</h3>"; - echo "<ul>"; + echo "<ul class=\"elgg-require-$category\">"; foreach ($checks as $check) { echo "<li class=\"{$check['severity']}\">"; - echo autop($check['message']); + echo elgg_autop($check['message']); echo "</li>"; } echo "</ul>"; } -$vars['refresh'] = TRUE; +$vars['refresh'] = true; // cannot advance to next step with a failure if ($vars['num_failures'] != 0) { - $vars['advance'] = FALSE; + $vars['advance'] = false; } echo elgg_view('install/nav', $vars); diff --git a/views/installation/install/pages/settings.php b/views/installation/install/pages/settings.php index 6f20573ef..04f23c0ea 100644 --- a/views/installation/install/pages/settings.php +++ b/views/installation/install/pages/settings.php @@ -1,5 +1,14 @@ <?php -echo autop(elgg_echo('install:settings:instructions')); +echo elgg_autop(elgg_echo('install:settings:instructions')); -echo elgg_view('install/forms/settings', $vars); +$vars['type'] = 'settings'; + +$url = current_page_url(); + +$form_vars = array( + 'action' => $url, + 'disable_security' => TRUE, +); + +echo elgg_view_form('install/template', $form_vars, $vars); diff --git a/views/installation/install/pages/welcome.php b/views/installation/install/pages/welcome.php index f069e4ba7..f370c15f3 100644 --- a/views/installation/install/pages/welcome.php +++ b/views/installation/install/pages/welcome.php @@ -3,6 +3,6 @@ * Install welcome page */ -echo autop(elgg_echo('install:welcome:instructions')); +echo elgg_autop(elgg_echo('install:welcome:instructions')); echo elgg_view('install/nav', $vars); diff --git a/views/installation/messages/errors/error.php b/views/installation/messages/errors/error.php deleted file mode 100644 index 296fb1a6e..000000000 --- a/views/installation/messages/errors/error.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -/** - * Elgg error message - * Displays a single error message - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['object'] An error message (string) - */ -?> - -<p> - <?php echo $vars['object']; ?> -</p>
\ No newline at end of file diff --git a/views/installation/messages/errors/list.php b/views/installation/messages/errors/list.php deleted file mode 100644 index 2f69213e9..000000000 --- a/views/installation/messages/errors/list.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -/** - * Elgg list errors - * Lists error messages - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['object'] An array of error messages - */ - -if (!empty($vars['object']) && is_array($vars['object'])) { - -?> - - <div class="messages error"> - -<?php - foreach ($vars['object'] as $error) { - echo elgg_view('messages/errors/error', array('object' => $error)); - } -?> - </div> -<?php -}
\ No newline at end of file diff --git a/views/installation/messages/list.php b/views/installation/messages/list.php deleted file mode 100644 index 2944ce5a6..000000000 --- a/views/installation/messages/list.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Elgg global system message list - * Lists all system messages - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['object'] The array of message registers - */ - -if (!empty($vars['object']) && is_array($vars['object']) && sizeof($vars['object']) > 0) { - foreach($vars['object'] as $register => $list ) { - echo elgg_view("messages/{$register}/list", array('object' => $list)); - } -}
\ No newline at end of file diff --git a/views/installation/messages/messages/list.php b/views/installation/messages/messages/list.php deleted file mode 100644 index bd996bef7..000000000 --- a/views/installation/messages/messages/list.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * Elgg list system messages - * Lists system messages - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['object'] An array of system messages - */ - -if (!empty($vars['object']) && is_array($vars['object'])) { - -?> - - <div class="messages success"> - -<?php - foreach($vars['object'] as $message) { - echo elgg_view('messages/messages/message',array('object' => $message)); - } -?> - - </div> - -<?php - -}
\ No newline at end of file diff --git a/views/installation/messages/messages/message.php b/views/installation/messages/messages/message.php deleted file mode 100644 index 94c9303cd..000000000 --- a/views/installation/messages/messages/message.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -/** - * Elgg standard message - * Displays a single Elgg system message - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['object'] A system message (string) - */ -?> - -<p> - <?php echo nl2br($vars['object']); ?> -</p>
\ No newline at end of file diff --git a/views/installation/page_shells/default.php b/views/installation/page/default.php index fbc5ccbf2..662e8206e 100644 --- a/views/installation/page_shells/default.php +++ b/views/installation/page/default.php @@ -29,24 +29,29 @@ header('Expires: Fri, 05 Feb 1982 00:00:00 -0500', TRUE); <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="SHORTCUT ICON" href="<?php echo elgg_get_site_url(); ?>_graphics/favicon.ico" /> <link rel="stylesheet" href="<?php echo elgg_get_site_url(); ?>install/css/install.css" type="text/css" /> + <script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery-1.6.4.min.js"></script> + <script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>install/js/install.js"></script> </head> <body> - <div id="elgg-wrapper"> - <div id="elgg-header"> - <?php echo elgg_view('install/header', $vars); ?> + <div class="elgg-page"> + <div class="elgg-page-header"> + <?php echo elgg_view('page/elements/header', $vars); ?> + </div> + <div class="elgg-page-body"> + <div class="elgg-layout"> + <div class="elgg-sidebar"> + <?php echo elgg_view('page/elements/sidebar', $vars); ?> + </div> + <div class="elgg-body"> + <h2><?php echo $vars['title']; ?></h2> + <?php echo elgg_view('page/elements/messages', array('object' => $vars['sysmessages'])); ?> + <?php echo $vars['body']; ?> + </div> + </div> + </div> + <div class="elgg-page-footer"> + <?php echo elgg_view('page/elements/footer'); ?> + </div> </div> - <div id="elgg-sidebar"> - <?php echo elgg_view('install/sidebar', $vars); ?> - </div> - <div id="elgg-content"> - <h2><?php echo $vars['title']; ?></h2> - <?php echo elgg_view('messages/list', array('object' => $vars['sysmessages'])); ?> - <?php echo $vars['body']; ?> - </div> - <div class="clearfloat"></div> - </div> - <div id="elgg-footer"> - <?php echo elgg_view('install/footer'); ?> - </div> </body> </html> diff --git a/views/installation/page/elements/footer.php b/views/installation/page/elements/footer.php new file mode 100644 index 000000000..d6a755fba --- /dev/null +++ b/views/installation/page/elements/footer.php @@ -0,0 +1,10 @@ +<?php +/** + * Install footer - offers help links + */ +?> +<ul> + <li><a href="http://docs.elgg.org/wiki/Installation" target="_blank">Install instructions</a></li> + <li><a href="http://docs.elgg.org/wiki/Install_Troubleshooting" target="_blank">Install troubleshooting</a></li> + <li><a href="http://community.elgg.org/pg/groups/world" target="_blank">Elgg community forums</a></li> +</ul>
\ No newline at end of file diff --git a/views/installation/install/header.php b/views/installation/page/elements/header.php index 8c18dbffd..8c18dbffd 100644 --- a/views/installation/install/header.php +++ b/views/installation/page/elements/header.php diff --git a/views/installation/page/elements/messages.php b/views/installation/page/elements/messages.php new file mode 100644 index 000000000..46261dca4 --- /dev/null +++ b/views/installation/page/elements/messages.php @@ -0,0 +1,21 @@ +<?php +/** + * Lists all system messages + * + * @uses $vars['object'] The array of message registers + */ + +if (isset($vars['object']) && is_array($vars['object']) && sizeof($vars['object']) > 0) { + + echo '<ul class="elgg-system-messages">'; + + foreach ($vars['object'] as $type => $list ) { + foreach ($list as $message) { + echo "<li class=\"elgg-state-$type\">"; + echo elgg_autop($message); + echo '</li>'; + } + } + + echo '</ul>'; +} diff --git a/views/installation/install/sidebar.php b/views/installation/page/elements/sidebar.php index 8136cd898..8136cd898 100644 --- a/views/installation/install/sidebar.php +++ b/views/installation/page/elements/sidebar.php diff --git a/views/js/object/default.php b/views/js/object/default.php deleted file mode 100644 index d54605333..000000000 --- a/views/js/object/default.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * Elgg JS default view - * - * @package Elgg - * @subpackage Core - */ - -if (isset($vars['entity'])) { - echo elgg_view_entity($vars['entity'],true,false); -}
\ No newline at end of file diff --git a/views/js/pageshells/pageshell.php b/views/js/pageshells/pageshell.php deleted file mode 100644 index 1eb84a327..000000000 --- a/views/js/pageshells/pageshell.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -/** - * Elgg JS pageshell - * - * @package Elgg - * @subpackage Core - */ - -$body = $vars['body']; - -// Remove excess carriage returns -$body = str_replace("\r",'',$body); -$body = explode("\n",$body); - -foreach($body as $line) { - echo "document.write('" . addslashes($line) . "');\n"; -}
\ No newline at end of file diff --git a/views/js/user/default.php b/views/js/user/default.php deleted file mode 100644 index d54605333..000000000 --- a/views/js/user/default.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * Elgg JS default view - * - * @package Elgg - * @subpackage Core - */ - -if (isset($vars['entity'])) { - echo elgg_view_entity($vars['entity'],true,false); -}
\ No newline at end of file diff --git a/views/json/api/output.php b/views/json/api/output.php index aab68f0dc..adeb7cc75 100644 --- a/views/json/api/output.php +++ b/views/json/api/output.php @@ -1,11 +1,10 @@ <?php /** * Elgg JSON output - * This outputs the api as JSON + * This outputs the api results as JSON * * @package Elgg * @subpackage Core - * */ $result = $vars['result']; diff --git a/views/json/canvas/default.php b/views/json/canvas/default.php deleted file mode 100644 index faaf615fb..000000000 --- a/views/json/canvas/default.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ - -for ($i = 1; $i < 8; $i++) { - if (isset($vars["area{$i}"])) { - echo $vars["area{$i}"]; - } -} diff --git a/views/json/entities/entity_list.php b/views/json/entities/entity_list.php deleted file mode 100644 index f3d388f21..000000000 --- a/views/json/entities/entity_list.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -$entities = $vars['entities']; -$fullview = $vars['fullview']; - -if (is_array($entities) && sizeof($entities) > 0) { - foreach($entities as $entity) { - echo elgg_view_entity($entity, $fullview); - } -} diff --git a/views/json/export/entity.php b/views/json/export/entity.php index 52cd9d244..36af5eaef 100644 --- a/views/json/export/entity.php +++ b/views/json/export/entity.php @@ -19,4 +19,7 @@ foreach ($exportable_values as $v) { $export->url = $entity->getURL(); global $jsonexport; -$jsonexport[$entity->getType()][$entity->getSubtype()][] = $export;
\ No newline at end of file +$jsonexport[$entity->getType()][$entity->getSubtype()][] = $export; + +// @todo hack to fix #4504 +echo "Fix for bug #4504"; diff --git a/views/json/group/default.php b/views/json/group/default.php index a01b215cc..dd190d402 100644 --- a/views/json/group/default.php +++ b/views/json/group/default.php @@ -1,9 +1,9 @@ <?php /** - * Elgg default layout + * JSON group view * * @package Elgg * @subpackage Core */ -elgg_view('export/entity', $vars);
\ No newline at end of file +echo elgg_view('export/entity', $vars); diff --git a/views/json/object/default.php b/views/json/object/default.php index a01b215cc..8b88b3010 100644 --- a/views/json/object/default.php +++ b/views/json/object/default.php @@ -1,9 +1,9 @@ <?php /** - * Elgg default layout + * JSON object view * * @package Elgg * @subpackage Core */ -elgg_view('export/entity', $vars);
\ No newline at end of file +echo elgg_view('export/entity', $vars); diff --git a/views/json/page/components/list.php b/views/json/page/components/list.php new file mode 100644 index 000000000..5de4f1f59 --- /dev/null +++ b/views/json/page/components/list.php @@ -0,0 +1,14 @@ +<?php +/** + * JSON list view + * + * @uses $vars['items'] + */ + +$items = $vars['items']; + +if (is_array($items) && sizeof($items) > 0) { + foreach ($items as $item) { + elgg_view_list_item($item, $vars); + } +}
\ No newline at end of file diff --git a/views/json/page/default.php b/views/json/page/default.php new file mode 100644 index 000000000..2d0403e11 --- /dev/null +++ b/views/json/page/default.php @@ -0,0 +1,13 @@ +<?php +/** + * Elgg JSON output pageshell + * + * @package Elgg + * @subpackage Core + * + */ + +header("Content-Type: application/json"); + +global $jsonexport; +echo json_encode($jsonexport);
\ No newline at end of file diff --git a/views/json/page_shells/default.php b/views/json/page_shells/default.php deleted file mode 100644 index d1f86c8a7..000000000 --- a/views/json/page_shells/default.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * Elgg JSON output pageshell - * - * @package Elgg - * @subpackage Core - * - */ - -if(stristr($_SERVER["HTTP_ACCEPT"],"application/json")) { - header("Content-Type: application/json"); -} else { - header("Content-Type: application/javascript"); -} -// echo $vars['body']; - -global $jsonexport; -echo json_encode($jsonexport);
\ No newline at end of file diff --git a/views/json/river/item.php b/views/json/river/item.php new file mode 100644 index 000000000..64677817f --- /dev/null +++ b/views/json/river/item.php @@ -0,0 +1,19 @@ +<?php +/** + * JSON river item view + * + * @uses $vars['item'] + */ + +global $jsonexport; + +if (!isset($jsonexport['activity'])) { + $jsonexport['activity'] = array(); +} + +$item = $vars['item']; +if (elgg_view_exists($item->view, 'default')) { + $item->string = elgg_view('river/elements/summary', array('item' => $item), FALSE, FALSE, 'default'); +} + +$jsonexport['activity'][] = $vars['item']; diff --git a/views/json/river/item/list.php b/views/json/river/item/list.php deleted file mode 100644 index c79cd1042..000000000 --- a/views/json/river/item/list.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * JSON river view - * - * @package Elgg - * @subpackage Core - */ -global $jsonexport; - -$json_items = array(); - -if (isset($vars['items']) && is_array($vars['items'])) { - $i = 0; - - if (!empty($vars['items'])) { - foreach($vars['items'] as $item) { - - $json_entry = array( - 'subject' => NULL, - 'object' => NULL, - 'type' => NULL, - 'subtype' => NULL, - 'action_type' => NULL, - 'view' => NULL, - 'annotation' => NULL, - 'timestamp' => NULL, - 'string' => NULL - ); - - if (elgg_view_exists($item->view, 'default')) { - $json_entry['string'] = elgg_view($item->view, array('item' => $item), FALSE, FALSE, 'default'); - $json_entry['timestamp'] = (int)$item->posted; - } - - $json_items[] = $json_entry; - - $i++; - if ($i >= $vars['limit']) { - break; - } - } - } -} - -$jsonexport['activity'] = $json_items; diff --git a/views/json/search/entity_list.php b/views/json/search/entity_list.php deleted file mode 100644 index c778bf5df..000000000 --- a/views/json/search/entity_list.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ - -$entities = $vars['entities']; -if (is_array($entities) && sizeof($entities) > 0) { - foreach($entities as $entity) { - echo elgg_view_entity($entity); - } -} diff --git a/views/json/site/default.php b/views/json/site/default.php index a01b215cc..ee4eda489 100644 --- a/views/json/site/default.php +++ b/views/json/site/default.php @@ -1,9 +1,9 @@ <?php /** - * Elgg default layout + * JSON site view * * @package Elgg * @subpackage Core */ -elgg_view('export/entity', $vars);
\ No newline at end of file +echo elgg_view('export/entity', $vars); diff --git a/views/json/user/default.php b/views/json/user/default.php index a01b215cc..4d44692c9 100644 --- a/views/json/user/default.php +++ b/views/json/user/default.php @@ -1,9 +1,9 @@ <?php /** - * Elgg default layout + * JSON user view * * @package Elgg * @subpackage Core */ -elgg_view('export/entity', $vars);
\ No newline at end of file +echo elgg_view('export/entity', $vars); diff --git a/views/opendd/canvas/default.php b/views/opendd/canvas/default.php deleted file mode 100644 index 4b8d12e6d..000000000 --- a/views/opendd/canvas/default.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ - -for ($i = 1; $i < 8; $i++) { - if (isset($vars["area{$i}"])) { - echo $vars["area{$i}"]; - } -}
\ No newline at end of file diff --git a/views/opendd/messages/exceptions/exception.php b/views/opendd/messages/exceptions/exception.php index 73cc462da..dc0f48a8d 100644 --- a/views/opendd/messages/exceptions/exception.php +++ b/views/opendd/messages/exceptions/exception.php @@ -9,11 +9,10 @@ * @uses $vars['object'] An exception */ -global $CONFIG; ?> <!-- -<?php echo get_class($vars['object']); ?>: <?php echo autop($vars['object']->getMessage()); ?> -<?php if (isset($CONFIG->debug)) { ?> +<?php echo get_class($vars['object']); ?>: <?php echo elgg_autop($vars['object']->getMessage()); ?> +<?php if (elgg_get_config('debug')) { ?> <?php echo print_r($vars['object'], true); ?> diff --git a/views/opendd/pageshells/pageshell.php b/views/opendd/page/default.php index bdd59d45e..bdd59d45e 100644 --- a/views/opendd/pageshells/pageshell.php +++ b/views/opendd/page/default.php diff --git a/views/php/api/output.php b/views/php/api/output.php index cc76b97e0..14259564c 100644 --- a/views/php/api/output.php +++ b/views/php/api/output.php @@ -1,11 +1,10 @@ <?php /** * Elgg PHP output - * This outputs the api as PHP + * This outputs the api results as serialized PHP * * @package Elgg * @subpackage Core - * */ $result = $vars['result']; diff --git a/views/php/canvas/default.php b/views/php/canvas/default.php deleted file mode 100644 index 4b8d12e6d..000000000 --- a/views/php/canvas/default.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ - -for ($i = 1; $i < 8; $i++) { - if (isset($vars["area{$i}"])) { - echo $vars["area{$i}"]; - } -}
\ No newline at end of file diff --git a/views/php/group/default.php b/views/php/group/default.php index eed1dbfbd..968d68bcd 100644 --- a/views/php/group/default.php +++ b/views/php/group/default.php @@ -1,6 +1,6 @@ <?php /** - * Elgg default layout + * PHP group view * * @package Elgg * @subpackage Core diff --git a/views/php/object/default.php b/views/php/object/default.php index eed1dbfbd..8cf4eb8c6 100644 --- a/views/php/object/default.php +++ b/views/php/object/default.php @@ -1,6 +1,6 @@ <?php /** - * Elgg default layout + * PHP object view * * @package Elgg * @subpackage Core diff --git a/views/json/page_elements/contentwrapper.php b/views/php/page/default.php index 272419e97..87211a462 100644 --- a/views/json/page_elements/contentwrapper.php +++ b/views/php/page/default.php @@ -1,6 +1,6 @@ <?php /** - * Elgg default layout + * PHP output pageshell * * @package Elgg * @subpackage Core diff --git a/views/php/page_shells/default.php b/views/php/page_shells/default.php deleted file mode 100644 index c7692c432..000000000 --- a/views/php/page_shells/default.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php -/** - * Elgg PHP output pageshell - * - * @package Elgg - * @subpackage Core - * - */ - -echo $vars['body'];
\ No newline at end of file diff --git a/views/php/search/entity_list.php b/views/php/search/entity_list.php deleted file mode 100644 index c56874bdb..000000000 --- a/views/php/search/entity_list.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ - -$entities = $vars['entities']; -if (is_array($entities) && sizeof($entities) > 0) { - foreach($entities as $entity) { - echo elgg_view_entity($entity); - } -}
\ No newline at end of file diff --git a/views/php/site/default.php b/views/php/site/default.php index 4b8d12e6d..102ac7ec7 100644 --- a/views/php/site/default.php +++ b/views/php/site/default.php @@ -1,13 +1,9 @@ <?php /** - * Elgg default layout + * PHP site view * * @package Elgg * @subpackage Core */ -for ($i = 1; $i < 8; $i++) { - if (isset($vars["area{$i}"])) { - echo $vars["area{$i}"]; - } -}
\ No newline at end of file +elgg_view('export/entity', $vars);
\ No newline at end of file diff --git a/views/php/user/default.php b/views/php/user/default.php index eed1dbfbd..1bb0f8fa9 100644 --- a/views/php/user/default.php +++ b/views/php/user/default.php @@ -1,6 +1,6 @@ <?php /** - * Elgg default layout + * PHP user view * * @package Elgg * @subpackage Core diff --git a/views/rss/annotation/default.php b/views/rss/annotation/default.php deleted file mode 100644 index 98329f132..000000000 --- a/views/rss/annotation/default.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * Elgg RSS view for a generic comment - * - * @package Elgg - * @subpackage Core - */ - -$entity = get_entity($vars['annotation']->entity_guid); - -$title = substr($vars['annotation']->value, 0, 32); -if (strlen($vars['annotation']->value) > 32) { - $title .= " ..."; -} - -$permalink = $entity->getURL(); -$pubdate = date('r', $entity->time_created); - -$creator = elgg_view('object/creator', array('entity' => $entity)); -$georss = elgg_view('object/georss', array('entity' => $entity)); -$extensions = elgg_view('extensions/item'); - -$item = <<<__HTML -<item> - <guid isPermaLink='true'>$permalink#{$vars['annotation']->id}</guid> - <pubDate>$pubdate</pubDate> - <link>$permalink#{$vars['annotation']->id}</link> - <title><![CDATA[$title]]></title> - <description><![CDATA[{$vars['annotation']->value}]]></description> - $creator$georss$extensions -</item> -__HTML; - -echo $item; diff --git a/views/rss/annotation/generic_comment.php b/views/rss/annotation/generic_comment.php new file mode 100644 index 000000000..de652fc8e --- /dev/null +++ b/views/rss/annotation/generic_comment.php @@ -0,0 +1,33 @@ +<?php +/** + * Elgg RSS view for a generic_comment annotation + * + * @package Elgg + * @subpackage Core + */ + +$annotation = $vars['annotation']; + +$poster = $annotation->getOwnerEntity(); +$poster_name = htmlspecialchars($poster->name, ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $annotation->getTimeCreated()); +$permalink = $annotation->getURL(); + +$title = elgg_echo('generic_comment:title', array($poster_name)); + +$creator = elgg_view('page/components/creator', array('entity' => $annotation)); +$extensions = elgg_view('extensions/item', $vars); + +$item = <<<__HTML +<item> + <guid isPermaLink='true'>$permalink</guid> + <pubDate>$pubdate</pubDate> + <link>$permalink</link> + <title><![CDATA[$title]]></title> + <description><![CDATA[{$vars['annotation']->value}]]></description> + $creator$extensions +</item> + +__HTML; + +echo $item; diff --git a/views/rss/canvas/default.php b/views/rss/canvas/default.php deleted file mode 100644 index 4b8d12e6d..000000000 --- a/views/rss/canvas/default.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ - -for ($i = 1; $i < 8; $i++) { - if (isset($vars["area{$i}"])) { - echo $vars["area{$i}"]; - } -}
\ No newline at end of file diff --git a/views/rss/entities/entity_list.php b/views/rss/entities/entity_list.php deleted file mode 100644 index 83b45b00f..000000000 --- a/views/rss/entities/entity_list.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -$entities = $vars['entities']; -$fullview = $vars['fullview']; - -if (is_array($entities) && sizeof($entities) > 0) { - foreach($entities as $entity) { - echo elgg_view_entity($entity, $fullview); - } -}
\ No newline at end of file diff --git a/views/rss/group/default.php b/views/rss/group/default.php index 4ffceba78..7fef4d434 100644 --- a/views/rss/group/default.php +++ b/views/rss/group/default.php @@ -1,37 +1,37 @@ <?php /** - * Elgg default group view + * RSS group view * * @package Elgg * @subpackage Core */ -?> +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); +$title = htmlspecialchars($vars['entity']->name, ENT_NOQUOTES, 'UTF-8'); +if ($vars['entity']->description) { + $description = elgg_autop($vars['entity']->description); +} elseif ($vars['entity']->briefdescription) { + $description = elgg_autop($vars['entity']->briefdescription); +} else { + $description = ''; +} + +$creator = elgg_view('page/components/creator', $vars); +$georss = elgg_view('page/components/georss', $vars); +$extension = elgg_view('extensions/item', $vars); + +$item = <<<__HTML <item> -<guid isPermaLink='true'><?php echo htmlspecialchars($vars['entity']->getURL()); ?></guid> -<pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate> -<link><?php echo htmlspecialchars($vars['entity']->getURL()); ?></link> -<title><![CDATA[<?php echo (($vars['entity']->name)); ?>]]></title> -<description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description> -<?php - $owner = $vars['entity']->getOwnerEntity(); - if ($owner) { -?> -<dc:creator><?php echo $owner->name; ?></dc:creator> -<?php - } -?> -<?php - if ( - ($vars['entity'] instanceof Locatable) && - ($vars['entity']->getLongitude()) && - ($vars['entity']->getLatitude()) - ) { - ?> - <georss:point><?php echo $vars['entity']->getLatitude(); ?> <?php echo $vars['entity']->getLongitude(); ?></georss:point> - <?php - } -?> -<?php echo elgg_view('extensions/item'); ?> + <guid isPermaLink="true">$permalink</guid> + <pubDate>$pubdate</pubDate> + <link>$permalink</link> + <title><![CDATA[$title]]></title> + <description><![CDATA[$description]]></description> + $creator$georss$extension </item> + +__HTML; + +echo $item; diff --git a/views/rss/object/creator.php b/views/rss/object/creator.php deleted file mode 100644 index 2bc6fd57d..000000000 --- a/views/rss/object/creator.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * - */ - -if ($owner = $vars['entity']->getOwnerEntity()) { - echo "<dc:creator>{$owner->name}</dc:creator>"; -} diff --git a/views/rss/object/default.php b/views/rss/object/default.php index 29e5d4591..8c7d5d8e0 100644 --- a/views/rss/object/default.php +++ b/views/rss/object/default.php @@ -1,6 +1,6 @@ <?php /** - * Elgg default object view + * RSS object view * * @package Elgg * @subpackage Core @@ -8,19 +8,18 @@ $title = $vars['entity']->title; if (empty($title)) { - $subtitle = strip_tags($vars['entity']->description); - $title = substr($subtitle, 0, 32); - if (strlen($subtitle) > 32) { - $title .= ' ...'; - } + $title = strip_tags($vars['entity']->description); + $title = elgg_get_excerpt($title, 32); } -$permalink = htmlspecialchars($vars['entity']->getURL()); -$pubdate = date('r', $vars['entity']->time_created); +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); -$creator = elgg_view('object/creator', $vars); -$georss = elgg_view('object/georss', $vars); -$extension = elgg_view('extensions/item'); +$description = elgg_autop($vars['entity']->description); + +$creator = elgg_view('page/components/creator', $vars); +$georss = elgg_view('page/components/georss', $vars); +$extension = elgg_view('extensions/item', $vars); $item = <<<__HTML <item> @@ -28,7 +27,7 @@ $item = <<<__HTML <pubDate>$pubdate</pubDate> <link>$permalink</link> <title><![CDATA[$title]]></title> - <description><![CDATA[{$vars['entity']->description}]]></description> + <description><![CDATA[$description]]></description> $creator$georss$extension </item> diff --git a/views/rss/object/georss.php b/views/rss/object/georss.php deleted file mode 100644 index 8aa027519..000000000 --- a/views/rss/object/georss.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php -/** - * - */ - -if (($vars['entity'] instanceof Locatable) && - ($latitude = $vars['entity']->getLongitude()) && ($longitude = $vars['entity']->getLatitude()) -) { - echo "<georss:point>$latitude $longitude</georss:point>"; -}
\ No newline at end of file diff --git a/views/rss/output/url.php b/views/rss/output/url.php new file mode 100644 index 000000000..b0f4d9792 --- /dev/null +++ b/views/rss/output/url.php @@ -0,0 +1,6 @@ +<?php +/** + * RSS url output view + * + */ +echo elgg_view('output/url', $vars, false, false, 'default'); diff --git a/views/rss/page/components/creator.php b/views/rss/page/components/creator.php new file mode 100644 index 000000000..a14f1dbca --- /dev/null +++ b/views/rss/page/components/creator.php @@ -0,0 +1,14 @@ +<?php +/** + * Creator view + * + * Implements Dublin Core creator + * + * @uses $vars['entity'] + */ + +$owner = $vars['entity']->getOwnerEntity(); +if ($owner) { + $owner_name = htmlspecialchars($owner->name, ENT_NOQUOTES, 'UTF-8'); + echo "<dc:creator>$owner_name</dc:creator>"; +} diff --git a/views/rss/page/components/gallery.php b/views/rss/page/components/gallery.php new file mode 100644 index 000000000..690416e5b --- /dev/null +++ b/views/rss/page/components/gallery.php @@ -0,0 +1,8 @@ +<?php +/* + * RSS gallery view + * + * @uses $vars['items'] + */ + +echo elgg_view('page/components/list', $vars); diff --git a/views/rss/page/components/georss.php b/views/rss/page/components/georss.php new file mode 100644 index 000000000..d176b8cac --- /dev/null +++ b/views/rss/page/components/georss.php @@ -0,0 +1,15 @@ +<?php +/** + * GeoRSS view + * + * This implements GeoRSS-Simple + * + * @uses $vars['entity'] + */ + +$longitude = $vars['entity']->getLongitude(); +$latitude = $vars['entity']->getLatitude(); + +if ($vars['entity'] instanceof Locatable && $longitude && $latitude) { + echo "<georss:point>$latitude $longitude</georss:point>"; +} diff --git a/views/rss/page/components/image_block.php b/views/rss/page/components/image_block.php new file mode 100644 index 000000000..ff94bcff2 --- /dev/null +++ b/views/rss/page/components/image_block.php @@ -0,0 +1,7 @@ +<?php +/** + * RSS image block view + * + * Only display the body + */ +echo $vars['body'];
\ No newline at end of file diff --git a/views/rss/page/components/list.php b/views/rss/page/components/list.php new file mode 100644 index 000000000..2650fc006 --- /dev/null +++ b/views/rss/page/components/list.php @@ -0,0 +1,14 @@ +<?php +/** + * RSS list view + * + * @uses $vars['items'] + */ + +$items = $vars['items']; + +if (is_array($items) && sizeof($items) > 0) { + foreach ($items as $item) { + echo elgg_view_list_item($item, $vars); + } +}
\ No newline at end of file diff --git a/views/rss/page/default.php b/views/rss/page/default.php new file mode 100644 index 000000000..a7b757760 --- /dev/null +++ b/views/rss/page/default.php @@ -0,0 +1,46 @@ +<?php +/** + * Elgg RSS output pageshell + * + * @package Elgg.Core + * + * @uses $vars['title'] The title of the RSS feed + * @uses $vars['body'] The items for the RSS feed as a string + * @uses $vars['descrption'] The description for the RSS feed + */ + +// Set title +if (empty($vars['title'])) { + $title = elgg_get_config('sitename'); +} else { + $title = elgg_get_config('sitename') . ": " . $vars['title']; +} + +// Remove RSS from URL +$url = str_replace('?view=rss', '', current_page_url()); +$url = str_replace('&view=rss', '', $url); +$url = htmlspecialchars($url, ENT_NOQUOTES, 'UTF-8'); + +$body = elgg_extract('body', $vars, ''); +$description = elgg_extract('description', $vars, ''); + +$namespaces = elgg_view('extensions/xmlns'); +$extensions = elgg_view('extensions/channel'); + + +// allow caching as required by stupid MS products for https feeds. +header('Pragma: public', true); +header("Content-Type: text/xml"); + +echo "<?xml version='1.0'?>"; +echo <<<END +<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" $namespaces> +<channel> + <title><![CDATA[$title]]></title> + <link>$url</link> + <description><![CDATA[$description]]></description> + $extensions + $body +</channel> +</rss> +END; diff --git a/views/rss/page/elements/comments.php b/views/rss/page/elements/comments.php new file mode 100644 index 000000000..9c655ffef --- /dev/null +++ b/views/rss/page/elements/comments.php @@ -0,0 +1,13 @@ +<?php +/** + * RSS comments view + * + * @uses $vars['entity'] + */ + +$options = array( + 'guid' => $vars['entity']->getGUID(), + 'annotation_name' => 'generic_comment', + 'order_by' => 'n_table.time_created desc', +); +echo elgg_list_annotations($options); diff --git a/views/rss/page/layouts/default.php b/views/rss/page/layouts/default.php new file mode 100644 index 000000000..7f3ddebbd --- /dev/null +++ b/views/rss/page/layouts/default.php @@ -0,0 +1,5 @@ +<?php +/** + * RSS layout shell + */ +echo $vars['content'];
\ No newline at end of file diff --git a/views/rss/page_elements/contentwrapper.php b/views/rss/page_elements/contentwrapper.php deleted file mode 100644 index 3e056ae91..000000000 --- a/views/rss/page_elements/contentwrapper.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php -/** - * @package Elgg - * @subpackage Core - */ - -echo $vars['body'];
\ No newline at end of file diff --git a/views/rss/page_shells/default.php b/views/rss/page_shells/default.php deleted file mode 100644 index 444fa99b5..000000000 --- a/views/rss/page_shells/default.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * Elgg RSS output pageshell - * - * @package Elgg - * @subpackage Core - * - */ - -header("Content-Type: text/xml"); - -// allow caching as required by stupid MS products for https feeds. -header('Pragma: public', TRUE); - -echo "<?xml version='1.0'?>\n"; - -// Set title -if (empty($vars['title'])) { - $title = $vars['config']->sitename; -} else if (empty($vars['config']->sitename)) { - $title = $vars['title']; -} else { - $title = $vars['config']->sitename . ": " . $vars['title']; -} - -// Remove RSS from URL -$url = str_replace('?view=rss','', full_url()); -$url = str_replace('&view=rss','', $url); - -?> - -<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" <?php echo elgg_view('extensions/xmlns'); ?> > -<channel> - <title><![CDATA[<?php echo $title; ?>]]></title> - <link><?php echo htmlentities($url); ?></link> - <?php echo elgg_view('extensions/channel'); ?> - <?php - - echo $vars['body']; - - ?> -</channel> -</rss> diff --git a/views/rss/river/item.php b/views/rss/river/item.php new file mode 100644 index 000000000..fa2914eff --- /dev/null +++ b/views/rss/river/item.php @@ -0,0 +1,35 @@ +<?php +/** + * RSS river view + * + * @uses $vars['item'] + */ +$item = $vars['item']; + +$name = $item->getSubjectEntity()->name; +$name = htmlspecialchars($name, ENT_NOQUOTES, 'UTF-8'); +$title = elgg_echo('river:update', array($name)); + +$timestamp = date('r', $item->getPostedTime()); +$body = elgg_view('river/elements/summary', $vars, false, false, 'default'); + + +$object = $item->getObjectEntity(); +if ($object) { + $url = htmlspecialchars($object->getURL()); +} else { + $url = elgg_normalize_url('activity'); +} + +$html = <<<__HTML +<item> + <guid>$item->id</guid> + <pubDate>$timestamp</pubDate> + <link>$url</link> + <title><![CDATA[$title]]></title> + <description><![CDATA[$body]]></description> +</item> + +__HTML; + +echo $html; diff --git a/views/rss/river/item/list.php b/views/rss/river/item/list.php deleted file mode 100644 index 3b2fc6179..000000000 --- a/views/rss/river/item/list.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -/** - * @package Elgg - * @subpackage Core - */ - -if (isset($vars['items']) && is_array($vars['items']) && !empty($vars['items'])) { - $i = 1; - foreach($vars['items'] as $item) { - if ($i++ >= $vars['limit']) { - break; - } - - $entity = get_entity($item->object_guid); - echo elgg_view_entity($entity); - } -} diff --git a/views/rss/search/entity_list.php b/views/rss/search/entity_list.php deleted file mode 100644 index 1e44adf18..000000000 --- a/views/rss/search/entity_list.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php -/** - * @package Elgg - * @subpackage Core - */ - -$entities = $vars['entities']; -if (is_array($entities) && sizeof($entities) > 0) { - foreach($entities as $entity) { - echo elgg_view_entity($entity); - } -}
\ No newline at end of file diff --git a/views/rss/user/default.php b/views/rss/user/default.php index a8b9d073c..92c9427b2 100644 --- a/views/rss/user/default.php +++ b/views/rss/user/default.php @@ -1,29 +1,34 @@ <?php /** - * Elgg default user view + * RSS user view * * @package Elgg * @subpackage Core */ -?> +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); +$title = htmlspecialchars($vars['entity']->name, ENT_NOQUOTES, 'UTF-8'); +if ($vars['entity']->description) { + $description = elgg_autop($vars['entity']->description); +} else { + $description = ''; +} + +$georss = elgg_view('page/components/georss', $vars); +$extension = elgg_view('extensions/item', $vars); + +$item = <<<__HTML <item> -<guid isPermaLink='true'><?php echo $vars['entity']->getURL(); ?></guid> -<pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate> -<link><?php echo $vars['entity']->getURL(); ?></link> -<title><![CDATA[<?php echo (($vars['entity']->name)); ?>]]></title> -<description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description> -<?php - if ( - ($vars['entity'] instanceof Locatable) && - ($vars['entity']->getLongitude()) && - ($vars['entity']->getLatitude()) - ) { - ?> - <georss:point><?php echo $vars['entity']->getLatitude(); ?> <?php echo $vars['entity']->getLongitude(); ?></georss:point> - <?php - } -?> -<?php echo elgg_view('extensions/item'); ?> + <guid isPermaLink="true">$permalink</guid> + <pubDate>$pubdate</pubDate> + <link>$permalink</link> + <title><![CDATA[$title]]></title> + <description><![CDATA[$description]]></description> + $georss$extension </item> + +__HTML; + +echo $item; diff --git a/views/xml/messages/exceptions/exception.php b/views/xml/messages/exceptions/exception.php index 31d153b88..66a0f2b96 100644 --- a/views/xml/messages/exceptions/exception.php +++ b/views/xml/messages/exceptions/exception.php @@ -9,13 +9,12 @@ * @uses $vars['object'] An exception */ -global $CONFIG; ?> <!-- -<?php echo get_class($vars['object']); ?>: <?php echo autop($vars['object']->getMessage()); ?> +<?php echo get_class($vars['object']); ?>: <?php echo elgg_autop($vars['object']->getMessage()); ?> -<?php if (isset($CONFIG->debug)) { ?> +<?php if (elgg_get_config('debug')) { ?> <?php echo print_r($vars['object'], true); diff --git a/views/xml/page_shells/default.php b/views/xml/page/default.php index 0f0aecbe4..0f0aecbe4 100644 --- a/views/xml/page_shells/default.php +++ b/views/xml/page/default.php |
