diff options
Diffstat (limited to 'views/default')
311 files changed, 13424 insertions, 9028 deletions
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 new file mode 100644 index 000000000..1d5c95cf9 --- /dev/null +++ b/views/default/admin/appearance/menu_items.php @@ -0,0 +1,10 @@ +<?php +/** + * Elgg administration menu items + * + * @package Elgg + * @subpackage Core + */ + + +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/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/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/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/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/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 new file mode 100644 index 000000000..6d22b9c29 --- /dev/null +++ b/views/default/admin/users/add.php @@ -0,0 +1,9 @@ +<?php +/** + * Display an add user form. + */ + +$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 new file mode 100644 index 000000000..91a6fa338 --- /dev/null +++ b/views/default/admin/users/newest.php @@ -0,0 +1,18 @@ +<?php +// newest users +$users = elgg_list_entities(array( + 'type' => 'user', + 'subtype'=> null, + 'full_view' => FALSE +)); + +?> + +<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> +</div> diff --git a/views/default/admin/users/online.php b/views/default/admin/users/online.php new file mode 100644 index 000000000..dbda06066 --- /dev/null +++ b/views/default/admin/users/online.php @@ -0,0 +1,13 @@ +<?php + +$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> +</div> diff --git a/views/default/annotation/default.php b/views/default/annotation/default.php new file mode 100644 index 000000000..5d29a53e2 --- /dev/null +++ b/views/default/annotation/default.php @@ -0,0 +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'] + */ + +$annotation = $vars['annotation']; + +$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>"; + +$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 new file mode 100644 index 000000000..22a8d9211 --- /dev/null +++ b/views/default/annotation/generic_comment.php @@ -0,0 +1,69 @@ +<?php +/** + * Elgg generic comment view + * + * @uses $vars['annotation'] ElggAnnotation object + * @uses $vars['full_view'] Display fill view or brief view + */ + +if (!isset($vars['annotation'])) { + return true; +} + +$full_view = elgg_extract('full_view', $vars, true); + +$comment = $vars['annotation']; + +$entity = get_entity($comment->entity_guid); +$commenter = get_user($comment->owner_guid); +if (!$entity || !$commenter) { + return true; +} + +$friendlytime = elgg_view_friendly_time($comment->time_created); + +$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) { + $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 +<div class="mbn"> + $menu + $commenter_link + <span class="elgg-subtext"> + $friendlytime + </span> + $comment_text +</div> +HTML; + + echo elgg_view_image_block($commenter_icon, $body); + +} else { + // brief view + + //@todo need link to actual comment! + + $commented_on = elgg_echo('generic_comment:on', array($commenter_link, $entity_link)); + + $excerpt = elgg_get_excerpt($comment->value, 80); + + $body = <<<HTML +<span class="elgg-subtext"> + $commented_on ($friendlytime): $excerpt +</span> +HTML; + + echo elgg_view_image_block($commenter_icon, $body); +} diff --git a/views/default/api/output.php b/views/default/api/output.php new file mode 100644 index 000000000..a7041c0f4 --- /dev/null +++ b/views/default/api/output.php @@ -0,0 +1,42 @@ +<?php +/** + * Elgg API default output + * This outputs the api in a human readable way. + * + * @package Elgg + * @subpackage Core + * + */ + +$result = $vars['result']; +$export = $result->export(); + +?> +<div id="api_result"> + <table width="100%"> + <tr><td width="100" valign="top"><b>Status:</b></td> <td> + <?php + if ($result instanceof SuccessResult) + echo "OK"; + else + echo "**** ERROR ({$export->status}) ****"; + ?> + </td></tr> + + <?php if ($export->message!="") { ?> + <tr><td width="100" valign="top"><b>Message:</b></td> <td><?php echo $export->message; ?></td></tr> + <?php } ?> + <?php if ($export->result) { ?> + <tr><td width="100" valign="top"><b>Result:</b></td> <td><pre><?php print_r($export->result); ?></pre></td></tr> + <?php } ?> + + + <?php if ($export->pam) { ?> + <tr><td width="100" valign="top"><b>PAM:</b></td> <td><pre><?php print_r($export->pam); ?></pre></td></tr> + <?php } ?> + + <?php if ($export->runtime_errors) { ?> + <tr><td width="100" valign="top"><b>Runtime:</b></td> <td><pre><?php print_r($export->runtime_errors); ?></pre></td></tr> + <?php } ?> + </table> +</div>
\ No newline at end of file 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/core/friends/collections.php b/views/default/core/friends/collections.php new file mode 100644 index 000000000..c6ee082c8 --- /dev/null +++ b/views/default/core/friends/collections.php @@ -0,0 +1,39 @@ +<?php +/** + * Elgg friends collections + * Lists a user's friends collections + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['collections'] The array of friends collections + */ + +if (is_array($vars['collections']) && sizeof($vars['collections'])) { + echo "<ul id=\"friends_collections_accordian\">"; + + $friendspicker = 0; + foreach ($vars['collections'] as $collection) { + $friendspicker++; + echo elgg_view('core/friends/collection', array( + 'collection' => $collection, + 'friendspicker' => $friendspicker, + )); + } + + echo "</ul>"; + +} else { + echo elgg_echo("friends:nocollections"); +} + +?> +<?php //@todo JS 1.8: no ?> +<script> +$(function(){ + $('#friends_collections_accordian h2').click(function () { + $(this.parentNode).children("[class=friends-picker-main-wrapper]").slideToggle("fast"); + //return false; + }); +}); +</script> 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/core/friends/tablelist.php b/views/default/core/friends/tablelist.php new file mode 100644 index 000000000..339b9ab1b --- /dev/null +++ b/views/default/core/friends/tablelist.php @@ -0,0 +1,50 @@ +<?php +/** + * Elgg friends picker + * Lists the friends picker + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['entities'] The array of ElggUser objects + */ + +if (is_array($vars['entities'])) { + +?> + +<table cellspacing="0" id="friendspicker-members-table"> + <tr> + <?php + $column = 0; + foreach($vars['entities'] as $entity) { + if (!($entity instanceof ElggEntity)) { + $entity = get_entity($entity); + } + + if ($entity instanceof ElggEntity) { + ?> + <td style="width:25px;"> + <div style="width: 25px;" class="mbl"> + <?php echo elgg_view_entity_icon($entity, 'tiny'); ?> + </div> + </td> + <td style="width: 200px;" class="pas"> + <?php echo $entity->name; ?> + </td> + <?php + $column++; + if ($column == 3) { + echo "</tr><tr>"; + $column = 0; + } + } + } + +if ($column < 3 && $column != 0) echo "</tr>"; + echo "</table>"; +} + +if (isset($vars['content'])) { + echo $vars['content']; +}
\ No newline at end of file diff --git a/views/default/core/friends/tablelistcountupdate.php b/views/default/core/friends/tablelistcountupdate.php new file mode 100644 index 000000000..7a0da1caa --- /dev/null +++ b/views/default/core/friends/tablelistcountupdate.php @@ -0,0 +1,17 @@ +<?php +/** + * Elgg friends picker count updater + * Updates the friends count on a collection + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['count'] The count + * @uses $vars['friendspicker'] The friendspicker counter number + */ + +?> +<?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 new file mode 100644 index 000000000..e67c79c36 --- /dev/null +++ b/views/default/css.php @@ -0,0 +1,7 @@ +<?php +/** + * + * This is a deprecated CSS view used in Elgg 1.0-1.7. + * Please use the view 'css/elgg' now. + * + */ diff --git a/views/default/css/admin.php b/views/default/css/admin.php new file mode 100644 index 000000000..059e51dd6 --- /dev/null +++ b/views/default/css/admin.php @@ -0,0 +1,1652 @@ +<?php +/** + * 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 + */ + +?> + +/* *************************************** + RESET CSS +*************************************** */ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} +<?php // force vertical scroll bar ?> +html, body { + height: 100%; + margin-bottom: 1px; +} +img { + border-width: 0; + border-color: transparent; +} +ol, ul { + list-style: none; +} +em, i { + font-style: italic; +} +ins { + text-decoration: none; +} +del { + text-decoration:line-through; +} +strong, b { + font-weight: bold; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +caption, th, td { + text-align: left; + font-weight: normal; + vertical-align: top; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ""; +} +blockquote, q { + quotes: "" ""; +} + +/* *************************************** + BASICS +*************************************** */ +body { + background-color: #eee; + font-size: 80%; + line-height: 1.4em; + font-family: "Lucida Grande",Arial,Tahoma,Verdana,sans-serif; +} +h1, h2, h3, h4, h5, h6 { + font-weight: bold; + line-height: auto; + color: #666; +} +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; } + +a { + color: #333; + text-decoration: none; +} +a:hover { + color: black; + text-decoration: underline; +} +pre, code { + 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 { + background: #EBF5FF; +} +p { + margin-bottom: 15px; +} + +.clearfloat { + clear: both; +} + +/* 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; +} + +.elgg-body { + width: auto; + word-wrap: break-word; + overflow: hidden; +} +.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 "; +} + +/* *************************************** + PAGE WRAPPER +*************************************** */ +.elgg-page > .elgg-inner { + margin: 0 auto; + padding: 20px 40px 0; + min-width: 800px; + max-width: 1600px; +} + +/* *************************************** + HEADER +*************************************** */ +.elgg-page-header { + background-color: #111; + border: 1px solid #999; + padding: 20px 20px; +} +.elgg-heading-site { + font-size: 1.8em; + float: left; +} +.elgg-heading-site a { + color: #ffffff; + text-decoration: none; +} +.elgg-heading-site a:hover { + color: white; + text-decoration: none; +} +.elgg-menu-user { + float: right; + margin-top: 5px; +} +.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; +} + +/* *************************************** + BODY +*************************************** */ +.elgg-page-body { + padding: 20px 0; +} +.elgg-main { + background-color: #fff; + border: 1px solid #ccc; + padding: 20px; + position: relative; + min-height: 400px; +} +.elgg-sidebar { + width: 210px; + float: right; + margin-left: 30px; +} +.elgg-main > .elgg-head { + margin-bottom: 10px; +} +.elgg-main h2 { + color: #333333; +} + +/* *************************************** + 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-page-footer a:hover { + text-decoration: underline; +} + +/* *************************************** + MODULES +*************************************** */ +.elgg-module { + overflow: hidden; +} +.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; +} +.elgg-module-inline > .elgg-head h3 { + color: white; +} + +/* *************************************** + TABLE +*************************************** */ +.elgg-table { + width: 100%; + border-top: 1px solid #ccc; +} +.elgg-table td, .elgg-table th { + background: white; + border: 1px solid #ccc; + padding: 4px 8px; + vertical-align: middle; +} +.elgg-table th { + background-color: #ddd; +} +.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; +} + +/* *************************************** + LISTS AND 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; +} +.elgg-item { + margin: 3px; +} +.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; +} + +/* *************************************** + FORMS AND INPUT +*************************************** */ +label { + font-weight: bold; + color: #333333; + font-size: 110%; +} +fieldset > div { + margin-bottom: 15px; +} +fieldset > div:last-child { + margin-bottom: 0; +} +input { + font: 120% Arial, Helvetica, sans-serif; + padding: 5px; + border: 1px solid #ccc; + color: #666; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + margin: 0; +} + +/* default elgg core input field classes */ +.elgg-input-text, +.elgg-input-tags, +.elgg-input-url, +.elgg-input-plaintext { + width: 98%; +} +textarea { + height: 100px; +} +.elgg-input-thin { + width: 400px; +} +.elgg-input-natural { + width: auto; +} + +.elgg-button { + font-size: 14px; + font-weight: bold; + text-decoration: none; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + + width: auto; + padding: 2px 4px; + cursor: pointer; +} +a.elgg-button { + padding: 3px 6px; +} + +.elgg-button + .elgg-button { + margin-left: 5px; +} + +.elgg-button-submit, +.elgg-button-action { + color: white; + border: 1px solid #333; + background-color: #333; + text-shadow: 1px 1px 0px black; +} +.elgg-button-submit:hover, +.elgg-button-action:hover { + color: white; + 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; + -webkit-border-radius: 5px; +} +.ui-datepicker-prev, .ui-datepicker-next { + position: absolute; + top: 9px; + 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-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; +} +.ui-datepicker-calendar .ui-state-hover { + border: 1px solid #aaa; + color: #333; + background: #ccc; +} +.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; + 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; +} + +/* *************************************** + 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; +} + +/* *************************************** + 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; +} + +/* *************************************** + PAGINATION +*************************************** */ +.elgg-pagination { + margin: 10px 0; + display: block; + text-align: center; +} +.elgg-pagination li { + display: inline; + margin: 0 6px 0 0; + text-align: center; +} +.elgg-pagination a, .elgg-pagination span { + padding: 2px 6px; + color: #333; + border: 1px solid #333; + font-size: 12px; + text-decoration: none; +} +.elgg-pagination a:hover { + background: #333; + color: white; + text-decoration: none; +} +.elgg-pagination .elgg-state-disabled span { + color: #CCC; + border-color: #CCC; +} +.elgg-pagination .elgg-state-selected span { + color: #000; + border-color: #ccc; +} + +/* *************************************** + 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; +} +.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; +} +.elgg-admin-sidebar-menu a:hover { + text-decoration: none; + background: black; + color: white; + border: 1px solid black; +} +.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; +} + +/* *************************************** + TITLE MENU +*************************************** */ +.elgg-menu-title { + float: right; +} +.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; +} + +/* *************************************** + 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; +} + +/* *************************************** + 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; +} +/* Allow inline image blocks in horizontal menus */ +.elgg-menu-hz .elgg-body:after { + content: '.'; +} +.elgg-menu > li:last-child::after { + display: none; +} +.elgg-menu-admin-footer a { + color: #eee; +} +.elgg-menu-admin-footer > li { + padding-right: 25px; +} +.elgg-menu-longtext { + float: right; +} +.elgg-menu-metadata { + list-style-type: none; + float: right; + margin-left: 15px; + font-size: 90%; +} +.elgg-menu-metadata > li { + float: left; + margin-left: 15px; +} +.elgg-menu-metadata, .elgg-menu-metadata a { + color: #aaa; +} + +/* *************************************** + 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: #eee; + border: 1px solid #ccc; +} +.elgg-widgets-add-panel ul { + padding: 0; + margin: 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; +} +.elgg-col-1of1 { + float: none; +} +.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; +} +.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; +} +.elgg-avatar > .elgg-icon-hover-menu { + display: none; + position: absolute; + right: 0; + bottom: 0; + margin: 0; + cursor: pointer; +} +.elgg-avatar { + position: relative; +} +.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; +} + +/* *************************************** + 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; +} +.elgg-plugin p { + margin: 0; +} +.elgg-plugin h3 { + color: black; + padding-bottom: 10px; +} +.elgg-plugin-settings { + font-weight: normal; + font-size: 0.9em; +} +.elgg-plugin-screenshot { + display: inline; +} +.elgg-plugin-screenshot img { + border: 1px solid #999; +} +.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; +} +.elgg-plugin-screenshot-lightbox h2 { + color: black; +} +.elgg-plugin.elgg-state-active { + background: white; +} +.elgg-plugin.elgg-state-inactive { + background: #dedede; +} +.elgg-plugin .elgg-state-error { + background: #fbe3e4; + color: #8a1f11; + border-color: #fbc2c4; + font-weight: bold; +} +.elgg-plugin .elgg-state-warning { + background: #fbedb5; + color: #000000; + border-color: #fbe58b; + font-weight: bold; +} +.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; +} +.elgg-output dd { + margin: 0 0 1em 2em; +} + +/* *************************************** + HELPERS +*************************************** */ +.hidden { + display: none; +} +.centered { + margin: 0 auto; +} +.center { + text-align: center; +} +.float { + float: left; +} +.float-alt { + float: right; +} +.elgg-toggle { + 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) +*************************************** */ +.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/elements/OOCSS_LICENSE b/views/default/css/elements/OOCSS_LICENSE new file mode 100644 index 000000000..c09c45873 --- /dev/null +++ b/views/default/css/elements/OOCSS_LICENSE @@ -0,0 +1,30 @@ +Software License Agreement (BSD License) + +Copyright (c) 2009, Nicole Sullivan. +All rights reserved. + +Redistribution and use of this software in source and binary forms, with or without modification, are +permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of Nicole Sullivan nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of Nicole Sullivan. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file 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..2fc156447 --- /dev/null +++ b/views/default/css/elements/forms.php @@ -0,0 +1,370 @@ +<?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; + 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; +} + +/* *************************************** + 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/elements/forms/datepicker_multi.php b/views/default/css/elements/forms/datepicker_multi.php deleted file mode 100644 index 4a18bdad1..000000000 --- a/views/default/css/elements/forms/datepicker_multi.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -?> - -.ui-datepicker.ui-datepicker-multi { - width: auto; -} -.ui-datepicker-multi .ui-datepicker-group { - float: left; -} -.ui-datepicker-multi .ui-datepicker-group table { - margin-bottom: 0.4em; - margin-left: auto; - margin-right: auto; - margin-top: 0; - width: 95%; -} -.ui-datepicker-multi-2 .ui-datepicker-group { - width: 50%; -} -.ui-datepicker-multi-3 .ui-datepicker-group { - width: 33.3%; -} -.ui-datepicker-multi-4 .ui-datepicker-group { - width: 25%; -} -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { - border-left-width-ltr-source: physical; - border-left-width-rtl-source: physical; - border-left-width-value: 0; -} -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { - border-left-width-ltr-source: physical; - border-left-width-rtl-source: physical; - border-left-width-value: 0; -} -.ui-datepicker-multi .ui-datepicker-buttonpane { - clear: left; -} diff --git a/views/default/css/elements/grid.php b/views/default/css/elements/grid.php new file mode 100644 index 000000000..fdbaf4aca --- /dev/null +++ b/views/default/css/elements/grid.php @@ -0,0 +1,54 @@ +<?php +/** + * CSS grid + * + * @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-col { + float: left; +} +.elgg-col-1of1 { + float: none; +} +.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%; +} 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..62f370069 --- /dev/null +++ b/views/default/css/elements/navigation.php @@ -0,0 +1,559 @@ +<?php +/** + * Navigation + * + * @package Elgg.Core + * @subpackage UI + */ +?> + +/* *************************************** + PAGINATION +*************************************** */ +.elgg-pagination { + margin: 10px 0; + display: block; + text-align: center; +} +.elgg-pagination li { + display: inline; + 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; + + 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/elements/reset.php b/views/default/css/elements/reset.php new file mode 100644 index 000000000..44bf2fac9 --- /dev/null +++ b/views/default/css/elements/reset.php @@ -0,0 +1,79 @@ +<?php +/** + * CSS reset + * + * @package Elgg.Core + * @subpackage UI + */ +?> + +/* *************************************** + RESET CSS +*************************************** */ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +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; +} +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; +} +ol, ul { + list-style: none; +} +em, i { + font-style:italic; +} +ins { + text-decoration:none; +} +del { + text-decoration:line-through; +} +strong, b { + font-weight:bold; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +caption, th, td { + text-align: left; + font-weight: normal; + vertical-align: top; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ""; +} +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 new file mode 100644 index 000000000..4bddd4d55 --- /dev/null +++ b/views/default/css/ie.php @@ -0,0 +1,8 @@ +/** + * CSS for IE8 and above + */ + +/* ie8 does not like shrink wrapping this div with inline-block */ +.elgg-avatar { + display: block; +} diff --git a/views/default/css/ie6.php b/views/default/css/ie6.php new file mode 100644 index 000000000..cf49d33f2 --- /dev/null +++ b/views/default/css/ie6.php @@ -0,0 +1,12 @@ +/** + * CSS for IE6 + */ + +* {zoom: 1;} /* trigger hasLayout in IE */ + +/* main nav drop-down */ +#elgg-header {z-index:1;} + +/* @todo check this one */ +.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..db0125b4b --- /dev/null +++ b/views/default/css/ie7.php @@ -0,0 +1,65 @@ +/** + * 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-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; +}
\ No newline at end of file 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/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/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/event_calendar/agenda_footer.php b/views/default/event_calendar/agenda_footer.php deleted file mode 100644 index 8749ebe08..000000000 --- a/views/default/event_calendar/agenda_footer.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php - -echo '</tbody></table></div>'; - -?>
\ No newline at end of file diff --git a/views/default/event_calendar/agenda_header.php b/views/default/event_calendar/agenda_header.php deleted file mode 100644 index 712dbed8d..000000000 --- a/views/default/event_calendar/agenda_header.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -$header .= '<div class="event_calendar_agenda_date_section">'; -$header .= '<div class="event_calendar_agenda_date">'.$vars['date'].'</div>'; -$header .= '<table><thead><tr>'; -$header .= '<th class="agenda_header">'.elgg_echo('event_calendar:agenda:column:time').'</th>'; -$header .= '<th class="agenda_header">'.elgg_echo('event_calendar:agenda:column:session').'</th>'; -$header .= '<th class="agenda_header">'.elgg_echo('event_calendar:agenda:column:venue').'</th>'; -$header .= '</td></thead><tbody>'; - -echo $header; -?>
\ No newline at end of file diff --git a/views/default/event_calendar/agenda_item_view.php b/views/default/event_calendar/agenda_item_view.php deleted file mode 100644 index 807982665..000000000 --- a/views/default/event_calendar/agenda_item_view.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -$event = $vars['event']; -$times = $vars['times']; -$time_bit = ''; -if ($times != 'no') { - if (is_numeric($event->start_time)) { - $time_bit = event_calendar_convert_time($event->start_time); - } - if (is_numeric($event->end_time)) { - $time_bit .= " - ".event_calendar_convert_time($event->end_time); - } - $time_bit .= ' '; -} -$info = '<tr>'; -$info .= '<td class="event_calendar_agenda_time">'.$time_bit.'</td>'; -$info .= '<td class="event_calendar_agenda_title"><a href="'.$event->getUrl().'">'.$event->title.'</a></td>'; -$info .= '<td class="event_calendar_agenda_venue">'.$event->venue.'</td>'; -$info .= '</tr>'; -if (trim($event->description)) { - $info .= '<tr class="event_calendar_agenda_description">'; - $info .= '<td class="event_calendar_agenda_time"> </td>'; - $info .= '<td colspan="2">'.$event->description.'</td></tr>'; -} - -echo $info; -?>
\ No newline at end of file diff --git a/views/default/event_calendar/agenda_view.php b/views/default/event_calendar/agenda_view.php deleted file mode 100644 index 05cdb6461..000000000 --- a/views/default/event_calendar/agenda_view.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -$nav = elgg_view('navigation/pagination',array( - -// 'baseurl' => $_SERVER['REQUEST_URI'], - 'baseurl' => $_SERVER['SCRIPT_NAME'].'/?'.$_SERVER['QUERY_STRING'], - 'offset' => $vars['offset'], - 'count' => $vars['count'], - 'limit' => $vars['limit'], - - )); -$event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar'); -$events = $vars['events']; -$html = ''; -$date_format = 'j M Y'; -$current_date = ''; -if ($events) { - foreach($events as $event) { - $date = date($date_format,$event->start_date); - if ($date != $current_date) { - if ($html) { - $html .= elgg_view('event_calendar/agenda_footer'); - } - $html .= elgg_view('event_calendar/agenda_header',array('date'=>$date)); - - $current_date = $date; - } - $html .= elgg_view('event_calendar/agenda_item_view',array('event'=>$event,'times'=>$event_calendar_times)); - } - $html .= elgg_view('event_calendar/agenda_footer'); -} -$html = $nav.'<div class="event_calendar_agenda">'.$html.'</div>'.$nav; - -echo $html; -?>
\ No newline at end of file diff --git a/views/default/event_calendar/calendar.php b/views/default/event_calendar/calendar.php deleted file mode 100644 index ea12ff603..000000000 --- a/views/default/event_calendar/calendar.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -if ($vars['mode']) { - $mode = $vars['mode']; -} else { - $mode = 'month'; -} - -# event_calendar/list/<start_date>/<display_mode>/<filter_context>/<region> -if ($vars['group_guid']) { - $link_bit = $vars['url']."event_calendar/group/{$vars['group_guid']}/{$vars['original_start_date']}/%s"; -} else { - $link_bit = $vars['url']."event_calendar/list/{$vars['original_start_date']}/%s/{$vars['filter']}"; -} - -#$link_bit = "event_calendar/show_events.php?start_date='.$vars['original_start_date'].'&group_guid='.$vars['group_guid'].'&filter='.$vars['filter'].'&mode='; - -$range_bit = ''; -$first_date = $vars['first_date']; -if ($first_date) { - $range_bit .= 'minDate: $.datepicker.parseDate("yy-mm-dd", "'.$first_date.'"),'."\n"; -} -$last_date = $vars['last_date']; -if ($last_date) { - $range_bit .= 'maxDate: $.datepicker.parseDate("yy-mm-dd", "'.$last_date.'"),'."\n"; -} -if ($first_date || $last_date) { - if (substr($first_date,0,7) == substr($last_date,0,7)) { - $range_bit .= "changeMonth: false,\n"; - } - - if (substr($first_date,0,4) == substr($last_date,0,4)) { - $range_bit .= "changeYear: false,\n"; - } -} - -$body .= elgg_view("input/datepicker_inline", - array( - 'name' => 'my_datepicker', - 'mode' => $vars['mode']?$vars['mode']:'month', - 'start_date' => $vars['start_date'], - 'end_date' => $vars['end_date'], - 'group_guid' => $vars['group_guid'], - 'range_bit' => $range_bit, - ) -); - -$body .= '<div id="calendarmenucontainer">'; -$body .= '<ul id="calendarmenu">'; -if ($mode == 'day') { - $link_class = ' class="sys_selected"'; -} else { - $link_class = ''; -} -$body .= '<li'.$link_class.'><a href="'.sprintf($link_bit,'day').'">'.elgg_echo('event_calendar:day_label').'</a></li>'; -if ($mode == 'week') { - $link_class = ' class="sys_selected"'; -} else { - $link_class = ''; -} -$body .= '<li'.$link_class.'><a href="'.sprintf($link_bit,'week').'">'.elgg_echo('event_calendar:week_label').'</a></li>'; -if ($mode == 'month') { - $link_class = ' class="sys_selected sys_calmenu_last"'; -} else { - $link_class = ' class="sys_calmenu_last"'; -} -$body .= '<li'.$link_class.'><a href="'.sprintf($link_bit,'month').'">'.elgg_echo('event_calendar:month_label').'</a></li>'; -$body .= '</ul>'; -$body .= '</div>'; -echo $body; -?>
\ No newline at end of file diff --git a/views/default/event_calendar/calendar_toggle.php b/views/default/event_calendar/calendar_toggle.php deleted file mode 100644 index 30de15cf2..000000000 --- a/views/default/event_calendar/calendar_toggle.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -$event = $vars['event_calendar_event']; -$user = $vars['entity']; -$container = get_entity($event->container_guid); -if (event_calendar_has_personal_event($event->guid, $user->guid)) { - $label = elgg_echo('event_calendar:remove_from_the_calendar_button'); -} else { - $label = elgg_echo('event_calendar:add_to_the_calendar'); -} - -if ($container->canEdit()) { - $button = elgg_view('input/button',array( - 'id'=>'event_calendar_user_data_'.$event->guid.'_'.$user->guid, - 'class' => "event-calendar-personal-calendar-toggle", - 'value' => $label, - )); - echo '<div class="event-calendar-personal-calendar-toggle-wrapper">'.$button.'<div>'; -} diff --git a/views/default/event_calendar/conference_button.php b/views/default/event_calendar/conference_button.php deleted file mode 100644 index 79fa9c5a2..000000000 --- a/views/default/event_calendar/conference_button.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -// A non-admin / non-event-creator only sees the button if they have the event on his/her personal calendar -// and it is at most 15 minutes before the conference starts. - -// The button is removed for everyone (even admins) one day after the event end time. - -$event = $vars['event']; - -if ($event) { - elgg_load_library('elgg:event_calendar'); - $user_guid = elgg_get_logged_in_user_guid(); - $termination_time = strtotime("1 day",$event->real_end_time); - if ($termination_time < time()) { - $in_time_window = FALSE; - } else if ($event->canEdit()) { - $in_time_window = TRUE; - } else if (event_calendar_has_personal_event($event->guid, $user_guid) && (strtotime('-15 minutes',$event->start_date) <= time())) { - $in_time_window = TRUE; - } else { - $in_time_window = FALSE; - } - if ( $in_time_window ) { - $button = elgg_view('output/url', array( - 'href' => 'action/event_calendar/join_conference?event_guid='.$event->guid, - 'text' => elgg_echo('event_calendar:join_conf_button'), - 'class' => 'elgg-button elgg-button-action', - 'target' => '_blank', - 'is_action' => TRUE, - )); - - echo '<div class="event-calendar-conf-join-button">'.$button.'</div>'; - } -} diff --git a/views/default/event_calendar/container.php b/views/default/event_calendar/container.php deleted file mode 100644 index cb5c8620c..000000000 --- a/views/default/event_calendar/container.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -elgg_load_library('elgg:event_calendar'); -$site_calendar = elgg_get_plugin_setting('site_calendar', 'event_calendar'); -$group_calendar = elgg_get_plugin_setting('group_calendar', 'event_calendar'); -$admin = elgg_is_admin_logged_in(); -$containers = array(); -if (($site_calendar != 'no') && ($admin || !$site_calendar || ($site_calendar == 'loggedin'))) { - $containers[0] = elgg_echo('event_calendar:site_calendar'); -} -$user = elgg_get_logged_in_user_entity(); -$groups = $user->getGroups('',0,0); -foreach ($groups as $group) { - if (event_calendar_activated_for_group($group)) { - if ($admin || !$group_calendar || $group_calendar == 'members') { - if ($group->canWriteToContainer($user->guid)) { - $containers[$group->guid] = $group->name; - } - } else if ($group->canEdit()) { - $containers[$group->guid] = $group->name; - } - } -} -if ($vars['container_guid']) { - $value = $vars['container_guid']; -} else { - $value = 0; -} -echo elgg_view('input/dropdown',array('name'=>'group_guid', 'value'=>$vars['container_guid'],'options_values'=>$containers)); diff --git a/views/default/event_calendar/css.php b/views/default/event_calendar/css.php deleted file mode 100644 index 00cfd6cbb..000000000 --- a/views/default/event_calendar/css.php +++ /dev/null @@ -1,264 +0,0 @@ -<?php -//$background_colour = '#EBF1EB'; -//$highlight_colour = '#478787'; - -$background_colour = '#F5F5F5'; -$highlight_colour = '#3874B7'; -?> - -#calendarmenucontainer { - position:relative; - left: 25px; -} - -ul#calendarmenu li { - float: left; - border-top: 1px solid #969696; - border-left: 1px solid #969696; - border-bottom: 1px solid #969696; - background-color: <?php echo $background_colour; ?>; -} - - -ul#calendarmenu li.sys_calmenu_last { - border-right: 1px solid #969696; -} - -ul#calendarmenu li a { - text-decoration: none; - padding: 4px 12px; - float: left; -} - -ul#calendarmenu li a:hover, ul#calendarmenu li.sys_selected a{ - text-decoration: none; - padding: 4px 12px; - float: left; - color: #FFFFFF; - background: <?php echo $highlight_colour; ?>; -} - -.event-calendar-ical { - width: 200px; -} - -td.ui-datepicker-unselectable { - background-color: #FFFFFF !important; - color: #888888 !important; -} - -#my_datepicker .week-highlight a { - text-decoration: none; - color: #FFFFFF; - background: <?php echo $highlight_colour; ?>; -} - -.river_object_event_calendar_create { - background: url(<?php echo $vars['url']; ?>mod/event_calendar/images/river_icon_event.gif) no-repeat left -1px; -} -.river_object_event_calendar_update { - background: url(<?php echo $vars['url']; ?>mod/event_calendar/images/river_icon_event.gif) no-repeat left -1px; -} -#event_list { - width:510px; - margin:0; - float:left; - padding:5px 0 0 0; -} -#event_list .search_listing { - border:2px solid #cccccc; - margin:0 0 5px 0; -} - -.events { - min-height: 300px; -} - -div.event_calendar_agenda_date_section { - margin-bottom: 10px; -} - -.event_calendar_agenda_date { - font-size: 1.3em; - font-weight: bold; - margin-bottom: 3px; -} - -th.agenda_header { - font-weight: bold; -} - -td.event_calendar_agenda_time { - width: 120px; -} - -.event_calendar_agenda_title a { - font-weight: bold; -} - -td.event_calendar_agenda_title { - width: 180px; -} - -.event_calendar_agenda_venue { - margin-bottom: 5px; -} - -.event_calendar_paged_month { - font-size: 1.3em; - font-weight: bold; - margin-bottom: 5px; - text-transform:uppercase; -} - -td.event_calendar_paged_date { - width: 80px; -} -td.event_calendar_paged_time { - width: 60px; -} -td.event_calendar_paged_title { - width: 280px; -} - -td.event_calendar_paged_calendar { - padding-left: 30px; -} - -table.event_calendar_paged_table { - width:100%; - border-collapse:collapse; - border-bottom-width:1px; - border-bottom-style:solid; - border-bottom-color:#bfbfbf; - margin-bottom: 5px; -} - -table.event_calendar_paged_table td { - border-width:1px 0 0 0; - border-style:solid; - border-color:#bfbfbf; -} - -table.event_calendar_paged_table th { - font-family:verdana, helvetica, arial, sans-serif; - font-size:9pt; - color:#183e76; - background-color:#ececec; - font-weight:bold; - text-transform:none; - padding:3px 3px 3px 3px; -} - -.event_calendar_strapline { - font-size: 85%; -} - -.event-calendar-personal-calendar-toggle-wrapper { - width: 100%; - margin-bottom: 30px; -} - -.event-calendar-personal-calendar-toggle { - float: right; -} - -li.event-calendar-filter-menu-show-only { - border:0; - padding-top:.4em; - background:#fff; - margin:0 -.3em 0 1.5em; -} - -.event-calendar-compressed-date { - width: 150px !important; - margin-right: 10px; -} - -fieldset > legend { - font-weight: bold; - font-size: 1.2em; - line-height: 1.1em; - padding-bottom: 5px; -} -.event-calendar-repeating-wrapper { - padding: 0; - margin-top: 5px; -} -.event-calendar-repeating-unselected { - font-size: 16px; - font-weight: bold; - color: #DDDDDD; - background-color: #AAAAAA; - border: 1px solid #444444; - padding: 5px; - width: 25px; - text-align: center; - display: inline-block; - margin: 0; -} - -.event-calendar-repeating-unselected:hover { - text-decoration: none; -} - -.event-calendar-repeating-selected { - font-size: 16px; - font-weight: bold; - color: #000000; - background-color: #FFFFFF; - border: 1px solid #000000; - padding: 5px; - width: 25px; - text-align: center; - display: inline-block; - margin: 0; -} - -.event-calendar-repeating-selected:hover { - text-decoration: none; - color: #CCCCCC; -} - -.event-calendar-edit-form-schedule-block ul.elgg-vertical li { - display: block !important; - clear: both; -} - -.event-calendar-edit-form-block ul.elgg-vertical li label { - font-weight: normal; - width: 500px; -} - -.event-calendar-edit-form-block h2 { - font-size: 18px; - color: #000000; -} - -.event-calendar-edit-date-wrapper { - clear: both; - margin-left: 20px; - display: none; -} - -.event-calendar-edit-reminder-wrapper { - margin-top: 10px; - display: none; -} - -.event-calendar-edit-form-membership-block, .event-calendar-edit-form-share-block { - display: none; -} - -.event-calendar-description { - display: none; -} - -.event-calendar-edit-bottom { - clear: both; - margin-bottom: 5px; -} - -.event-calendar-date-selected { - background-color: #DDDDFF; -} diff --git a/views/default/event_calendar/datetime_edit.php b/views/default/event_calendar/datetime_edit.php deleted file mode 100644 index 2e0830167..000000000 --- a/views/default/event_calendar/datetime_edit.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -$event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar'); -$event_calendar_hide_end = elgg_get_plugin_setting('hide_end', 'event_calendar'); -$prefix = $vars['prefix']; -$body = ''; - -if ($event_calendar_times != 'no') { - if ($event_calendar_hide_end != 'yes') { - $body .= '<p><label>'.elgg_echo('event_calendar:from_label').'</label>'; - } - $body .= elgg_view("input/date", array( - 'class'=>'event-calendar-compressed-date', - 'name' => 'start_date', - 'value'=>$vars['start_date'], - )); - $body .= '<span id="event-calendar-start-time-wrapper">'; - $body .= elgg_view("input/timepicker",array('name' => 'start_time','value'=>$vars['start_time'])); - $body .= '</span>'; - if ($event_calendar_hide_end != 'yes') { - $body .= '</p><p id="event-calendar-to-time-wrapper"><label>'.elgg_echo('event_calendar:to_label').'</label>'; - $body .= elgg_view("input/date", array( - 'class'=>'event-calendar-compressed-date', - 'name' => 'end_date', - 'value'=>$vars['end_date'], - )); - $body .= '<span id="event-calendar-end-time-wrapper">'; - $body .= elgg_view("input/timepicker",array('name' => 'end_time','value'=>$vars['end_time'])); - $body .= '</span>'; - } - $body .= '</p>'; -} else { - - $body .= '<p><label>'.elgg_echo("event_calendar:start_date_label").'<br />'; - $body .= elgg_view("event_calendar/input/date_local",array('timestamp'=>TRUE, 'autocomplete'=>'off','name' => 'start_date','value'=>$vars['start_date'])); - $body .= '</label></p>'; - $body .= '<p class="description">'.$prefix['start_date'].elgg_echo('event_calendar:start_date_description').'</p>'; - - if ($event_calendar_hide_end != 'yes') { - $body .= '<p id="event-calendar-to-time-wrapper"><label>'.elgg_echo("event_calendar:end_date_label").'<br />'; - $body .= elgg_view("event_calendar/input/date_local",array('timestamp'=>TRUE,'autocomplete'=>'off','name' => 'end_date','value'=>$vars['end_date'])); - $body .= '</label></p>'; - //$body .= '<p class="description">'.$prefix['end_date'].elgg_echo('event_calendar:end_date_description').'</p>'; - } -} - -echo $body;
\ No newline at end of file diff --git a/views/default/event_calendar/entities/entity_list.php b/views/default/event_calendar/entities/entity_list.php deleted file mode 100644 index 84c2c0b7d..000000000 --- a/views/default/event_calendar/entities/entity_list.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php -/** - * View a list of entities - * - * @package Elgg - * @author Curverider Ltd <info@elgg.com> - * @link http://elgg.com/ - * - */ - -$context = $vars['context']; -$offset = $vars['offset']; -$entities = $vars['entities']; -$limit = $vars['limit']; -$count = $vars['count']; -$baseurl = $vars['baseurl']; -$context = $vars['context']; -$viewtype = $vars['viewtype']; -$pagination = $vars['pagination']; -$fullview = $vars['fullview']; - -$html = ""; -$nav = ""; - -if (isset($vars['viewtypetoggle'])) { - $viewtypetoggle = $vars['viewtypetoggle']; -} else { - $viewtypetoggle = true; -} - -if ($context == "search" && $count > 0 && $viewtypetoggle) { - $nav .= elgg_view('navigation/viewtype', array( - 'baseurl' => $baseurl, - 'offset' => $offset, - 'count' => $count, - 'viewtype' => $viewtype, - )); -} - -if ($pagination) { - $nav .= elgg_view('navigation/pagination',array( - 'baseurl' => $baseurl, - 'offset' => $offset, - 'count' => $count, - 'limit' => $limit, - )); -} - -$html .= $nav; -if ($viewtype == '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('event_calendar/entities/gallery', array('entities' => $entities)); - } -} - -if ($count) { - $html .= $nav; -} - -echo $html;
\ No newline at end of file diff --git a/views/default/event_calendar/entities/gallery.php b/views/default/event_calendar/entities/gallery.php deleted file mode 100644 index a12dfa84a..000000000 --- a/views/default/event_calendar/entities/gallery.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * Elgg gallery view - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - */ - -$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('event_calendar/entities/gallery_item',array('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/event_calendar/entities/gallery_item.php b/views/default/event_calendar/entities/gallery_item.php deleted file mode 100644 index 9fc1edeca..000000000 --- a/views/default/event_calendar/entities/gallery_item.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - - /** - * Elgg user display (gallery) - * - * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - * - * @uses $vars['entity'] The user entity - */ - -$icon = elgg_view( - "profile/icon", array( - 'entity' => $vars['entity'], - 'size' => 'medium', - ) - ); - -$banned = $vars['entity']->isBanned(); - -$rel = ""; -if (elgg_get_page_owner_guid() == $vars['entity']->guid) - $rel = 'me'; -else if (check_entity_relationship(elgg_get_page_owner_guid(), 'friend', $vars['entity']->guid)) - $rel = 'friend'; - -if (!$banned) - $info .= "<p><b><a href=\"" . $vars['entity']->getUrl() . "\" rel=\"$rel\">" . $vars['entity']->name . "</a></b></p>"; -else - $info .= "<p><b><strike>" . $vars['entity']->name . "</b></strike><br />".elgg_echo('profile:banned')."</p>"; - -// TODO: look into a way to pass $authorised and $event_id in $vars -$authorised = FALSE; -$event_id = get_input('event_id', 0); -if ($event_id) { - if(isadminloggedin()) { - $authorised = TRUE; - } else { - // load the event from the database - $event = get_entity($event_id); - $user_id = elgg_get_logged_in_user_guid(); - if ($event && ($event->owner_guid == $user_id)) { - $authorised = TRUE; - } - } -} - -if ($authorised) { - $link = '<p><a href="#" '; - $link .= 'onclick="javascript:event_calendar_personal_toggle('.$event_id.','.$vars['entity']->guid.'); return false;" '; - $link .= ' >'; - $link .= '<span id="event_calendar_user_data_'.$vars['entity']->guid.'">'.elgg_echo('event_calendar:remove_from_the_calendar').'</span>'; - $link .= '</a></p>'; - $info .= $link; -} - -// echo elgg_view_image_block($icon, $info); -echo elgg_view('search/gallery_listing',array('icon' => $icon, 'info' => $info)); - -?>
\ No newline at end of file diff --git a/views/default/event_calendar/filter_menu.php b/views/default/event_calendar/filter_menu.php deleted file mode 100644 index 1364902a8..000000000 --- a/views/default/event_calendar/filter_menu.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php -// generate a list of filter tabs -$group_guid = $vars['group_guid']; -$filter_context = $vars['filter']; -if ($group_guid) { - $url_start = "event_calendar/group/{$group_guid}/{$vars['start_date']}/{$vars['mode']}"; -} else { - $url_start = "event_calendar/list/{$vars['start_date']}/{$vars['mode']}"; -} - -$tabs = array( - 'all' => array( - 'text' => elgg_echo('event_calendar:show_all'), - 'href' => "$url_start/all", - 'selected' => ($filter_context == 'all'), - 'priority' => 200, - ), -); - -if (elgg_is_logged_in()) { - $tabs ['mine'] = array( - 'text' => elgg_echo('event_calendar:show_mine'), - 'href' => "$url_start/mine", - 'selected' => ($filter_context == 'mine'), - 'priority' => 300, - ); - $tabs['friend'] = array( - 'text' => elgg_echo('event_calendar:show_friends'), - 'href' => "$url_start/friends", - 'selected' => ($filter_context == 'friends'), - 'priority' => 400, - ); -} - -$tab_rendered = array(); - -$event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar'); -if ($event_calendar_spots_display == "yes") { - $tabs['open'] = array( - 'text' => elgg_echo('event_calendar:show_open'), - 'href' => "$url_start/open", - 'selected' => ($filter_context == 'open'), - 'priority' => 100, - ); -} else { - $tab_rendered['open'] = ''; -} - -foreach ($tabs as $name => $tab) { - if ($tab['selected']) { - $state_selected = ' class="elgg-state-selected"'; - } else { - $state_selected = ''; - } - $tab_rendered[$name] = '<li'.$state_selected.'><a href="'.elgg_normalize_url($tab['href']).'">'.$tab['text'].'</a></li>'; - - //elgg_register_menu_item('filter', $tab); -} - -//echo elgg_view_menu('filter', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz')); - -$menu = <<<__MENU -<ul class="elgg-menu elgg-menu-filter elgg-menu-hz elgg-menu-filter-default"> - {$tab_rendered['open']} - {$tab_rendered['all']} - {$tab_rendered['mine']} - {$tab_rendered['friend']} -</ul> -__MENU; - -echo $menu; - -$event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar'); -if ($event_calendar_region_display == 'yes') { - elgg_load_js("elgg.event_calendar"); - $url_start .= "/$filter_context"; - echo elgg_view('event_calendar/region_select',array('url_start'=>$url_start,'region'=>$vars['region'])); -}
\ No newline at end of file diff --git a/views/default/event_calendar/forms/add_to_group.php b/views/default/event_calendar/forms/add_to_group.php deleted file mode 100644 index 2c8fdec53..000000000 --- a/views/default/event_calendar/forms/add_to_group.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -// Game plan - display two drop downs: one with a list of groups -// without this event, one with - can add using one and remove using -// the other -// the user must have the authority to edit the groups - -$event_id = $vars['event']->guid; -$event_container = $vars['event']->container_guid; - -// get the list of all groups: - -if (elgg_is_admin_logged_in()) { - $groups = elgg_get_entities(array( - 'type' => 'group', - 'limit' => 5000, - )); -} else { - $groups = elgg_get_entities(array( - 'type' => 'group', - 'owner_guid' => elgg_get_logged_in_user_guid(), - 'limit' => 5000, - )); -} - -// split the group list into two lists - -$add_options = array(); -$remove_options = array(); -$remove_group = elgg_get_entities_from_relationship(array( - 'relationship' => 'display_on_group', - 'relationship_guid' => $event_id, - 'inverse_relationship' => FALSE, - 'limit' => 5000, -)); -$remove_group_ids = array(); -foreach ($remove_group as $group) { - $remove_group_ids[] = $group->guid; - if ($group->guid != $event_container && $group->canEdit()) { - $remove_options[$group->guid] = $group->name; - } -} - -if ($remove_group) { - foreach($groups as $group) { - if (($group->guid != $event_container) && !in_array($group->guid,$remove_group_ids)) { - $add_options[$group->guid] = $group->name; - } - } -} else { - foreach($groups as $group) { - if ($group->guid != $event_container && $group->canEdit()) { - $add_options[$group->guid] = $group->name; - } - } -} - -if ($add_options || $remove_options) { - echo '<div class="contentWrapper" >'; - $event_bit = elgg_view('input/hidden', array("name" => "event_id","value" => $event_id)); - if ($add_options) { - echo "<h4>".elgg_echo('event_calendar:add_to_group:add_group_title')."</h4>"; - $add_pulldown = elgg_view("input/dropdown",array("name" => "group_id","options_values" => $add_options)); - $submit_button = "<p>".elgg_view("input/submit",array("value"=>elgg_echo('event_calendar:add_to_group:add_group_button')))."</p>"; - echo elgg_view ('input/form',array("body" => $event_bit.$add_pulldown.$submit_button,"action" => $vars['url']."action/event_calendar/add_to_group")); - } - - if ($remove_options) { - echo "<h4>".elgg_echo('event_calendar:add_to_group:remove_group_title')."</h4>"; - $remove_pulldown = elgg_view("input/dropdown",array("name" => "group_id","options_values" => $remove_options)); - $submit_button = "<p>".elgg_view("input/submit",array("value"=>elgg_echo('event_calendar:add_to_group:remove_group_button')))."</p>"; - echo elgg_view ('input/form',array("body" => $event_bit.$remove_pulldown.$submit_button,"action" => $vars['url']."action/event_calendar/remove_from_group")); - } - echo '</div>'; -} diff --git a/views/default/event_calendar/full_calendar_view.php b/views/default/event_calendar/full_calendar_view.php deleted file mode 100644 index 1a58321b5..000000000 --- a/views/default/event_calendar/full_calendar_view.php +++ /dev/null @@ -1,200 +0,0 @@ -<?php -elgg_load_js('elgg.full_calendar'); - -$timeformat = elgg_get_plugin_setting('timeformat', 'event_calendar') == 24 ? 'H(:mm)' : 'h(:mm)t'; - -// TODO: is there an easy way to avoid embedding JS? -?> -<script> - -var goToDateFlag = 0; - -handleEventClick = function(event) { - if (event.url) { - window.location.href = event.url; - event.preventDefault(); - } -}; - -handleDayClick = function(date,allDay,jsEvent,view) { - var iso = getISODate(date); - var link = $('.elgg-menu-item-event-calendar-0add').find('a').attr('href'); - var ss = link.split('/'); - var link = $('.elgg-menu-item-event-calendar-0add').find('a').attr('href'); - var ss = link.split('/'); - var last_ss = ss[ss.length-1]; - var group_guid; - if (last_ss == 'add') { - group_guid = 0; - } else if (last_ss.split('-').length == 3) { - group_guid = ss[ss.length-2]; - } else { - group_guid = last_ss; - } - var url = elgg.get_site_url(); - $('.fc-widget-content').removeClass('event-calendar-date-selected'); - var current_iso = $('#event-calendar-selected-date').val(); - if (current_iso == iso) { - // deselect - $('#event-calendar-selected-date').val(""); - $('.elgg-menu-item-event-calendar-0add').find('a').attr('href',url+'event_calendar/add/'+group_guid); - $('.event-calendar-button-add').attr('href',url+'event_calendar/add/'+group_guid); - $('.elgg-menu-item-event-calendar-1schedule').find('a').attr('href',url+'event_calendar/schedule/'+group_guid); - } else { - $('#event-calendar-selected-date').val(iso); - $('.elgg-menu-item-event-calendar-0add').find('a').attr('href',url+'event_calendar/add/'+group_guid+'/'+iso); - $('.event-calendar-button-add').attr('href',url+'event_calendar/add/'+group_guid+'/'+iso); - $('.elgg-menu-item-event-calendar-1schedule').find('a').attr('href',url+'event_calendar/schedule/'+group_guid+'/'+iso); - - $(this).addClass('event-calendar-date-selected'); - } -} - -handleEventDrop = function(event,dayDelta,minuteDelta,allDay,revertFunc) { - - if (!event.is_event_poll && !confirm("<?php echo elgg_echo('event_calendar:are_you_sure'); ?>")) { - revertFunc(); - } else { - if (event.is_event_poll) { - if (confirm("<?php echo elgg_echo('event_calendar:resend_poll_invitation'); ?>")) { - var resend = 1; - } else { - resend = 0; - } - var data = {event_guid: event.guid, startTime: event.start.toISOString(), dayDelta: dayDelta, minuteDelta: minuteDelta, resend: resend, minutes: event.minutes, iso_date: event.iso_date}; - } else { - data = {event_guid: event.guid, startTime: event.start.toISOString(), dayDelta: dayDelta, minuteDelta: minuteDelta}; - } - elgg.action('event_calendar/modify_full_calendar', - { - data: data, - success: function (res) { - var success = res.success; - var msg = res.message; - if (!success) { - elgg.register_error(msg,2000); - revertFunc() - } else { - event.minutes = res.minutes; - event.iso_date = res.iso_date; - } - } - } - ); - } -}; - -getISODate = function(d) { - var year = d.getFullYear(); - var month = d.getMonth()+1; - month = month < 10 ? '0' + month : month; - var day = d.getDate(); - day = day < 10 ? '0' + day : day; - return year +"-"+month+"-"+day; -} - -handleEventRender = function(event, element, view) { - /*if (event.is_event_poll) { - element.draggable = false; - }*/ -} - -handleGetEvents = function(start, end, callback) { - var start_date = getISODate(start); - var end_date = getISODate(end); - var url = "event_calendar/get_fullcalendar_events/"+start_date+"/"+end_date+"/<?php echo $vars['filter']; ?>/<?php echo $vars['group_guid']; ?>"; - elgg.getJSON(url, {success: - function(events) { - callback(events); - } - }); - // reset date links and classes - //$('.fc-widget-content').removeClass('event-calendar-date-selected'); - var link = $('.elgg-menu-item-event-calendar-0add').find('a').attr('href'); - if (link != undefined) { - var ss = link.split('/'); - var last_ss = ss[ss.length-1]; - var group_guid; - if (last_ss == 'add') { - group_guid = 0; - } else if (last_ss.split('-').length == 3) { - group_guid = ss[ss.length-2]; - } else { - group_guid = last_ss; - } - var url = elgg.get_site_url(); - $('.elgg-menu-item-event-calendar-0add').find('a').attr('href',url+'event_calendar/add/'+group_guid); - $('.elgg-menu-item-event-calendar-1schedule').find('a').attr('href',url+'event_calendar/schedule/'+group_guid); - } -} - -handleViewDisplay = function(view) { - // TODO: finish this, need to highlight selected date if any - var current_iso = $('#event-calendar-selected-date').val(); - if (view == 'month') { - goToDateFlag = 0; - } else if (goToDateFlag == 0 && current_iso != "") { - goToDateFlag = 1; - var a = current_iso.split("-"); - $('#calendar').fullCalendar('gotoDate',parseInt(a[0],10),parseInt(a[1],10)-1,parseInt(a[2],10)); - //$('.fc-widget-content').removeClass('event-calendar-date-selected'); - //$(".fc-widget-content[data-date='"+ciso+"']").addClass('event-calendar-date-selected'); - } - - //$(".fc-widget-content[data-date='20120105']") -} - -fullcalendarInit = function() { - - var loadFullCalendar = function() { - var locale = $.datepicker.regional[elgg.get_language()]; - if (!locale) { - locale = $.datepicker.regional['']; - } - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - month: <?php echo date('n',strtotime($vars['start_date']))-1; ?>, - ignoreTimezone: true, - editable: true, - slotMinutes: 15, - eventRender: handleEventRender, - eventDrop: handleEventDrop, - eventClick: handleEventClick, - dayClick: handleDayClick, - events: handleGetEvents, - viewDisplay: handleViewDisplay, - - isRTL: locale.isRTL, - firstDay: locale.firstDay, - monthNames: locale.monthNames, - monthNamesShort: locale.monthNamesShort, - dayNames: locale.dayNames, - dayNamesShort: locale.dayNamesShort, - buttonText: { - today: locale.currentText, - month: elgg.echo('event_calendar:month_label'), - week: elgg.echo('event_calendar:week_label'), - day: elgg.echo('event_calendar:day_label') - }, - timeFormat: "<?php echo $timeformat; ?>", - }); - } - - elgg.get({ - url: elgg.config.wwwroot + 'vendors/jquery/i18n/jquery.ui.datepicker-'+ elgg.get_language() +'.js', - dataType: "script", - cache: true, - success: loadFullCalendar, - error: loadFullCalendar, // english language is already loaded. - }); -} - -elgg.register_hook_handler('init', 'system', fullcalendarInit); - -</script> -<div id='calendar'></div> -<input type="hidden" id="event-calendar-selected-date" /> diff --git a/views/default/event_calendar/group_module.php b/views/default/event_calendar/group_module.php deleted file mode 100644 index b1c1567e7..000000000 --- a/views/default/event_calendar/group_module.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php -/** - * Group event calendar module - */ - -$group = elgg_get_page_owner_entity(); - -if ($group->event_calendar_enable == "no") { - return true; -} - -elgg_push_context('widgets'); -$content = elgg_view('event_calendar/groupprofile_calendar'); -elgg_pop_context(); - -if (!$content) { - if (elgg_get_plugin_setting('group_always_display', 'event_calendar') == 'yes') { - $content = elgg_echo('event_calendar:no_events_found'); - } -} - -if ($content) { - $all_link = elgg_view('output/url', array( - 'href' => "event_calendar/group/$group->guid", - 'text' => elgg_echo('link:view:all'), - )); - $new_link = elgg_view('output/url', array( - 'href' => "event_calendar/add/$group->guid", - 'text' => elgg_echo('event_calendar:new'), - )); - echo elgg_view('groups/profile/module', array( - 'title' => elgg_echo('event_calendar:group'), - 'content' => $content, - 'all_link' => $all_link, - 'add_link' => $new_link, - )); -} diff --git a/views/default/event_calendar/groupprofile_calendar.php b/views/default/event_calendar/groupprofile_calendar.php deleted file mode 100644 index c71780be8..000000000 --- a/views/default/event_calendar/groupprofile_calendar.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -/** - * Elgg event_calendar group profile content - * - * @package event_calendar - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Kevin Jardine <kevin@radagast.biz> - * @copyright Radagast Solutions 2008 - * @link http://radagast.biz/ - * - */ - -elgg_load_library('elgg:event_calendar'); - -$page_owner_entity = elgg_get_page_owner_entity(); - -if (event_calendar_activated_for_group($page_owner_entity)) { - $num = 5; - // Get the upcoming events - $start_date = time(); // now - $end_date = $start_date + 60*60*24*365*2; // maximum is two years from now - $events = event_calendar_get_events_between($start_date,$end_date,false,$num,0,elgg_get_page_owner_guid()); - - // If there are any events to view, view them - if (is_array($events) && sizeof($events) > 0) { - - foreach($events as $event) { - echo elgg_view("object/event_calendar",array('entity' => $event['event'])); - } - - } -} diff --git a/views/default/event_calendar/groupprofile_calendar_deprecated.php b/views/default/event_calendar/groupprofile_calendar_deprecated.php deleted file mode 100644 index 0d7d5101f..000000000 --- a/views/default/event_calendar/groupprofile_calendar_deprecated.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -/** - * Elgg event_calendar group profile content - * - * @package event_calendar - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Kevin Jardine <kevin@radagast.biz> - * @copyright Radagast Solutions 2008 - * @link http://radagast.biz/ - * - */ - -elgg_load_library('elgg:event_calendar'); - -$page_owner_entity = elgg_get_page_owner_entity(); - -if (event_calendar_activated_for_group($page_owner_entity)) { - $num = 5; - // Get the upcoming events - $start_date = time(); // now - $end_date = $start_date + 60*60*24*365*2; // maximum is two years from now - $events = event_calendar_get_events_between($start_date,$end_date,false,$num,0,elgg_get_page_owner_guid()); - - // If there are any events to view, view them - if (is_array($events) && sizeof($events) > 0) { - - echo '<div id="group_pages_widget">'; - echo '<h2>'.elgg_echo("event_calendar:groupprofile").'</h2>'; - foreach($events as $event) { - echo elgg_view("object/event_calendar",array('entity' => $event)); - } - echo '<div class="forum_latest"><a href="'.$vars['url'].'pg/event_calendar/group/'.elgg_get_page_owner_guid().'">'.elgg_echo('event_calendar:view_calendar').'</a></div>'; - echo "</div>"; - - } else if (elgg_get_plugin_setting('group_always_display', 'event_calendar') == 'yes') { - echo '<div id="group_pages_widget">'; - echo '<h2>'.elgg_echo("event_calendar:groupprofile").'</h2>'; - echo '<div class="forum_latest">'.elgg_echo('event_calendar:no_events_found').'</div>'; - echo "</div>"; - } -} - -?>
\ No newline at end of file diff --git a/views/default/event_calendar/metatags.php b/views/default/event_calendar/metatags.php deleted file mode 100644 index 8375ef118..000000000 --- a/views/default/event_calendar/metatags.php +++ /dev/null @@ -1,2 +0,0 @@ -<link rel="stylesheet" href="<?php echo $vars['url']; ?>mod/event_calendar/datepicker.css" type="text/css" media="screen" title="Flora (Default)"> -<script type="text/javascript" src="<?php echo $vars['url']; ?>mod/event_calendar/ui.datepicker.js"></script> diff --git a/views/default/event_calendar/nav.php b/views/default/event_calendar/nav.php deleted file mode 100644 index 746a46151..000000000 --- a/views/default/event_calendar/nav.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -$allselect = ''; $friendsselect = ''; $mineselect = ''; -switch($vars['filter']) { - case 'all': $allselect = 'class="selected"'; - break; - case 'friends': $friendsselect = 'class="selected"'; - break; - case 'mine': $mineselect = 'class="selected"'; - break; - case 'open': $openselect = 'class="selected"'; - break; -} - -$url_start = $vars['url'].'mod/event_calendar/show_events.php?group_guid='.$vars['group_guid'].'&mode='.$vars['mod'].'&start_date='.$vars['start_date']; - -?> -<div id="elgg_horizontal_tabbed_nav"> - <ul> -<?php -$event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar'); -if ($event_calendar_spots_display == "yes") { -?> - <li <?php echo $openselect; ?> ><a onclick="javascript:$('#event_list').load('<?php echo $url_start; ?>&filter=open&callback=true'); return false;" href="<?php echo $url_start; ?>&filter=open&callback=true"><?php echo elgg_echo('event_calendar:open'); ?></a></li> -<?php -} -?> - <li <?php echo $allselect; ?> ><a onclick="javascript:$('#event_list').load('<?php echo $url_start; ?>&filter=all&callback=true'); return false;" href="<?php echo $url_start; ?>&filter=all&callback=true"><?php echo elgg_echo('all'); ?></a></li> - <li <?php echo $friendsselect; ?> ><a onclick="javascript:$('#event_list').load('<?php echo $url_start; ?>&filter=friends&callback=true'); return false;" href="<?php echo $url_start; ?>&filter=friends&callback=true"><?php echo elgg_echo('friends'); ?></a></li> - <li <?php echo $mineselect; ?> ><a onclick="javascript:$('#event_list').load('<?php echo $url_start; ?>&filter=mine&callback=true'); return false;" href="<?php echo $url_start; ?>&filter=mine&callback=true"><?php echo elgg_echo('event_calendar:mine'); ?></a></li> - </ul> -</div> -<?php -$event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar'); -if ($event_calendar_region_display == 'yes') { - $url_start .= '&filter='.$vars['filter']; - echo elgg_view('event_calendar/region_select',array('url_start'=>$url_start,'region'=>$vars['region'])); -} -?>
\ No newline at end of file diff --git a/views/default/event_calendar/paged_footer.php b/views/default/event_calendar/paged_footer.php deleted file mode 100644 index 954769104..000000000 --- a/views/default/event_calendar/paged_footer.php +++ /dev/null @@ -1,4 +0,0 @@ -<?php -echo '</tbody></table></div>'; -?> - diff --git a/views/default/event_calendar/paged_header.php b/views/default/event_calendar/paged_header.php deleted file mode 100644 index 5f4b8e59c..000000000 --- a/views/default/event_calendar/paged_header.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -$header .= '<div class="event_calendar_paged_header_section">'; -$header .= '<div class="event_calendar_paged_month">'.$vars['date'].'</div>'; -$header .= '<table class="event_calendar_paged_table"><thead><tr>'; -$header .= '<th class="paged_header">'.elgg_echo('event_calendar:paged:column:date').'</th>'; -$header .= '<th class="paged_header">'.elgg_echo('event_calendar:paged:column:time').'</th>'; -$header .= '<th class="paged_header">'.elgg_echo('event_calendar:paged:column:event').'</th>'; -$header .= '<th class="paged_header">'.elgg_echo('event_calendar:paged:column:venue').'</th>'; -if ($vars['personal_manage'] != 'no') { - $header .= '<th class="paged_header">'.elgg_echo('event_calendar:paged:column:calendar').'</th>'; -} -$header .= '</td></thead><tbody>'; - -echo $header; -?>
\ No newline at end of file diff --git a/views/default/event_calendar/paged_item_view.php b/views/default/event_calendar/paged_item_view.php deleted file mode 100644 index f2092bafc..000000000 --- a/views/default/event_calendar/paged_item_view.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php -$event = $vars['event']; -$time_bit = ''; -if (is_numeric($event->start_time)) { - $time_bit = event_calendar_convert_time($event->start_time); -} - -$date_bit = event_calendar_get_formatted_date($event->start_date); - -if (event_calendar_has_personal_event($event->guid,elgg_get_logged_in_user_guid())) { - $calendar_bit = 'checked = "checked"'; -} else { - $calendar_bit = ''; -} - -$info = '<tr>'; -$info .= '<td class="event_calendar_paged_date">'.$date_bit.'</td>'; -$info .= '<td class="event_calendar_paged_time">'.$time_bit.'</td>'; -$info .= '<td class="event_calendar_paged_title"><a href="'.$event->getUrl().'">'.$event->title.'</a></td>'; -$info .= '<td class="event_calendar_paged_venue">'.$event->venue.'</td>'; -if ($vars['personal_manage'] != 'no') { - $info .= '<td class="event_calendar_paged_calendar"><input class="event_calendar_paged_checkbox" id="event_calendar_paged_checkbox_'.$event->guid.'" '.$calendar_bit.' type="checkbox" /></td>'; -} -$info .= '</tr>'; - -echo $info; -?>
\ No newline at end of file diff --git a/views/default/event_calendar/paged_view.php b/views/default/event_calendar/paged_view.php deleted file mode 100644 index f8257792f..000000000 --- a/views/default/event_calendar/paged_view.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -elgg_load_js('elgg.event_calendar'); -$nav = elgg_view('navigation/pagination',array( - -// 'baseurl' => $_SERVER['REQUEST_URI'], - 'baseurl' => $_SERVER['SCRIPT_NAME'].'/?'.$_SERVER['QUERY_STRING'], - 'offset' => $vars['offset'], - 'count' => $vars['count'], - 'limit' => $vars['limit'], - - )); -$event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar'); -$event_calendar_personal_manage = elgg_get_plugin_setting('personal_manage', 'event_calendar'); -$events = $vars['events']; -$html = ''; -$date_format = 'F Y'; -$current_month = ''; -if ($events) { - foreach($events as $event) { - $month = date($date_format,$event->start_date); - if ($month != $current_month) { - if ($html) { - $html .= elgg_view('event_calendar/paged_footer'); - } - $html .= elgg_view('event_calendar/paged_header',array('date'=>$month,'personal_manage'=>$event_calendar_personal_manage)); - - $current_month = $month; - } - $html .= elgg_view('event_calendar/paged_item_view',array('event'=>$event,'times'=>$event_calendar_times,'personal_manage'=>$event_calendar_personal_manage)); - } - $html .= elgg_view('event_calendar/paged_footer'); -} -$msgs = '<div id="event_calendar_paged_messages"></div>'; -$html = $msgs.$nav.'<div class="event_calendar_paged">'.$html.'</div>'.$nav; - -echo $html; diff --git a/views/default/event_calendar/personal_manage_section.php b/views/default/event_calendar/personal_manage_section.php deleted file mode 100644 index 9e03db0ab..000000000 --- a/views/default/event_calendar/personal_manage_section.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php -$fd = $vars['form_data']; -$event_calendar_personal_manage = elgg_get_plugin_setting('personal_manage', 'event_calendar'); -$body = ''; - -if ($event_calendar_personal_manage == 'by_event') { - $personal_manage_options = array( - elgg_echo('event_calendar:personal_manage:by_event:open') => 'open', - elgg_echo('event_calendar:personal_manage:by_event:closed') => 'closed', - elgg_echo('event_calendar:personal_manage:by_event:private') => 'private', - ); - $body .= '<div class="event-calendar-edit-form-block event-calendar-edit-form-membership-block">'; - $body .= '<h2>'.elgg_echo('event_calendar:personal_manage:label').'</h2>'; - $body .= elgg_view("input/radio",array('name' => 'personal_manage','value'=>$fd['personal_manage'],'options'=>$personal_manage_options)); - //$body .= '<p class="event-calendar-description">'.$prefix['personal_manage'].elgg_echo('event_calendar:personal_manage:description').'</p>'; - $body .= '<br clear="both" />'; - $body .= '</div>'; -} - -echo $body; diff --git a/views/default/event_calendar/personal_toggle_js.php b/views/default/event_calendar/personal_toggle_js.php deleted file mode 100644 index c0611e45c..000000000 --- a/views/default/event_calendar/personal_toggle_js.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php -// TODO: put the rest into a JS function - -$elgg_ts = time(); -$elgg_token = generate_action_token($elgg_ts); -$tokens = "&__elgg_ts=$elgg_ts&__elgg_token=$elgg_token"; -?> -<script type="text/javascript"> -function event_calendar_personal_toggle(event_id,user_id) { - - var link = "<?php echo $vars['url']; ?>action/event_calendar/toggle_personal_calendar?"; - link += "user_id="+user_id+"&event_id="+event_id+"&other=true"; - link += "<?php echo $tokens; ?>"; - $.get(link, - function (res) { - $('#event_calendar_user_data_'+user_id).html(res); - } - ); -} -</script>
\ No newline at end of file diff --git a/views/default/event_calendar/region_select.php b/views/default/event_calendar/region_select.php deleted file mode 100644 index a987171a2..000000000 --- a/views/default/event_calendar/region_select.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -$region_list = trim(elgg_get_plugin_setting('region_list', 'event_calendar')); -// make sure that we are using Unix line endings -$region_list = str_replace("\r\n","\n",$region_list); -$region_list = str_replace("\r","\n",$region_list); -if ($region_list) { - $body = ''; - $options_values = array('-' =>elgg_echo('event_calendar:all')); - foreach(explode("\n",$region_list) as $region_item) { - $region_item = trim($region_item); - $options_values[$region_item] = $region_item; - } - - $body .= elgg_echo('event_calendar:region_filter_by_label'); - $body .= elgg_view('input/hidden',array('id'=>'event-calendar-region-url-start','value'=>$vars['url_start'])); - $body .= elgg_view("input/dropdown",array('id' => 'event-calendar-region','value'=>$vars['region'],'options_values'=>$options_values)); - $body .= '<br />'; -} - -echo $body; diff --git a/views/default/event_calendar/reminder_section.php b/views/default/event_calendar/reminder_section.php deleted file mode 100644 index fffa6d065..000000000 --- a/views/default/event_calendar/reminder_section.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -$fd = $vars['form_data']; -$event_calendar_reminders = elgg_get_plugin_setting('reminders', 'event_calendar'); -$body = ''; -if ($event_calendar_reminders == 'yes') { - $body .= '<div class="event-calendar-edit-reminder-wrapper">'; - if ($fd['send_reminder']) { - $body .= elgg_view('input/checkbox',array('name'=>'send_reminder','checked' => 'checked','value'=>1)); - } else { - $body .= elgg_view('input/checkbox',array('name'=>'send_reminder','value'=>1)); - } - $body .= elgg_echo('elgg_calendar:send_reminder_label'). ' '; - $numbers = array(); - for ($i=1;$i<60;$i++) { - $numbers[$i] = $i; - } - $intervals = array( - 1 => elgg_echo('event_calendar:interval:minute'), - 60 => elgg_echo('event_calendar:interval:hour'), - 60*24 => elgg_echo('event_calendar:interval:day'), - ); - - $body .= elgg_view('input/dropdown',array('name'=>'reminder_number','options_values'=>$numbers,'value'=>$fd['reminder_number'])); - $body .= elgg_view('input/dropdown',array('name'=>'reminder_interval','options_values'=>$intervals,'value'=>$fd['reminder_interval'])); - $body .= elgg_echo('elgg_calendar:send_reminder_before'); - $body .= '</div>'; -} -echo $body; diff --git a/views/default/event_calendar/repeat_form_element.php b/views/default/event_calendar/repeat_form_element.php deleted file mode 100644 index 5de858caf..000000000 --- a/views/default/event_calendar/repeat_form_element.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php -$event = $vars['event']; -$fd = $vars['form_data']; -$days = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'); - -if ($fd['repeats'] == 'yes') { - echo elgg_view('input/checkbox',array('name'=>'repeats','value'=>'yes','checked'=>'checked')); -} else { - echo elgg_view('input/checkbox',array('name'=>'repeats','value'=>'yes')); -} -echo elgg_echo('event_calendar:repeat_interval_label').' '; -echo elgg_view('input/dropdown',array('name'=>'repeat_interval','value'=>$fd['repeat_interval'],'options_values'=>array('1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8'))); -echo ' '.elgg_echo('event_calendar:repeat_weeks'); -echo ' '.elgg_echo('event_calendar:on_these_days'); - -echo '<div class="event-calendar-repeating-wrapper">'; - -foreach($days as $day) { - $label = elgg_echo("event_calendar:day_abbrev:$day"); - echo <<<HTML -<a id="event-calendar-repeating-$day" href="javascript:void(0);" class="event-calendar-repeating-unselected"> - $label -</a> -HTML; - -} - -echo '</div>'; - -foreach($days as $day) { - echo elgg_view('input/hidden', array('name' => "event-calendar-repeating-$day-value", 'value' => $fd["event-calendar-repeating-$day-value"])); -}
\ No newline at end of file diff --git a/views/default/event_calendar/review_requests.php b/views/default/event_calendar/review_requests.php deleted file mode 100644 index 11916b4e3..000000000 --- a/views/default/event_calendar/review_requests.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -foreach($vars['requests'] as $request) { - if ($request instanceof ElggUser) { - $icon = elgg_view("profile/icon", array( - 'entity' => $request, - 'size' => 'small' - )); - $info = '<a href="' . $request->getURL() . '" >'.$request->name.'</a>'; - $info .= '<div style="margin-top: 5px;" ></div>'; - $info .= elgg_view('output/confirmlink', - array( - 'class' => "elgg-button elgg-button-delete", - 'href' => 'action/event_calendar/killrequest?user_guid='.$request->guid.'&event_guid=' . $vars['entity']->guid, - 'confirm' => elgg_echo('event_calendar:request:remove:check'), - 'text' => elgg_echo('event_calendar:review_requests:reject'), - 'title' => elgg_echo('event_calendar:review_requests:reject:title'), - )); - $info .= ' '; - $info .= elgg_view('output/url', array( - 'text' => elgg_echo('event_calendar:review_requests:accept'), - 'title' => elgg_echo('event_calendar:review_requests:accept:title'), - 'href' => "action/event_calendar/addtocalendar?user_guid={$request->guid}&event_guid={$vars['entity']->guid}", - 'class' => "elgg-button elgg-button-submit", - 'is_action' => TRUE, - )); - //$url = elgg_add_action_tokens_to_url("{$vars['url']}action/event_calendar/addtocalendar?user_guid={$request->guid}&event_guid={$vars['entity']->guid}"); - echo elgg_view_image_block($icon,$info); - } -} diff --git a/views/default/event_calendar/schedule_section.php b/views/default/event_calendar/schedule_section.php deleted file mode 100644 index 3a74dc789..000000000 --- a/views/default/event_calendar/schedule_section.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -$event = $vars['event']; -$fd = $vars['form_data']; -$event_calendar_repeated_events = elgg_get_plugin_setting('repeated_events', 'event_calendar'); - -$body = '<div class="event-calendar-edit-date-wrapper">'; -$body .= elgg_view('event_calendar/datetime_edit', - array( - 'start_date' => $fd['start_date'], - 'end_date' => $fd['end_date'], - 'start_time' => $fd['start_time'], - 'end_time' => $fd['end_time'], - 'prefix' => $vars['prefix'], -)); -if ($event_calendar_repeated_events == 'yes') { - $body .= elgg_view('event_calendar/repeat_form_element',$vars); -} - -$body .= elgg_view('event_calendar/reminder_section',$vars); -$body .= '</div>'; - -echo $body; diff --git a/views/default/event_calendar/share_section.php b/views/default/event_calendar/share_section.php deleted file mode 100644 index c4f6cf45f..000000000 --- a/views/default/event_calendar/share_section.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -$fd = $vars['form_data']; -$event_calendar_hide_access = elgg_get_plugin_setting('hide_access', 'event_calendar'); -$body = '<fieldset>'; -$body .= '<legend>'.elgg_echo('event_calendar:permissions:header').'</legend>'; -if($event_calendar_hide_access == 'yes') { - $event_calendar_default_access = elgg_get_plugin_setting('default_access', 'event_calendar'); - if($event_calendar_default_access) { - $body .= elgg_view("input/hidden",array('name' => 'access_id','value'=>$event_calendar_default_access)); - } else { - $body .= elgg_view("input/hidden",array('name' => 'access_id','value'=>ACCESS_DEFAULT)); - } -} else { - $body .= '<p><label>'.elgg_echo('event_calendar:read_access').'</label>'; - $body .= elgg_view("input/access",array('name' => 'access_id','value'=>$fd['access_id'])); - $body .= '</p>'; -} -if (elgg_plugin_exists('entity_admins')) { - $body .= elgg_echo('event_calendar:share_ownership:label'); - $body .= '<br />'; - $body .= elgg_echo('event_calendar:share_ownership:description'); - $body .= elgg_view('input/entity_admins_dropdown',array('entity'=>$vars['event'])); -} -$body .= '</fieldset>'; - -echo $body; diff --git a/views/default/event_calendar/show_events.php b/views/default/event_calendar/show_events.php deleted file mode 100644 index 3a484e756..000000000 --- a/views/default/event_calendar/show_events.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -/** - * Elgg show events view - * - * @package event_calendar - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Kevin Jardine <kevin@radagast.biz> - * @copyright Radagast Solutions 2008-12 - * @link http://radagast.biz/ - * - */ - -elgg_load_library('elgg:event_calendar'); - -$listing_format = $vars['listing_format']; - -if ($vars['events']) { - if ($listing_format == 'agenda') { - $vars['events'] = event_calendar_flatten_event_structure($vars['events']); - $event_list = elgg_view('event_calendar/agenda_view',$vars); - } else if ($listing_format == 'paged') { - $vars['events'] = event_calendar_flatten_event_structure($vars['events']); - $event_list = elgg_view('event_calendar/paged_view',$vars); - } else if ($listing_format == 'full') { - $event_list = elgg_view('event_calendar/full_calendar_view',$vars); - } else { - $vars['events'] = event_calendar_flatten_event_structure($vars['events']); - $options = array( - 'list_class' => 'elgg-list-entity', - 'full_view' => FALSE, - 'pagination' => TRUE, - 'list_type' => 'listing', - 'list_type_toggle' => FALSE, - 'offset' => $vars['offset'], - 'limit' => $vars['limit'], - ); - $event_list = elgg_view_entity_list($vars['events'], $options); - } -} else { - if ($listing_format == 'full') { - // show the empty calendar - $event_list = elgg_view('event_calendar/full_calendar_view',$vars); - } else { - $event_list = '<p>'.elgg_echo('event_calendar:no_events_found').'</p>'; - } -} -if ($listing_format == 'paged' || $listing_format == 'full') { - echo $event_list; -} else { -?> -<div style="width:100%"> -<div id="event_list" style="float:left;"> -<?php -echo $event_list; -?> -</div> -<div style="float:right;"> -<?php -echo elgg_view('event_calendar/calendar',$vars); -?> -</div> -</div> -<?php -} diff --git a/views/default/event_calendar/strapline.php b/views/default/event_calendar/strapline.php deleted file mode 100644 index edc60aa3e..000000000 --- a/views/default/event_calendar/strapline.php +++ /dev/null @@ -1,18 +0,0 @@ -<div class="contentWrapper"> -<span class="event_calendar_strapline"> -<?php - - $event = $vars['entity']; - - $time_updated = $event->time_created; - $owner_guid = $event->owner_guid; - $owner = get_entity($owner_guid); - - echo sprintf(elgg_echo('event_calendar:strapline'), - elgg_view_friendly_time($time_updated), - "<a href=\"" . $owner->getURL() . "\">" . $owner->name ."</a>" - ); - -?> -</span> -</div>
\ No newline at end of file diff --git a/views/default/export/entity.php b/views/default/export/entity.php new file mode 100644 index 000000000..3064f1288 --- /dev/null +++ b/views/default/export/entity.php @@ -0,0 +1,79 @@ +<?php +/** + * Elgg Entity export. + * Displays an entity using the current view. + * + * @package Elgg + * @subpackage Core + */ + +$entity = $vars['entity']; +if (!$entity) { + throw new InvalidParameterException(elgg_echo('InvalidParameterException:NoEntityFound')); +} +$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(); +?> +<div> +<h2><?php echo elgg_echo('Entity'); ?></h2> + <?php + foreach ($entity as $k => $v) { + 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 + } + } + ?> +</div> + +<?php if ($metadata) { ?> +<div id="metadata" class="mtm"> +<h2><?php echo elgg_echo('metadata'); ?></h2> + <?php + foreach ($metadata as $m) { +?> + <p class="margin-none"><b><?php echo $m->name; ?>: </b><?php echo $m->value; ?></p> +<?php + } + ?> + +</div> +<?php } ?> + +<?php if ($annotations) { ?> +<div id="annotations" class="mtm"> +<h2><?php echo elgg_echo('annotations'); ?></h2> + <?php + foreach ($annotations as $a) { +?> + <table> + <p class="margin-none"><b><?php echo $a->name; ?>: </b><?php echo $a->value; ?></p> + </table> +<?php + } + ?> +</div> +<?php } ?> + +<?php if ($relationships) { ?> +<div id="relationship" class="mtm"> +<h2><?php echo elgg_echo('relationships'); ?></h2> + <?php + foreach ($relationships as $r) { +?> + <table> + <p class="margin-none"><b><?php echo $r->relationship; ?>: </b><?php echo $r->guid_two; ?></p> + </table> +<?php + } + ?> +</div> +<?php } ?> diff --git a/views/default/export/metadata.php b/views/default/export/metadata.php new file mode 100644 index 000000000..1dd7f2054 --- /dev/null +++ b/views/default/export/metadata.php @@ -0,0 +1,14 @@ +<?php +/** + * Elgg metadata export. + * Displays a metadata item using the current view. + * + * @package Elgg + * @subpackage Core + */ + +$m = $vars['metadata']; +$e = get_entity($m->entity_guid); +?> +<p class="margin-none"><?php if ($e) echo "<a href=\"" . $e->getURL() . "\">GUID:{$m->entity_guid}</a>"; else echo "GUID:".$m->entity_guid; +?>: <b><?php echo $m->name; ?></b> <?php echo $m->value; ?></p>
\ No newline at end of file diff --git a/views/default/export/relationship.php b/views/default/export/relationship.php new file mode 100644 index 000000000..d8cb3e4f4 --- /dev/null +++ b/views/default/export/relationship.php @@ -0,0 +1,21 @@ +<?php +/** + * Elgg relationship export. + * Displays a relationship using the current view. + * + * @package Elgg + * @subpackage Core + */ + +$r = $vars['relationship']; + +$e1 = get_entity($r->guid_one); +$e2 = get_entity($r->guid_two); +?> +<p class="margin-none"><?php + if ($e1) echo "<a href=\"" . $e1->getURL() . "\">GUID:" . $r->guid_one . "</a>"; else echo "GUID:".$r->guid_one; +?> +<b><?php echo $r->relationship; ?></b> +<?php + if ($e2) echo "<a href=\"" . $e2->getURL() . "\">GUID:" . $r->guid_two . "</a>"; else echo "GUID:".$r->guid_two; +?></p> 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/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 new file mode 100644 index 000000000..9acabf3ea --- /dev/null +++ b/views/default/forms/comments/add.php @@ -0,0 +1,37 @@ +<?php +/** + * Elgg comments add form + * + * @package Elgg + * + * @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']) && 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 { +?> + <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( + 'name' => 'entity_guid', + 'value' => $vars['entity']->getGUID() + )); +} diff --git a/views/default/forms/event_calendar/edit.php b/views/default/forms/event_calendar/edit.php deleted file mode 100644 index 747dae0f0..000000000 --- a/views/default/forms/event_calendar/edit.php +++ /dev/null @@ -1,233 +0,0 @@ -<?php -$event = $vars['event']; -$fd = $vars['form_data']; - -$schedule_options = array( - elgg_echo('event_calendar:all_day_label') => 'all_day', - elgg_echo('event_calendar:schedule_type:fixed')=>'fixed', -); - -if (elgg_is_active_plugin('event_poll')) { - $schedule_options = array_merge(array(elgg_echo('event_calendar:schedule_type:poll')=>'poll'),$schedule_options); -} - -$event_calendar_fewer_fields = elgg_get_plugin_setting('fewer_fields', 'event_calendar'); -$event_calendar_repeating_events = elgg_get_plugin_setting('repeating_events', 'event_calendar'); - -$event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar'); -$event_calendar_type_display = elgg_get_plugin_setting('type_display', 'event_calendar'); -$event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar'); - -$event_calendar_more_required = elgg_get_plugin_setting('more_required', 'event_calendar'); -$event_calendar_bbb_server_url = elgg_get_plugin_setting('bbb_server_url', 'event_calendar'); - -if ($event_calendar_more_required == 'yes') { - $required_fields = array('title','venue','start_date','start_time', - 'brief_description','region','event_type','fees','contact','organiser', - 'event_tags','spots'); -} else { - $required_fields = array('title','venue','start_date'); -} -$all_fields = array('title','venue','start_time','start_date','end_time','end_date', - 'brief_description','region','event_type','fees','contact','organiser','event_tags', - 'long_description','spots','personal_manage'); - -$prefix = array(); -foreach ($all_fields as $fn) { - if (in_array($fn,$required_fields)) { - $prefix[$fn] = elgg_echo('event_calendar:required').' '; - } else { - $prefix[$fn] = elgg_echo('event_calendar:optional').' '; - } -} - -if ($event) { - $event_action = 'manage_event'; - $event_guid = $event->guid; -} else { - $event_action = 'add_event'; - $event_guid = 0; -} - -$title = $fd['title']; -$brief_description = $fd['description']; -$venue = $fd['venue']; - -$fees = $fd['fees']; -if ($event_calendar_spots_display) { - $spots = $fd['spots']; -} -if ($event_calendar_region_display) { - $region = $fd['region']; -} -if ($event_calendar_type_display) { - $event_type = $fd['event_type']; -} -$contact = $fd['contact']; -$organiser = $fd['organiser']; -$event_tags = $fd['tags']; -$all_day = $fd['all_day']; -$schedule_type = $fd['schedule_type']; -$long_description = $fd['long_description']; - -$body = '<div>'; - -$body .= elgg_view('input/hidden',array('name'=>'event_action', 'value'=>$event_action)); -$body .= elgg_view('input/hidden',array('name'=>'event_guid', 'value'=>$event_guid)); - -$body .= '<fieldset>'; -$body .= '<legend>' . elgg_echo('event_calendar:basic:header') . '</legend>'; - -$body .= '<p><label>'.elgg_echo("event_calendar:title_label").'</label>'; -$body .= elgg_view("input/text",array('name' => 'title', 'value' => $title)); -$body .= '</p>'; -$body .= '<p class="event-calendar-description">'.$prefix['title'].elgg_echo('event_calendar:title_description').'</p>'; - -$body .= '<p><label>'.elgg_echo("event_calendar:venue_label").'</label>'; -$body .= elgg_view("input/text",array('name' => 'venue', 'value' => $venue)); -$body .= '</p>'; -$body .= '<p class="event-calendar-description">'.$prefix['venue'].elgg_echo('event_calendar:venue_description').'</p>'; - -if ($event_calendar_fewer_fields != 'yes') { - $body .= '<p><label>'.elgg_echo("event_calendar:brief_description_label").'</label>'; - $body .= elgg_view("input/text",array('name' => 'description', 'value' => $brief_description)); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['brief_description'].elgg_echo('event_calendar:brief_description_description').'</p>'; - -} else { - $body .= '<label>'.elgg_echo("event_calendar:long_description_label").'</label>'; - $body .= elgg_view("input/longtext",array('name' => 'long_description', 'value' => $long_description)); - $body .= '<p class="event-calendar-description">'.$prefix['long_description'].elgg_echo('event_calendar:long_description_description').'</p>'; -} - -$body .= '<p><label>'.elgg_echo("event_calendar:event_tags_label").'</label>'; -$body .= elgg_view("input/tags",array('name' => 'tags', 'value' => $event_tags)); -$body .= '</p>'; -$body .= '<p class="event-calendar-description">'.$prefix['event_tags'].elgg_echo('event_calendar:event_tags_description').'</p>'; - -if ($event || !$vars['group_guid']) { - $body .= '<p><label>'.elgg_echo("event_calendar:calendar_label").'</label>'; - $body .= elgg_view('event_calendar/container',array('container_guid'=>$vars['group_guid'])); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['calendar'].elgg_echo('event_calendar:calendar_description').'</p>'; -} else { - $body .= elgg_view('input/hidden',array('name'=>'group_guid', 'value'=>$vars['group_guid'])); -} - -if($event_calendar_bbb_server_url) { - $body .= '<p>'; - if ($fd['web_conference']) { - $body .= elgg_view('input/checkbox',array('name'=>'web_conference','value'=>1,'checked'=>'checked')); - } else { - $body .= elgg_view('input/checkbox',array('name'=>'web_conference','value'=>1)); - } - $body .= elgg_echo('event_calendar:web_conference_label'); - $body .= '</p>'; -} - -$body .= '</fieldset>'; - -$body .= '<fieldset>'; -$body .= '<legend>'.elgg_echo('event_calendar:schedule:header').'</legend>'; -$body .= elgg_view('input/radio',array('name'=>'schedule_type','value'=>$schedule_type,'options'=>$schedule_options)); - -$vars['prefix'] = $prefix; - -$body .= elgg_view('event_calendar/schedule_section',$vars); - -if ($event_calendar_spots_display == 'yes') { - $body .= '<p><label>'.elgg_echo("event_calendar:spots_label").'<br />'; - $body .= elgg_view("input/text",array('name' => 'spots', 'value' => $spots)); - $body .= '</label></p>'; - $body .= '<p class="event-calendar-description">'.$prefix['spots'].elgg_echo('event_calendar:spots_description').'</p>'; -} - -$body .= '<div class="event-calendar-edit-bottom"></div>'; -$body .= '</fieldset>'; - -$body .= elgg_view('event_calendar/personal_manage_section',$vars); - -$body .= elgg_view('event_calendar/share_section',$vars); - -if ($event_calendar_region_display == 'yes' || $event_calendar_type_display == 'yes' || $event_calendar_fewer_fields != 'yes') { - $body .= '<fieldset>'; - - if ($event_calendar_region_display == 'yes') { - $region_list = trim(elgg_get_plugin_setting('region_list', 'event_calendar')); - $region_list_handles = elgg_get_plugin_setting('region_list_handles', 'event_calendar'); - // make sure that we are using Unix line endings - $region_list = str_replace("\r\n","\n",$region_list); - $region_list = str_replace("\r","\n",$region_list); - if ($region_list) { - $options = array(); - $options[] = '-'; - foreach(explode("\n",$region_list) as $region_item) { - $region_item = trim($region_item); - if ($region_list_handles == 'yes') { - $options[$region_item] = elgg_echo('event_calendar:region:'.$region_item); - } else { - $options[$region_item] = $region_item; - } - } - $body .= '<p><label>'.elgg_echo("event_calendar:region_label").'</label>'; - $body .= elgg_view("input/dropdown",array('name' => 'region','value'=>$region,'options_values'=>$options)); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['region'].elgg_echo('event_calendar:region_description').'</p>'; - } - } - - if ($event_calendar_type_display == 'yes') { - $type_list = trim(elgg_get_plugin_setting('type_list', 'event_calendar')); - $type_list_handles = elgg_get_plugin_setting('type_list_handles', 'event_calendar'); - // make sure that we are using Unix line endings - $type_list = str_replace("\r\n","\n",$type_list); - $type_list = str_replace("\r","\n",$type_list); - if ($type_list) { - $options = array(); - $options[] = '-'; - foreach(explode("\n",$type_list) as $type_item) { - $type_item = trim($type_item); - if ($type_list_handles == 'yes') { - $options[$type_item] = elgg_echo('event_calendar:type:'.$type_item); - } else { - $options[$type_item] = $type_item; - } - } - $body .= '<p><label>'.elgg_echo("event_calendar:type_label").'</label>'; - $body .= elgg_view("input/dropdown",array('name' => 'event_type','value'=>$event_type,'options_values'=>$options)); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['event_type'].elgg_echo('event_calendar:type_description').'</p>'; - } - } - - if ($event_calendar_fewer_fields != 'yes') { - - $body .= '<p><label>'.elgg_echo("event_calendar:fees_label").'</label>'; - $body .= elgg_view("input/text",array('name' => 'fees', 'value' => $fees)); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['fees'].elgg_echo('event_calendar:fees_description').'</p>'; - - $body .= '<p><label>'.elgg_echo("event_calendar:contact_label").'</label>'; - $body .= elgg_view("input/text",array('name' => 'contact', 'value' => $contact)); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['contact'].elgg_echo('event_calendar:contact_description').'</p>'; - - $body .= '<p><label>'.elgg_echo("event_calendar:organiser_label").'</label>'; - $body .= elgg_view("input/text",array('name' => 'organiser', 'value' => $organiser)); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['organiser'].elgg_echo('event_calendar:organiser_description').'</p>'; - - $body .= '<p><label>'.elgg_echo("event_calendar:long_description_label").'</label>'; - $body .= elgg_view("input/longtext",array('name' => 'long_description', 'value' => $long_description)); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['long_description'].elgg_echo('event_calendar:long_description_description').'</p>'; - } - - $body .= '</fieldset>'; -} - -$body .= elgg_view('input/submit', array('name'=>'submit','value'=>elgg_echo('event_calendar:submit'))); - -$body .= '</div>'; - -echo $body; diff --git a/views/default/forms/event_calendar/manage_subscribers.php b/views/default/forms/event_calendar/manage_subscribers.php deleted file mode 100644 index 8039c5015..000000000 --- a/views/default/forms/event_calendar/manage_subscribers.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -$event = $vars['event']; -$users = event_calendar_get_users_for_event($event->guid,0); -$guids = array(); -foreach($users as $user) { - $guids[] = $user->guid; -} -// TODO: if the event container is a group need to restrict user picker to the members of the group? -$content = elgg_view('input/userpicker_plus',array('value'=> $guids)); -$content .= '<br /><br />'; -$content .= elgg_view('input/hidden',array('name'=>'event_guid','value'=>$event->guid)); -$content .= elgg_view('input/submit',array('value'=>elgg_echo('submit'),'name'=>'submit_manage_subscribers','id'=>'submit-manage-subscribers')); - -echo $content; 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..dc7b2fef7 --- /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("{$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); +} else { + echo elgg_view("plugins/$plugin_id/{$type}settings", $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..9538b779e --- /dev/null +++ b/views/default/forms/profile/edit.php @@ -0,0 +1,68 @@ +<?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 + +$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; + } + +?> +<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 + } +} +?> +<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/fullcalendar/css.php b/views/default/fullcalendar/css.php deleted file mode 100644 index 04f118493..000000000 --- a/views/default/fullcalendar/css.php +++ /dev/null @@ -1,618 +0,0 @@ -/* - * FullCalendar v1.5.3 Stylesheet - * - * Copyright (c) 2011 Adam Shaw - * Dual licensed under the MIT and GPL licenses, located in - * MIT-LICENSE.txt and GPL-LICENSE.txt respectively. - * - * Date: Mon Feb 6 22:40:40 2012 -0800 - * - */ - - -.fc { - direction: ltr; - text-align: left; - } - -.fc table { - border-collapse: collapse; - border-spacing: 0; - } - -html .fc, -.fc table { - font-size: 1em; - } - -.fc td, -.fc th { - padding: 0; - vertical-align: top; - } - - - -/* Header -------------------------------------------------------------------------*/ - -.fc-header td { - white-space: nowrap; - } - -.fc-header-left { - width: 25%; - text-align: left; - } - -.fc-header-center { - text-align: center; - } - -.fc-header-right { - width: 25%; - text-align: right; - } - -.fc-header-title { - display: inline-block; - vertical-align: top; - } - -.fc-header-title h2 { - margin-top: 0; - white-space: nowrap; - } - -.fc .fc-header-space { - padding-left: 10px; - } - -.fc-header .fc-button { - margin-bottom: 1em; - vertical-align: top; - } - -/* buttons edges butting together */ - -.fc-header .fc-button { - margin-right: -1px; - } - -.fc-header .fc-corner-right { - margin-right: 1px; /* back to normal */ - } - -.fc-header .ui-corner-right { - margin-right: 0; /* back to normal */ - } - -/* button layering (for border precedence) */ - -.fc-header .fc-state-hover, -.fc-header .ui-state-hover { - z-index: 2; - } - -.fc-header .fc-state-down { - z-index: 3; - } - -.fc-header .fc-state-active, -.fc-header .ui-state-active { - z-index: 4; - } - - - -/* Content -------------------------------------------------------------------------*/ - -.fc-content { - clear: both; - } - -.fc-view { - width: 100%; /* needed for view switching (when view is absolute) */ - overflow: hidden; - } - - - -/* Cell Styles -------------------------------------------------------------------------*/ - -.fc-widget-header, /* <th>, usually */ -.fc-widget-content { /* <td>, usually */ - border: 1px solid #ccc; - } - -.fc-state-highlight { /* <td> today cell */ /* TODO: add .fc-today to <th> */ - background: #ffc; - } - -.fc-cell-overlay { /* semi-transparent rectangle while dragging */ - background: #9cf; - opacity: .2; - filter: alpha(opacity=20); /* for IE */ - } - - - -/* Buttons -------------------------------------------------------------------------*/ - -.fc-button { - position: relative; - display: inline-block; - cursor: pointer; - } - -.fc-state-default { /* non-theme */ - border-style: solid; - border-width: 1px 0; - } - -.fc-button-inner { - position: relative; - float: left; - overflow: hidden; - } - -.fc-state-default .fc-button-inner { /* non-theme */ - border-style: solid; - border-width: 0 1px; - } - -.fc-button-content { - position: relative; - float: left; - height: 1.9em; - line-height: 1.9em; - padding: 0 .6em; - white-space: nowrap; - } - -/* icon (for jquery ui) */ - -.fc-button-content .fc-icon-wrap { - position: relative; - float: left; - top: 50%; - } - -.fc-button-content .ui-icon { - position: relative; - float: left; - margin-top: -50%; - *margin-top: 0; - *top: -50%; - } - -/* gloss effect */ - -.fc-state-default .fc-button-effect { - position: absolute; - top: 50%; - left: 0; - } - -.fc-state-default .fc-button-effect span { - position: absolute; - top: -100px; - left: 0; - width: 500px; - height: 100px; - border-width: 100px 0 0 1px; - border-style: solid; - border-color: #fff; - background: #444; - opacity: .09; - filter: alpha(opacity=9); - } - -/* button states (determines colors) */ - -.fc-state-default, -.fc-state-default .fc-button-inner { - border-style: solid; - border-color: #ccc #bbb #aaa; - background: #F3F3F3; - color: #000; - } - -.fc-state-hover, -.fc-state-hover .fc-button-inner { - border-color: #999; - } - -.fc-state-down, -.fc-state-down .fc-button-inner { - border-color: #555; - background: #777; - } - -.fc-state-active, -.fc-state-active .fc-button-inner { - border-color: #555; - background: #777; - color: #fff; - } - -.fc-state-disabled, -.fc-state-disabled .fc-button-inner { - color: #999; - border-color: #ddd; - } - -.fc-state-disabled { - cursor: default; - } - -.fc-state-disabled .fc-button-effect { - display: none; - } - - - -/* Global Event Styles -------------------------------------------------------------------------*/ - -.fc-event { - border-style: solid; - border-width: 0; - font-size: .85em; - cursor: default; - } - -a.fc-event, -.fc-event-draggable { - cursor: pointer; - } - -a.fc-event { - text-decoration: none; - } - -.fc-rtl .fc-event { - text-align: right; - } - -.fc-event-skin { - border-color: #36c; /* default BORDER color */ - background-color: #36c; /* default BACKGROUND color */ - color: #fff; /* default TEXT color */ - } - -.fc-event-inner { - position: relative; - width: 100%; - height: 100%; - border-style: solid; - border-width: 0; - overflow: hidden; - } - -.fc-event-time, -.fc-event-title { - padding: 0 1px; - } - -.fc .ui-resizable-handle { /*** TODO: don't use ui-resizable anymore, change class ***/ - display: block; - position: absolute; - z-index: 99999; - overflow: hidden; /* hacky spaces (IE6/7) */ - font-size: 300%; /* */ - line-height: 50%; /* */ - } - - - -/* Horizontal Events -------------------------------------------------------------------------*/ - -.fc-event-hori { - border-width: 1px 0; - margin-bottom: 1px; - } - -/* resizable */ - -.fc-event-hori .ui-resizable-e { - top: 0 !important; /* importants override pre jquery ui 1.7 styles */ - right: -3px !important; - width: 7px !important; - height: 100% !important; - cursor: e-resize; - } - -.fc-event-hori .ui-resizable-w { - top: 0 !important; - left: -3px !important; - width: 7px !important; - height: 100% !important; - cursor: w-resize; - } - -.fc-event-hori .ui-resizable-handle { - _padding-bottom: 14px; /* IE6 had 0 height */ - } - - - -/* Fake Rounded Corners (for buttons and events) -------------------------------------------------------------*/ - -.fc-corner-left { - margin-left: 1px; - } - -.fc-corner-left .fc-button-inner, -.fc-corner-left .fc-event-inner { - margin-left: -1px; - } - -.fc-corner-right { - margin-right: 1px; - } - -.fc-corner-right .fc-button-inner, -.fc-corner-right .fc-event-inner { - margin-right: -1px; - } - -.fc-corner-top { - margin-top: 1px; - } - -.fc-corner-top .fc-event-inner { - margin-top: -1px; - } - -.fc-corner-bottom { - margin-bottom: 1px; - } - -.fc-corner-bottom .fc-event-inner { - margin-bottom: -1px; - } - - - -/* Fake Rounded Corners SPECIFICALLY FOR EVENTS ------------------------------------------------------------------*/ - -.fc-corner-left .fc-event-inner { - border-left-width: 1px; - } - -.fc-corner-right .fc-event-inner { - border-right-width: 1px; - } - -.fc-corner-top .fc-event-inner { - border-top-width: 1px; - } - -.fc-corner-bottom .fc-event-inner { - border-bottom-width: 1px; - } - - - -/* Reusable Separate-border Table -------------------------------------------------------------*/ - -table.fc-border-separate { - border-collapse: separate; - } - -.fc-border-separate th, -.fc-border-separate td { - border-width: 1px 0 0 1px; - } - -.fc-border-separate th.fc-last, -.fc-border-separate td.fc-last { - border-right-width: 1px; - } - -.fc-border-separate tr.fc-last th, -.fc-border-separate tr.fc-last td { - border-bottom-width: 1px; - } - -.fc-border-separate tbody tr.fc-first td, -.fc-border-separate tbody tr.fc-first th { - border-top-width: 0; - } - - - -/* Month View, Basic Week View, Basic Day View -------------------------------------------------------------------------*/ - -.fc-grid th { - text-align: center; - } - -.fc-grid .fc-day-number { - float: right; - padding: 0 2px; - } - -.fc-grid .fc-other-month .fc-day-number { - opacity: 0.3; - filter: alpha(opacity=30); /* for IE */ - /* opacity with small font can sometimes look too faded - might want to set the 'color' property instead - making day-numbers bold also fixes the problem */ - } - -.fc-grid .fc-day-content { - clear: both; - padding: 2px 2px 1px; /* distance between events and day edges */ - } - -/* event styles */ - -.fc-grid .fc-event-time { - font-weight: bold; - } - -/* right-to-left */ - -.fc-rtl .fc-grid .fc-day-number { - float: left; - } - -.fc-rtl .fc-grid .fc-event-time { - float: right; - } - - - -/* Agenda Week View, Agenda Day View -------------------------------------------------------------------------*/ - -.fc-agenda table { - border-collapse: separate; - } - -.fc-agenda-days th { - text-align: center; - } - -.fc-agenda .fc-agenda-axis { - width: 50px; - padding: 0 4px; - vertical-align: middle; - text-align: right; - white-space: nowrap; - font-weight: normal; - } - -.fc-agenda .fc-day-content { - padding: 2px 2px 1px; - } - -/* make axis border take precedence */ - -.fc-agenda-days .fc-agenda-axis { - border-right-width: 1px; - } - -.fc-agenda-days .fc-col0 { - border-left-width: 0; - } - -/* all-day area */ - -.fc-agenda-allday th { - border-width: 0 1px; - } - -.fc-agenda-allday .fc-day-content { - min-height: 34px; /* TODO: doesnt work well in quirksmode */ - _height: 34px; - } - -/* divider (between all-day and slots) */ - -.fc-agenda-divider-inner { - height: 2px; - overflow: hidden; - } - -.fc-widget-header .fc-agenda-divider-inner { - background: #eee; - } - -/* slot rows */ - -.fc-agenda-slots th { - border-width: 1px 1px 0; - } - -.fc-agenda-slots td { - border-width: 1px 0 0; - background: none; - } - -.fc-agenda-slots td div { - height: 20px; - } - -.fc-agenda-slots tr.fc-slot0 th, -.fc-agenda-slots tr.fc-slot0 td { - border-top-width: 0; - } - -.fc-agenda-slots tr.fc-minor th, -.fc-agenda-slots tr.fc-minor td { - border-top-style: dotted; - } - -.fc-agenda-slots tr.fc-minor th.ui-widget-header { - *border-top-style: solid; /* doesn't work with background in IE6/7 */ - } - - - -/* Vertical Events -------------------------------------------------------------------------*/ - -.fc-event-vert { - border-width: 0 1px; - } - -.fc-event-vert .fc-event-head, -.fc-event-vert .fc-event-content { - position: relative; - z-index: 2; - width: 100%; - overflow: hidden; - } - -.fc-event-vert .fc-event-time { - white-space: nowrap; - font-size: 10px; - } - -.fc-event-vert .fc-event-bg { /* makes the event lighter w/ a semi-transparent overlay */ - position: absolute; - z-index: 1; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: #fff; - opacity: .3; - filter: alpha(opacity=30); - } - -.fc .ui-draggable-dragging .fc-event-bg, /* TODO: something nicer like .fc-opacity */ -.fc-select-helper .fc-event-bg { - display: none\9; /* for IE6/7/8. nested opacity filters while dragging don't work */ - } - -/* resizable */ - -.fc-event-vert .ui-resizable-s { - bottom: 0 !important; /* importants override pre jquery ui 1.7 styles */ - width: 100% !important; - height: 8px !important; - overflow: hidden !important; - line-height: 8px !important; - font-size: 11px !important; - font-family: monospace; - text-align: center; - cursor: s-resize; - } - -.fc-agenda .ui-resizable-resizing { /* TODO: better selector */ - _overflow: hidden; - } - - diff --git a/views/default/fullcalendar/fullcalendar.print.css b/views/default/fullcalendar/fullcalendar.print.css deleted file mode 100644 index e11c18163..000000000 --- a/views/default/fullcalendar/fullcalendar.print.css +++ /dev/null @@ -1,61 +0,0 @@ -/* - * FullCalendar v1.5.3 Print Stylesheet - * - * Include this stylesheet on your page to get a more printer-friendly calendar. - * When including this stylesheet, use the media='print' attribute of the <link> tag. - * Make sure to include this stylesheet IN ADDITION to the regular fullcalendar.css. - * - * Copyright (c) 2011 Adam Shaw - * Dual licensed under the MIT and GPL licenses, located in - * MIT-LICENSE.txt and GPL-LICENSE.txt respectively. - * - * Date: Mon Feb 6 22:40:40 2012 -0800 - * - */ - - - /* Events ------------------------------------------------------*/ - -.fc-event-skin { - background: none !important; - color: #000 !important; - } - -/* horizontal events */ - -.fc-event-hori { - border-width: 0 0 1px 0 !important; - border-bottom-style: dotted !important; - border-bottom-color: #000 !important; - padding: 1px 0 0 0 !important; - } - -.fc-event-hori .fc-event-inner { - border-width: 0 !important; - padding: 0 1px !important; - } - -/* vertical events */ - -.fc-event-vert { - border-width: 0 0 0 1px !important; - border-left-style: dotted !important; - border-left-color: #000 !important; - padding: 0 1px 0 0 !important; - } - -.fc-event-vert .fc-event-inner { - border-width: 0 !important; - padding: 1px 0 !important; - } - -.fc-event-bg { - display: none !important; - } - -.fc-event .ui-resizable-handle { - display: none !important; - } - - 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/group/default.php b/views/default/group/default.php new file mode 100644 index 000000000..383a25c49 --- /dev/null +++ b/views/default/group/default.php @@ -0,0 +1,9 @@ +<?php +/** + * ElggGroup default view. + * + * @package Elgg + * @subpackage Core + */ + +echo elgg_view('object/default', $vars); 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 new file mode 100644 index 000000000..ceaeb0ff0 --- /dev/null +++ b/views/default/group/search/finishblurb.php @@ -0,0 +1,18 @@ +<?php +/** + * @package Elgg + * @subpackage Core + * @deprecated 1.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(); ?>search/groups?tag=<?php echo urlencode($vars['tag']); ?>"> + <?php + echo elgg_echo("group:search:finishblurb"); + ?></a> +</div> +<?php +} diff --git a/views/default/group/search/startblurb.php b/views/default/group/search/startblurb.php new file mode 100644 index 000000000..92256d1db --- /dev/null +++ b/views/default/group/search/startblurb.php @@ -0,0 +1,14 @@ +<?php +/** + * @package Elgg + * @subpackage Core + * @deprecated 1.7 + */ +elgg_deprecated_notice('view groups/search/startblurb was deprecated.', 1.7); +?> + +<div class="contentWrapper"> + <?php + echo elgg_echo("group:search:startblurb", array($vars['tag'])); + ?> +</div> diff --git a/views/default/icon/default.php b/views/default/icon/default.php new file mode 100644 index 000000000..087c7eae9 --- /dev/null +++ b/views/default/icon/default.php @@ -0,0 +1,62 @@ +<?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']; + +$img = elgg_view('output/img', array( + 'src' => $entity->getIconURL($vars['size']), + 'alt' => $title, + 'class' => $class, + 'width' => $size != 'master' ? $icon_sizes[$size]['w'] : NULL, + 'height' => $size != 'master' ? $icon_sizes[$size]['h'] : NULL, +)); + +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/object/event_calendar/small.php b/views/default/icon/object/event_calendar/small.php deleted file mode 100644 index d30d14453..000000000 --- a/views/default/icon/object/event_calendar/small.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php - echo $vars['url'] . "mod/event_calendar/images/event_icon.gif"; -?>
\ No newline at end of file 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 new file mode 100644 index 000000000..137eea288 --- /dev/null +++ b/views/default/input/access.php @@ -0,0 +1,38 @@ +<?php +/** + * Elgg access level input + * 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 + */ + +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-access {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-access"; +} + +$defaults = array( + 'disabled' => false, + 'value' => get_default_access(), + 'options_values' => get_write_access_array(), +); + +if (isset($vars['entity'])) { + $defaults['value'] = $vars['entity']->access_id; + unset($vars['entity']); +} + +$vars = array_merge($defaults, $vars); + +if ($vars['value'] == ACCESS_DEFAULT) { + $vars['value'] = get_default_access(); +} + +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 new file mode 100644 index 000000000..e58eb1ae8 --- /dev/null +++ b/views/default/input/autocomplete.php @@ -0,0 +1,49 @@ +<?php +/** + * Displays an autocomplete text input. + * + * @package Elgg + * @subpackage Core + * + * @todo This currently only works for ONE AUTOCOMPLETE TEXT FIELD on a page. + * + * @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 + */ + +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-autocomplete {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-autocomplete"; +} + +$defaults = array( + 'value' => '', + 'disabled' => false, +); + +$vars = array_merge($defaults, $vars); + +$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); + +elgg_load_js('elgg.autocomplete'); +elgg_load_js('jquery.ui.autocomplete.html'); + +?> + +<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 new file mode 100644 index 000000000..9957fdc54 --- /dev/null +++ b/views/default/input/button.php @@ -0,0 +1,40 @@ +<?php +/** + * Create a input button + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['src'] Src of an image + * @uses $vars['class'] Additional CSS class + */ + +if (isset($vars['class'])) { + $vars['class'] = "elgg-button {$vars['class']}"; +} else { + $vars['class'] = "elgg-button"; +} + +$defaults = array( + 'type' => 'button', +); + +$vars = array_merge($defaults, $vars); + +switch ($vars['type']) { + case 'button': + case 'reset': + case 'submit': + case 'image': + break; + default: + $vars['type'] = 'button'; + break; +} + +// blank src if trying to access an offsite image. @todo why? +if (isset($vars['src']) && strpos($vars['src'], elgg_get_site_url()) === false) { + $vars['src'] = ""; +} +?> +<input <?php echo elgg_format_attributes($vars); ?> /> diff --git a/views/default/input/calendar.php b/views/default/input/calendar.php new file mode 100644 index 000000000..52c84ff82 --- /dev/null +++ b/views/default/input/calendar.php @@ -0,0 +1,6 @@ +<?php +// @deprecated Use input/date instead. + +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 new file mode 100644 index 000000000..1c2e22aaa --- /dev/null +++ b/views/default/input/captcha.php @@ -0,0 +1,8 @@ +<?php +/** + * This view provides a hook for third parties to provide a CAPTCHA. + * + * @package Elgg + * @subpackage Core + */ +?>
\ No newline at end of file diff --git a/views/default/input/checkbox.php b/views/default/input/checkbox.php new file mode 100644 index 000000000..3dc75c6c3 --- /dev/null +++ b/views/default/input/checkbox.php @@ -0,0 +1,39 @@ +<?php +/** + * Elgg checkbox input + * Displays a checkbox input tag + * + * @package Elgg + * @subpackage Core + * + * + * Pass input tag attributes as key value pairs. For a list of allowable + * attributes, see http://www.w3schools.com/tags/tag_input.asp + * + * @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( + 'default' => 0, + 'disabled' => false, +); + +$vars = array_merge($defaults, $vars); + +$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); ?> /> diff --git a/views/default/input/checkboxes.php b/views/default/input/checkboxes.php new file mode 100644 index 000000000..db4b06949 --- /dev/null +++ b/views/default/input/checkboxes.php @@ -0,0 +1,90 @@ +<?php +/** + * Elgg checkbox input + * Displays a checkbox input field + * + * @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=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['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' + * + */ + +$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']); +} + +$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'])); +} + +$input_vars = $vars; +$input_vars['default'] = false; +if ($vars['name']) { + $input_vars['name'] = "{$vars['name']}[]"; +} +unset($input_vars['align']); +unset($input_vars['options']); + +if (count($vars['options']) > 0) { + // include a default value so if nothing is checked 0 will be passed. + if ($vars['name'] && $vars['default'] !== false) { + echo "<input type=\"hidden\" name=\"{$vars['name']}\" value=\"{$vars['default']}\" />"; + } + + echo "<ul class=\"$class\" $id>"; + foreach ($vars['options'] as $label => $value) { + // @deprecated 1.8 Remove in 1.9 + if (is_integer($label)) { + elgg_deprecated_notice('$vars[\'options\'] must be an associative array in input/checkboxes', 1.8); + $label = $value; + } + + $input_vars['checked'] = in_array(elgg_strtolower($value), $values); + $input_vars['value'] = $value; + + $input = elgg_view('input/checkbox', $input_vars); + + echo "<li><label>$input$label</label></li>"; + } + echo '</ul>'; +} diff --git a/views/default/event_calendar/input/date_local.php b/views/default/input/date.php index a0ce7f4d3..828ce5520 100644 --- a/views/default/event_calendar/input/date_local.php +++ b/views/default/input/date.php @@ -44,11 +44,12 @@ if ($timestamp) { $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'] = date('Y-m-d', $vars['value']); + $vars['value'] = gmdate('Y-m-d', $vars['value']); } $attributes = elgg_format_attributes($vars); diff --git a/views/default/input/datepicker.php b/views/default/input/datepicker.php new file mode 100644 index 000000000..8955e6e53 --- /dev/null +++ b/views/default/input/datepicker.php @@ -0,0 +1,6 @@ +<?php +/** + * @deprecated use input/date instead + */ +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/datepicker_inline.php b/views/default/input/datepicker_inline.php deleted file mode 100644 index 3fd9c37af..000000000 --- a/views/default/input/datepicker_inline.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php - -/** - * JQuery data picker(inline version) - * - * @package event_calendar - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Kevin Jardine <kevin@radagast.biz> - * @copyright Radagast Solutions 2008 -2011 - * @link http://radagast.biz/ - * - */ -if ($vars['group_guid']) { - $link_bit = $vars['url']."event_calendar/group/{$vars['group_guid']}/%s/{$vars['mode']}"; -} else { - $link_bit = $vars['url']."event_calendar/list/%s/{$vars['mode']}/{$vars['filter']}"; -} - -if ($vars['mode'] == 'week') { - $selected_week = date('W',strtotime($vars['start_date'].' UTC'))+1; -} else { - $selected_week = ''; -} - -if ($vars['mode']) { - $wrapper_class = "event-calendar-filter-period-".$vars['mode']; -} else { - $wrapper_class = "event-calendar-filter-period-month"; -} -// TODO - figure out how to move this JavaScript -?> - -<script language="javascript"> -var selectedWeek = "<?php echo $selected_week; ?>"; -highlightWeek = function(d) { - if (!selectedWeek) { return [true,''];} - //var date = $(this).datepicker('getDate'); - var dayOfWeek = d.getUTCDay(); - var weekNumber = $.datepicker.iso8601Week(d); - if (dayOfWeek == 6) { - weekNumber += 1; - } - - if (selectedWeek == weekNumber) { - return [true,'week-highlight']; - } - return [true,'']; -} -$(document).ready(function(){ -var done_loading = false; -$("#<?php echo $vars['name']; ?>").datepicker({ - onChangeMonthYear: function(year, month, inst) { - if(inst.onChangeToday){ - day=inst.selectedDay; - }else{ - day=1; - } - if (done_loading) { - // in this case the mode is forced to month - document.location.href = "<?php echo $link_bit; ?>".replace('%s', year+'-'+month+'-1'); - } - }, - onSelect: function(date) { - // jump to the new page - document.location.href = "<?php echo $link_bit; ?>".replace('%s', date.substring(0,10)); - }, - dateFormat: "yy-mm-dd", - defaultDate: "<?php echo $vars['start_date'] .' - '.$vars['end_date']; ?>", - beforeShowDay: highlightWeek -}); -var start_date = $.datepicker.parseDate("yy-mm-dd", "<?php echo $vars['start_date']; ?>"); -var end_date = $.datepicker.parseDate("yy-mm-dd", "<?php echo $vars['end_date']; ?>"); -// not sure why this is necessary, but it seems to be -if ("<?php echo $vars['mode'] ?>" == "month") { - end_date += 1; -} -$("#<?php echo $vars['name']; ?>").datepicker("setDate", start_date, end_date); -done_loading = true; -}); - -</script> -<div style="position:relative;" id="<?php echo $vars['name']; ?>" class="<?php echo $wrapper_class; ?>" ></div> -<p style="clear: both;"><!-- See day-by-day example for highlighting days code --></p>
\ 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 new file mode 100644 index 000000000..190fb88c6 --- /dev/null +++ b/views/default/input/email.php @@ -0,0 +1,26 @@ +<?php +/** + * Elgg email input + * Displays an email input field + * + * @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( + '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/file.php b/views/default/input/file.php new file mode 100644 index 000000000..452fe72b9 --- /dev/null +++ b/views/default/input/file.php @@ -0,0 +1,31 @@ +<?php +/** + * Elgg file input + * Displays a file input field + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['value'] The current value if any + * @uses $vars['class'] Additional CSS class + */ + +if (!empty($vars['value'])) { + echo elgg_echo('fileexists') . "<br />"; +} + +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-file {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-file"; +} + +$defaults = array( + 'disabled' => false, + 'size' => 30, +); + +$attrs = array_merge($defaults, $vars); + +?> +<input type="file" <?php echo elgg_format_attributes($attrs); ?> /> diff --git a/views/default/input/form.php b/views/default/input/form.php new file mode 100644 index 000000000..df30133b3 --- /dev/null +++ b/views/default/input/form.php @@ -0,0 +1,44 @@ +<?php +/** + * Create a form for data submission. + * 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( + 'method' => "post", + 'disable_security' => FALSE, +); + +$vars = array_merge($defaults, $vars); + +if (isset($vars['class'])) { + $vars['class'] = "elgg-form {$vars['class']}"; +} else { + $vars['class'] = 'elgg-form'; +} + +$vars['action'] = elgg_normalize_url($vars['action']); +$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; +} +unset($vars['disable_security']); + +$attributes = elgg_format_attributes($vars); + +echo "<form $attributes><fieldset>$body</fieldset></form>"; diff --git a/views/default/input/friendspicker.php b/views/default/input/friendspicker.php new file mode 100644 index 000000000..40708c890 --- /dev/null +++ b/views/default/input/friendspicker.php @@ -0,0 +1,319 @@ +<?php +/** + * 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'] + */ + +elgg_load_js('elgg.friendspicker'); +elgg_load_js('jquery.easing'); + + +$chararray = elgg_echo('friendspicker:chararray'); + +// Initialise name +if (!isset($vars['name'])) { + $name = "friend"; +} else { + $name = $vars['name']; +} + +// Are we highlighting default or all? +if (empty($vars['highlight'])) { + $vars['highlight'] = 'default'; +} +if ($vars['highlight'] != 'all') { + $vars['highlight'] = 'default'; +} + +// Initialise values +if (!isset($vars['value'])) { + $vars['value'] = array(); +} else { + if (!is_array($vars['value'])) { + $vars['value'] = (int) $vars['value']; + $vars['value'] = array($vars['value']); + } +} + +// Initialise whether we're calling back or not +if (isset($vars['callback'])) { + $callback = $vars['callback']; +} else { + $callback = false; +} + +// We need to count the number of friends pickers on the page. +if (!isset($vars['friendspicker'])) { + global $friendspicker; + if (!isset($friendspicker)) { + $friendspicker = 0; + } + $friendspicker++; +} else { + $friendspicker = $vars['friendspicker']; +} + +$users = array(); +$activeletters = array(); + +// Are we displaying form tags and submit buttons? +// (If we've been given a target, then yes! Otherwise, no.) +if (isset($vars['formtarget'])) { + $formtarget = $vars['formtarget']; +} else { + $formtarget = false; +} + +// Sort users by letter +if (is_array($vars['entities']) && sizeof($vars['entities'])) { + foreach($vars['entities'] as $user) { + $letter = elgg_strtoupper(elgg_substr($user->name, 0, 1)); + + if (!elgg_substr_count($chararray, $letter)) { + $letter = "*"; + } + if (!isset($users[$letter])) { + $users[$letter] = array(); + } + $users[$letter][$user->guid] = $user; + } +} + +// sort users in letters alphabetically +foreach ($users as $letter => $letter_users) { + usort($letter_users, create_function('$a, $b', ' + return strcasecmp($a->name, $b->name); + ')); + $users[$letter] = $letter_users; +} + +if (!$callback) { + ?> + + <div class="friends-picker-main-wrapper"> + + <?php + + if (isset($vars['content'])) { + echo $vars['content']; + } + ?> + + <div id="friends-picker_placeholder<?php echo $friendspicker; ?>"> + + <?php +} + +if (!isset($vars['replacement'])) { + if ($formtarget) { +?> +<?php //@todo JS 1.8: no ?> +<script language="text/javascript"> + $(function() { // onload...do + $('#collectionMembersForm<?php echo $friendspicker; ?>').submit(function() { + var inputs = []; + $(':input', this).each(function() { + if (this.type != 'checkbox' || (this.type == 'checkbox' && this.checked != false)) { + inputs.push(this.name + '=' + escape(this.value)); + } + }); + jQuery.ajax({ + type: "POST", + data: inputs.join('&'), + url: this.action, + success: function(){ + $('a.collectionmembers<?php echo $friendspicker; ?>').click(); + } + + }); + return false; + }) + }) + + </script> + +<!-- Collection members form --> +<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'], + )); + } +?> + +<div class="friends-picker-wrapper"> +<div id="friends-picker<?php echo $friendspicker; ?>"> + <div class="friends-picker-container"> +<?php + +// Initialise letters + $chararray .= "*"; + $letter = elgg_substr($chararray, 0, 1); + $letpos = 0; + while (1 == 1) { + ?> + <div class="panel" title="<?php echo $letter; ?>"> + <div class="wrapper"> + <h3><?php echo $letter; ?></h3> + <?php + + if (isset($users[$letter])) { + ksort($users[$letter]); + + echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"; + $col = 0; + + foreach($users[$letter] as $friend) { + if ($col == 0) { + echo "<tr>"; + } + + //echo "<p>" . $user->name . "</p>"; + $label = elgg_view_entity_icon($friend, 'tiny', array('use_hover' => false)); + $options[$label] = $friend->getGUID(); + + if ($vars['highlight'] == 'all' && !in_array($letter,$activeletters)) { + $activeletters[] = $letter; + } + + + if (in_array($friend->getGUID(),$vars['value'])) { + $checked = "checked = \"checked\""; + if (!in_array($letter,$activeletters) && $vars['highlight'] == 'default') { + $activeletters[] = $letter; + } + } else { + $checked = ""; + } + ?> + + <td> + + <input type="checkbox" <?php echo $checked; ?> name="<?php echo $name; ?>[]" value="<?php echo $options[$label]; ?>" /> + + </td> + + <td> + + <div style="width: 25px; margin-bottom: 15px;"> + <?php + echo $label; + ?> + </div> + </td> + <td style="width: 200px; padding: 5px;"> + <?php echo $friend->name; ?> + </td> + <?php + $col++; + if ($col == 3){ + echo "</tr>"; + $col = 0; + } + } + if ($col < 3) { + echo "</tr>"; + } + + echo "</table>"; + } + +?> + + </div> + </div> +<?php + + $substr = elgg_substr($chararray, elgg_strlen($chararray) - 1, 1); + if ($letter == $substr) { + break; + } + //$letter++; + $letpos++; + $letter = elgg_substr($chararray, $letpos, 1); + } + +?> + </div> + +<?php + +if ($formtarget) { + + if (isset($vars['formcontents'])) + echo $vars['formcontents']; + +?> + <div class="clearfix"></div> + <div class="friendspicker-savebuttons"> + <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> + +<?php + +} + +?> + +</div> +</div> + +<?php +} else { + echo $vars['replacement']; +} +if (!$callback) { + +?> + +</div> +</div> + + +<?php + +} + +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 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 = elgg_strpos($chararray, $letter) + 1; +?> +$("div#friends-picker-navigation<?php echo $friendspicker; ?> li.tab<?php echo $tab; ?> a").addClass("tabHasContent"); +<?php + } + +?> +}); +</script> + +<?php + +}
\ No newline at end of file diff --git a/views/default/input/hidden.php b/views/default/input/hidden.php new file mode 100644 index 000000000..9c2fc6c08 --- /dev/null +++ b/views/default/input/hidden.php @@ -0,0 +1,12 @@ +<?php +/** + * Create a hidden data field + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['value'] The current value, if any + */ + +?> +<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 new file mode 100644 index 000000000..61dc7ca19 --- /dev/null +++ b/views/default/input/longtext.php @@ -0,0 +1,42 @@ +<?php +/** + * Elgg long text input + * 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['disabled'] Is the input field disabled? + * @uses $vars['class'] Additional CSS class + */ + +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-longtext {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-longtext"; +} + +$defaults = array( + 'value' => '', + 'rows' => '10', + 'cols' => '50', + 'id' => 'elgg-input-' . rand(), //@todo make this more robust +); + +$vars = array_merge($defaults, $vars); + +$value = $vars['value']; +unset($vars['value']); + +echo elgg_view_menu('longtext', array( + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', + 'id' => $vars['id'], +)); + +?> + +<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 new file mode 100644 index 000000000..45f2b20a6 --- /dev/null +++ b/views/default/input/password.php @@ -0,0 +1,28 @@ +<?php +/** + * Elgg password input + * Displays a password input field + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['value'] The current value, if any + * @uses $vars['name'] The name of the input field + * @uses $vars['class'] Additional CSS class + */ + +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 echo elgg_format_attributes($attrs); ?> /> diff --git a/views/default/input/plaintext.php b/views/default/input/plaintext.php new file mode 100644 index 000000000..e92c61ced --- /dev/null +++ b/views/default/input/plaintext.php @@ -0,0 +1,37 @@ +<?php +/** + * Elgg long text input (plaintext) + * Displays a long text input field that should not be overridden by wysiwyg editors. + * + * @package Elgg + * @subpackage Core + * + * @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'] + */ + +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-plaintext {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-plaintext"; +} + +$defaults = array( + 'value' => '', + 'rows' => '10', + 'cols' => '50', + 'disabled' => false, +); + +$vars = array_merge($defaults, $vars); + +$value = $vars['value']; +unset($vars['value']); + +?> + +<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 new file mode 100644 index 000000000..705329691 --- /dev/null +++ b/views/default/input/pulldown.php @@ -0,0 +1,9 @@ +<?php +/** + * Deprecated pulldown input view - use 'input/dropdown' instead. + * + * @deprecated 1.8 + */ + +elgg_deprecated_notice("input/pulldown was deprecated by input/dropdown", 1.8); +echo elgg_view('input/dropdown', $vars); diff --git a/views/default/input/radio.php b/views/default/input/radio.php new file mode 100644 index 000000000..ef860a773 --- /dev/null +++ b/views/default/input/radio.php @@ -0,0 +1,76 @@ +<?php +/** + * 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['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' + */ + +$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']); +} + +$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'; + +if (is_array($vars['value'])) { + $vars['value'] = array_map('elgg_strtolower', $vars['value']); +} else { + $vars['value'] = array(elgg_strtolower($vars['value'])); +} + +$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 '</ul>'; +} diff --git a/views/default/input/reset.php b/views/default/input/reset.php new file mode 100644 index 000000000..082da8669 --- /dev/null +++ b/views/default/input/reset.php @@ -0,0 +1,14 @@ +<?php +/** + * Create a reset input button + * + * @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 new file mode 100644 index 000000000..75410848a --- /dev/null +++ b/views/default/input/securitytoken.php @@ -0,0 +1,15 @@ +<?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('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 new file mode 100644 index 000000000..df369b3b4 --- /dev/null +++ b/views/default/input/submit.php @@ -0,0 +1,14 @@ +<?php +/** + * Create a submit input button + * + * @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 new file mode 100644 index 000000000..261cf9f97 --- /dev/null +++ b/views/default/input/tags.php @@ -0,0 +1,45 @@ +<?php +/** + * Elgg tag input + * Displays a tag input field + * + * @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( + 'value' => '', + 'disabled' => false, +); + +if (isset($vars['entity'])) { + $defaults['value'] = $vars['entity']->tags; + unset($vars['entity']); +} + +$vars = array_merge($defaults, $vars); + +if (is_array($vars['value'])) { + $tags = array(); + + foreach ($vars['value'] as $tag) { + if (is_string($tag)) { + $tags[] = $tag; + } else { + $tags[] = $tag->value; + } + } + + $vars['value'] = implode(", ", $tags); +} + +?> +<input type="text" <?php echo elgg_format_attributes($vars); ?> />
\ No newline at end of file diff --git a/views/default/input/text.php b/views/default/input/text.php new file mode 100644 index 000000000..07ce5c710 --- /dev/null +++ b/views/default/input/text.php @@ -0,0 +1,26 @@ +<?php +/** + * Elgg text input + * Displays a text input field + * + * @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( + '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/timepicker.php b/views/default/input/timepicker.php deleted file mode 100644 index 2cc95ced7..000000000 --- a/views/default/input/timepicker.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -$time_format = elgg_get_plugin_setting('timeformat', 'event_calendar'); -if (!$time_format) { - $time_format = '24'; -} - -$value = $vars['value']; -if (is_numeric($value)) { - $hour = floor($value/60); - $minute = ($value -60*$hour); -} else { - $hour = 0; - $minute = 0; -} - -$hours = array(); -$minutes = array(); - -if ($time_format == '12') { - $meridians = array('am'=>'am','pm'=>'pm'); - if ($hour == 0) { - $hour = 12; - $meridian = 'am'; - } else if ($hour == 12) { - $meridian = 'pm'; - } else if ($hour < 12) { - $meridian = 'am'; - } else { - $hour -= 12; - $meridian = 'pm'; - } - for($h=1;$h<=12;$h++) { - $hours[$h] = $h; - } -} else { - for($h=0;$h<=23;$h++) { - $hours[$h] = $h; - } -} - -for($m=0;$m<60;$m=$m+5) { - $mt = sprintf("%02d",$m); - $minutes[$m] = $mt; -} - -echo elgg_view('input/dropdown',array('name'=>$vars['name'].'_hour','value'=>$hour,'options_values'=>$hours)); -echo " <b>:</b> "; -echo elgg_view('input/dropdown',array('name'=>$vars['name'].'_minute','value'=>$minute,'options_values'=>$minutes)); -if ($time_format == '12') { - echo elgg_view('input/dropdown',array('name'=>$vars['name'].'_meridian','value'=>$meridian,'options_values'=>$meridians)); -} diff --git a/views/default/input/timepicker_old.php b/views/default/input/timepicker_old.php deleted file mode 100644 index 1d2156cda..000000000 --- a/views/default/input/timepicker_old.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -$time_format = elgg_get_plugin_setting('timeformat', 'event_calendar'); -if (!$time_format) { - $time_format = 24; -} - -$value = $vars['value']; -if (is_numeric($value)) { - $hour = floor($value/60); - $minute = ($value -60*$hour); - - // add 1 to avoid pulldown 0 bug - $hour++; - $minute++; -} else { - $hour = '-'; - $minute = '-'; -} - -$hours = array(); -$hours['-'] = '-'; - -for($i=0;$i<$time_format;$i++) { - $hours[$i+1] = $i; -} - -$minutes = array(); -$minutes['-'] = '-'; - -for($i=0;$i<60;$i=$i+15) { - $minutes[$i+1] = sprintf("%02d",$i); -} - -echo elgg_view('input/dropdown',array('name'=>$vars['name'].'_h','value'=>$hour,'options_values'=>$hours)); -echo elgg_view('input/dropdown',array('name'=>$vars['name'].'_m','value'=>$minute,'options_values'=>$minutes)); - -?>
\ No newline at end of file diff --git a/views/default/input/url.php b/views/default/input/url.php new file mode 100644 index 000000000..e97a316d8 --- /dev/null +++ b/views/default/input/url.php @@ -0,0 +1,27 @@ +<?php +/** + * Elgg URL input + * Displays a URL input field + * + * @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( + 'value' => '', + 'disabled' => false, +); + +$vars = array_merge($defaults, $vars); + +?> + +<input type="text" <?php echo elgg_format_attributes($vars); ?> /> diff --git a/views/default/input/urlshortener.php b/views/default/input/urlshortener.php new file mode 100644 index 000000000..ecfb02efa --- /dev/null +++ b/views/default/input/urlshortener.php @@ -0,0 +1,8 @@ +<?php +/** + * This view provides a hook for third parties to provide a URL shortener. + * + * @package Elgg + * @subpackage Core + */ +?>
\ No newline at end of file diff --git a/views/default/input/userpicker.php b/views/default/input/userpicker.php new file mode 100644 index 000000000..91a397e37 --- /dev/null +++ b/views/default/input/userpicker.php @@ -0,0 +1,73 @@ +<?php +/** + * User Picker. Sends an array of user guids. + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['value'] Array of user guids for already selected users or null + * + * The name of the hidden fields is members[] + * + * @warning Only a single input/userpicker is supported per web page. + * + * 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. + */ + +elgg_load_js('elgg.userpicker'); +elgg_load_js('jquery.ui.autocomplete.html'); + +function user_picker_add_user($user_id) { + $user = get_entity($user_id); + if (!$user || !($user instanceof ElggUser)) { + return false; + } + + $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; +} + +// loop over all values and prepare them so that "in" will work in javascript +$values = array(); +if (!is_array($vars['value'])) { + $vars['value'] = array($vars['value']); +} +foreach ($vars['value'] as $value) { + $values[$value] = TRUE; +} + +// convert the values to a json-encoded list +$json_values = json_encode($values); + +// create an HTML list of users +$user_list = ''; +foreach ($vars['value'] as $user_id) { + $user_list .= user_picker_add_user($user_id); +} + +?> +<div class="elgg-user-picker"> + <input type="text" class="elgg-input-user-picker" size="30"/> + <input type="checkbox" name="match_on" value="true" /> + <label><?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>
\ No newline at end of file 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..6fe03484d --- /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 http://trac.elgg.org/ticket/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/event_calendar/event_calendar.php b/views/default/js/event_calendar/event_calendar.php deleted file mode 100644 index efa1dc1dd..000000000 --- a/views/default/js/event_calendar/event_calendar.php +++ /dev/null @@ -1,171 +0,0 @@ -//<script type="text/javascript"> -elgg.provide('elgg.event_calendar'); - -elgg.event_calendar.init = function () { - $('.event_calendar_paged_checkbox').click(elgg.event_calendar.handlePagedPersonalCalendarToggle); - $('.event-calendar-personal-calendar-toggle').click(elgg.event_calendar.handleDisplayPagePersonalCalendarToggle); - $('#event-calendar-region').change(elgg.event_calendar.handleRegionChange); - $('#event-calendar-ical-link').click(elgg.event_calendar.handleIcalPopup); - $('.event-calendar-repeating-unselected').each(elgg.event_calendar.setRepeatingClass); - $('.event-calendar-repeating-unselected').live('click',elgg.event_calendar.handleRepeatingSelect); - $('.event-calendar-repeating-selected').live('click',elgg.event_calendar.handleRepeatingUnselect); - $('#event-calendar-edit').submit(elgg.event_calendar.handleEditFormSubmit); - $('input.elgg-input-radio[name="schedule_type"]').click(elgg.event_calendar.handleScheduleType); - elgg.event_calendar.handleScheduleType(); - - var all_day_field = $('[name="all_day"][type="checkbox"]'); - if (all_day_field.is(':checked')) { - //$('[name="start_time"]').val(0); - $('#event-calendar-start-time-wrapper').attr('disabled','disabled'); - //$('[name="end_time"]').val(0); - $('#event-calendar-end-time-wrapper').attr('disabled','disabled'); - } - all_day_field.change(elgg.event_calendar.handleAllDayField); - - $('.elgg-input-date[name="start_date"], .elgg-input-date[name="end_date"]').datepicker({ - dateFormat: 'yy-mm-dd', - numberOfMonths: 3, - onSelect: elgg.event_calendar.handleDateRangeSelect, - }); -} - -elgg.event_calendar.handleScheduleType = function(e) { - var st = $('input.elgg-input-radio[name="schedule_type"]:checked').val(); - if (st == 'poll') { - $(".event-calendar-edit-date-wrapper").hide(); - $(".event-calendar-edit-reminder-wrapper").hide(); - $(".event-calendar-edit-form-membership-block").hide(); - $(".event-calendar-edit-form-share-block").hide(); - } else { - $(".event-calendar-edit-date-wrapper").show(); - $(".event-calendar-edit-reminder-wrapper").show(); - $(".event-calendar-edit-form-membership-block").show(); - $(".event-calendar-edit-form-share-block").show(); - if (st == 'all_day') { - $("#event-calendar-start-time-wrapper").hide(); - $("#event-calendar-end-time-wrapper").hide(); - } else { - $("#event-calendar-start-time-wrapper").show(); - $("#event-calendar-end-time-wrapper").show(); - } - } -} - -elgg.event_calendar.handleAllDayField = function(e) { - var field = $('[name="start_time"]'); - if (field.attr('disabled') == 'disabled') { - field.removeAttr('disabled'); - } else { - field.attr('disabled','disabled'); - } - - field = $('[name="end_time"]'); - if (field.attr('disabled') == 'disabled') { - field.removeAttr('disabled'); - } else { - field.attr('disabled','disabled'); - } -} - -elgg.event_calendar.handleDateRangeSelect = function(selectedDate) { - if (this.name == 'start_date') { - $('.elgg-input-date[name="end_date"]').datepicker("option", "minDate", selectedDate); - } else { - $('.elgg-input-date[name="start_date"]').datepicker("option", "maxDate", selectedDate); - } -} - -elgg.event_calendar.handleEditFormSubmit = function(e) { - if ($.trim($('[name="title"]').val()) == '') { - alert(elgg.echo('event_calendar:edit_form:error:missing_title')); - e.preventDefault(); - } -} - -elgg.event_calendar.setRepeatingClass = function(e) { - var id = $(this).attr('id'); - if ($("[name='"+id+"-value']").val() == 1) { - $(this).removeClass('event-calendar-repeating-unselected'); - $(this).addClass('event-calendar-repeating-selected'); - } -} - -elgg.event_calendar.handleRepeatingSelect = function(e) { - $(this).removeClass('event-calendar-repeating-unselected'); - $(this).addClass('event-calendar-repeating-selected'); - var id = $(this).attr('id'); - $("[name='"+id+"-value']").val(1); -} - -elgg.event_calendar.handleRepeatingUnselect = function(e) { - $(this).removeClass('event-calendar-repeating-selected'); - $(this).addClass('event-calendar-repeating-unselected'); - var id = $(this).attr('id'); - $("[name='"+id+"-value']").val(0); -} - -elgg.event_calendar.handleRegionChange = function(e) { - url = $('#event-calendar-region-url-start').val()+"/"+escape($('#event-calendar-region').val()); - elgg.forward(url); -} - -elgg.event_calendar.handleIcalPopup = function(e) { - this.href = '#event-calendar-ical'; - e.preventDefault(); -} - -elgg.event_calendar.handlePagedPersonalCalendarToggle = function() { - guid = parseInt($(this).attr('id').substring('event_calendar_paged_checkbox_'.length)); - elgg.event_calendar.togglePagedPersonalCalendar(guid); -} -elgg.event_calendar.togglePagedPersonalCalendar = function(guid) { - elgg.action('event_calendar/toggle_personal_calendar', - { - data: {event_guid: guid}, - success: function (res) { - var success = res.success; - var msg = res.message; - if (success) { - elgg.system_message(msg,2000); - } else { - elgg.register_error(msg,2000); - } - //$('#event_calendar_paged_messages').html(msg); - if (!success) { - // action failed so toggle checkbox - $("#event_calendar_paged_checkbox_"+guid).attr('checked',!$("#event_calendar_paged_checkbox_"+guid).attr('checked')); - } - } - } - ); -} - -elgg.event_calendar.handleDisplayPagePersonalCalendarToggle = function() { - var guidBit = $(this).attr('id').substring('event_calendar_user_data_'.length); - var guids = guidBit.split('_'); - var event_guid = parseInt(guids[0]); - var user_guid = parseInt(guids[1]); - elgg.event_calendar.toggleDisplayPagePersonalCalendar(event_guid,user_guid); -} - -elgg.event_calendar.toggleDisplayPagePersonalCalendar = function(event_guid,user_guid) { - elgg.action('event_calendar/toggle_personal_calendar', - { - data: {event_guid: event_guid,user_guid: user_guid, other: 'yes'}, - success: function (res) { - var success = res.success; - var msg = res.message; - if (success) { - var button_text = res.button_text; - $('#event_calendar_user_data_'+event_guid+'_'+user_guid).val(button_text); - //elgg.system_message(msg,2000); - } else { - elgg.register_error(msg,2000); - } - } - } - ); -} - -elgg.register_hook_handler('init', 'system', elgg.event_calendar.init); -//</script>
\ No newline at end of file diff --git a/views/default/js/event_calendar/fullcalendar.min.js b/views/default/js/event_calendar/fullcalendar.min.js deleted file mode 100644 index df37bdfd8..000000000 --- a/views/default/js/event_calendar/fullcalendar.min.js +++ /dev/null @@ -1,114 +0,0 @@ -/* - - FullCalendar v1.5.3 - http://arshaw.com/fullcalendar/ - - Use fullcalendar.css for basic styling. - For event drag & drop, requires jQuery UI draggable. - For event resizing, requires jQuery UI resizable. - - Copyright (c) 2011 Adam Shaw - Dual licensed under the MIT and GPL licenses, located in - MIT-LICENSE.txt and GPL-LICENSE.txt respectively. - - Date: Mon Feb 6 22:40:40 2012 -0800 - -*/ -(function(m,ma){function wb(a){m.extend(true,Ya,a)}function Yb(a,b,e){function d(k){if(E){u();q();na();S(k)}else f()}function f(){B=b.theme?"ui":"fc";a.addClass("fc");b.isRTL&&a.addClass("fc-rtl");b.theme&&a.addClass("ui-widget");E=m("<div class='fc-content' style='position:relative'/>").prependTo(a);C=new Zb(X,b);(P=C.render())&&a.prepend(P);y(b.defaultView);m(window).resize(oa);t()||g()}function g(){setTimeout(function(){!n.start&&t()&&S()},0)}function l(){m(window).unbind("resize",oa);C.destroy(); -E.remove();a.removeClass("fc fc-rtl ui-widget")}function j(){return i.offsetWidth!==0}function t(){return m("body")[0].offsetWidth!==0}function y(k){if(!n||k!=n.name){F++;pa();var D=n,Z;if(D){(D.beforeHide||xb)();Za(E,E.height());D.element.hide()}else Za(E,1);E.css("overflow","hidden");if(n=Y[k])n.element.show();else n=Y[k]=new Ja[k](Z=s=m("<div class='fc-view fc-view-"+k+"' style='position:absolute'/>").appendTo(E),X);D&&C.deactivateButton(D.name);C.activateButton(k);S();E.css("overflow","");D&& -Za(E,1);Z||(n.afterShow||xb)();F--}}function S(k){if(j()){F++;pa();o===ma&&u();var D=false;if(!n.start||k||r<n.start||r>=n.end){n.render(r,k||0);fa(true);D=true}else if(n.sizeDirty){n.clearEvents();fa();D=true}else if(n.eventsDirty){n.clearEvents();D=true}n.sizeDirty=false;n.eventsDirty=false;ga(D);W=a.outerWidth();C.updateTitle(n.title);k=new Date;k>=n.start&&k<n.end?C.disableButton("today"):C.enableButton("today");F--;n.trigger("viewDisplay",i)}}function Q(){q();if(j()){u();fa();pa();n.clearEvents(); -n.renderEvents(J);n.sizeDirty=false}}function q(){m.each(Y,function(k,D){D.sizeDirty=true})}function u(){o=b.contentHeight?b.contentHeight:b.height?b.height-(P?P.height():0)-Sa(E):Math.round(E.width()/Math.max(b.aspectRatio,0.5))}function fa(k){F++;n.setHeight(o,k);if(s){s.css("position","relative");s=null}n.setWidth(E.width(),k);F--}function oa(){if(!F)if(n.start){var k=++v;setTimeout(function(){if(k==v&&!F&&j())if(W!=(W=a.outerWidth())){F++;Q();n.trigger("windowResize",i);F--}},200)}else g()}function ga(k){if(!b.lazyFetching|| -ya(n.visStart,n.visEnd))ra();else k&&da()}function ra(){K(n.visStart,n.visEnd)}function sa(k){J=k;da()}function ha(k){da(k)}function da(k){na();if(j()){n.clearEvents();n.renderEvents(J,k);n.eventsDirty=false}}function na(){m.each(Y,function(k,D){D.eventsDirty=true})}function ua(k,D,Z){n.select(k,D,Z===ma?true:Z)}function pa(){n&&n.unselect()}function U(){S(-1)}function ca(){S(1)}function ka(){gb(r,-1);S()}function qa(){gb(r,1);S()}function G(){r=new Date;S()}function p(k,D,Z){if(k instanceof Date)r= -N(k);else yb(r,k,D,Z);S()}function L(k,D,Z){k!==ma&&gb(r,k);D!==ma&&hb(r,D);Z!==ma&&ba(r,Z);S()}function c(){return N(r)}function z(){return n}function H(k,D){if(D===ma)return b[k];if(k=="height"||k=="contentHeight"||k=="aspectRatio"){b[k]=D;Q()}}function T(k,D){if(b[k])return b[k].apply(D||i,Array.prototype.slice.call(arguments,2))}var X=this;X.options=b;X.render=d;X.destroy=l;X.refetchEvents=ra;X.reportEvents=sa;X.reportEventChange=ha;X.rerenderEvents=da;X.changeView=y;X.select=ua;X.unselect=pa; -X.prev=U;X.next=ca;X.prevYear=ka;X.nextYear=qa;X.today=G;X.gotoDate=p;X.incrementDate=L;X.formatDate=function(k,D){return Oa(k,D,b)};X.formatDates=function(k,D,Z){return ib(k,D,Z,b)};X.getDate=c;X.getView=z;X.option=H;X.trigger=T;$b.call(X,b,e);var ya=X.isFetchNeeded,K=X.fetchEvents,i=a[0],C,P,E,B,n,Y={},W,o,s,v=0,F=0,r=new Date,J=[],M;yb(r,b.year,b.month,b.date);b.droppable&&m(document).bind("dragstart",function(k,D){var Z=k.target,ja=m(Z);if(!ja.parents(".fc").length){var ia=b.dropAccept;if(m.isFunction(ia)? -ia.call(Z,ja):ja.is(ia)){M=Z;n.dragStart(M,k,D)}}}).bind("dragstop",function(k,D){if(M){n.dragStop(M,k,D);M=null}})}function Zb(a,b){function e(){q=b.theme?"ui":"fc";if(b.header)return Q=m("<table class='fc-header' style='width:100%'/>").append(m("<tr/>").append(f("left")).append(f("center")).append(f("right")))}function d(){Q.remove()}function f(u){var fa=m("<td class='fc-header-"+u+"'/>");(u=b.header[u])&&m.each(u.split(" "),function(oa){oa>0&&fa.append("<span class='fc-header-space'/>");var ga; -m.each(this.split(","),function(ra,sa){if(sa=="title"){fa.append("<span class='fc-header-title'><h2> </h2></span>");ga&&ga.addClass(q+"-corner-right");ga=null}else{var ha;if(a[sa])ha=a[sa];else if(Ja[sa])ha=function(){na.removeClass(q+"-state-hover");a.changeView(sa)};if(ha){ra=b.theme?jb(b.buttonIcons,sa):null;var da=jb(b.buttonText,sa),na=m("<span class='fc-button fc-button-"+sa+" "+q+"-state-default'><span class='fc-button-inner'><span class='fc-button-content'>"+(ra?"<span class='fc-icon-wrap'><span class='ui-icon ui-icon-"+ -ra+"'/></span>":da)+"</span><span class='fc-button-effect'><span></span></span></span></span>");if(na){na.click(function(){na.hasClass(q+"-state-disabled")||ha()}).mousedown(function(){na.not("."+q+"-state-active").not("."+q+"-state-disabled").addClass(q+"-state-down")}).mouseup(function(){na.removeClass(q+"-state-down")}).hover(function(){na.not("."+q+"-state-active").not("."+q+"-state-disabled").addClass(q+"-state-hover")},function(){na.removeClass(q+"-state-hover").removeClass(q+"-state-down")}).appendTo(fa); -ga||na.addClass(q+"-corner-left");ga=na}}}});ga&&ga.addClass(q+"-corner-right")});return fa}function g(u){Q.find("h2").html(u)}function l(u){Q.find("span.fc-button-"+u).addClass(q+"-state-active")}function j(u){Q.find("span.fc-button-"+u).removeClass(q+"-state-active")}function t(u){Q.find("span.fc-button-"+u).addClass(q+"-state-disabled")}function y(u){Q.find("span.fc-button-"+u).removeClass(q+"-state-disabled")}var S=this;S.render=e;S.destroy=d;S.updateTitle=g;S.activateButton=l;S.deactivateButton= -j;S.disableButton=t;S.enableButton=y;var Q=m([]),q}function $b(a,b){function e(c,z){return!ca||c<ca||z>ka}function d(c,z){ca=c;ka=z;L=[];c=++qa;G=z=U.length;for(var H=0;H<z;H++)f(U[H],c)}function f(c,z){g(c,function(H){if(z==qa){if(H){for(var T=0;T<H.length;T++){H[T].source=c;oa(H[T])}L=L.concat(H)}G--;G||ua(L)}})}function g(c,z){var H,T=Aa.sourceFetchers,X;for(H=0;H<T.length;H++){X=T[H](c,ca,ka,z);if(X===true)return;else if(typeof X=="object"){g(X,z);return}}if(H=c.events)if(m.isFunction(H)){u(); -H(N(ca),N(ka),function(C){z(C);fa()})}else m.isArray(H)?z(H):z();else if(c.url){var ya=c.success,K=c.error,i=c.complete;H=m.extend({},c.data||{});T=Ta(c.startParam,a.startParam);X=Ta(c.endParam,a.endParam);if(T)H[T]=Math.round(+ca/1E3);if(X)H[X]=Math.round(+ka/1E3);u();m.ajax(m.extend({},ac,c,{data:H,success:function(C){C=C||[];var P=$a(ya,this,arguments);if(m.isArray(P))C=P;z(C)},error:function(){$a(K,this,arguments);z()},complete:function(){$a(i,this,arguments);fa()}}))}else z()}function l(c){if(c= -j(c)){G++;f(c,qa)}}function j(c){if(m.isFunction(c)||m.isArray(c))c={events:c};else if(typeof c=="string")c={url:c};if(typeof c=="object"){ga(c);U.push(c);return c}}function t(c){U=m.grep(U,function(z){return!ra(z,c)});L=m.grep(L,function(z){return!ra(z.source,c)});ua(L)}function y(c){var z,H=L.length,T,X=na().defaultEventEnd,ya=c.start-c._start,K=c.end?c.end-(c._end||X(c)):0;for(z=0;z<H;z++){T=L[z];if(T._id==c._id&&T!=c){T.start=new Date(+T.start+ya);T.end=c.end?T.end?new Date(+T.end+K):new Date(+X(T)+ -K):null;T.title=c.title;T.url=c.url;T.allDay=c.allDay;T.className=c.className;T.editable=c.editable;T.color=c.color;T.backgroudColor=c.backgroudColor;T.borderColor=c.borderColor;T.textColor=c.textColor;oa(T)}}oa(c);ua(L)}function S(c,z){oa(c);if(!c.source){if(z){pa.events.push(c);c.source=pa}L.push(c)}ua(L)}function Q(c){if(c){if(!m.isFunction(c)){var z=c+"";c=function(T){return T._id==z}}L=m.grep(L,c,true);for(H=0;H<U.length;H++)if(m.isArray(U[H].events))U[H].events=m.grep(U[H].events,c,true)}else{L= -[];for(var H=0;H<U.length;H++)if(m.isArray(U[H].events))U[H].events=[]}ua(L)}function q(c){if(m.isFunction(c))return m.grep(L,c);else if(c){c+="";return m.grep(L,function(z){return z._id==c})}return L}function u(){p++||da("loading",null,true)}function fa(){--p||da("loading",null,false)}function oa(c){var z=c.source||{},H=Ta(z.ignoreTimezone,a.ignoreTimezone);c._id=c._id||(c.id===ma?"_fc"+bc++:c.id+"");if(c.date){if(!c.start)c.start=c.date;delete c.date}c._start=N(c.start=kb(c.start,H));c.end=kb(c.end, -H);if(c.end&&c.end<=c.start)c.end=null;c._end=c.end?N(c.end):null;if(c.allDay===ma)c.allDay=Ta(z.allDayDefault,a.allDayDefault);if(c.className){if(typeof c.className=="string")c.className=c.className.split(/\s+/)}else c.className=[]}function ga(c){if(c.className){if(typeof c.className=="string")c.className=c.className.split(/\s+/)}else c.className=[];for(var z=Aa.sourceNormalizers,H=0;H<z.length;H++)z[H](c)}function ra(c,z){return c&&z&&sa(c)==sa(z)}function sa(c){return(typeof c=="object"?c.events|| -c.url:"")||c}var ha=this;ha.isFetchNeeded=e;ha.fetchEvents=d;ha.addEventSource=l;ha.removeEventSource=t;ha.updateEvent=y;ha.renderEvent=S;ha.removeEvents=Q;ha.clientEvents=q;ha.normalizeEvent=oa;var da=ha.trigger,na=ha.getView,ua=ha.reportEvents,pa={events:[]},U=[pa],ca,ka,qa=0,G=0,p=0,L=[];for(ha=0;ha<b.length;ha++)j(b[ha])}function gb(a,b,e){a.setFullYear(a.getFullYear()+b);e||Ka(a);return a}function hb(a,b,e){if(+a){b=a.getMonth()+b;var d=N(a);d.setDate(1);d.setMonth(b);a.setMonth(b);for(e||Ka(a);a.getMonth()!= -d.getMonth();)a.setDate(a.getDate()+(a<d?1:-1))}return a}function ba(a,b,e){if(+a){b=a.getDate()+b;var d=N(a);d.setHours(9);d.setDate(b);a.setDate(b);e||Ka(a);lb(a,d)}return a}function lb(a,b){if(+a)for(;a.getDate()!=b.getDate();)a.setTime(+a+(a<b?1:-1)*cc)}function xa(a,b){a.setMinutes(a.getMinutes()+b);return a}function Ka(a){a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);return a}function N(a,b){if(b)return Ka(new Date(+a));return new Date(+a)}function zb(){var a=0,b;do b=new Date(1970, -a++,1);while(b.getHours());return b}function Fa(a,b,e){for(b=b||1;!a.getDay()||e&&a.getDay()==1||!e&&a.getDay()==6;)ba(a,b);return a}function Ca(a,b){return Math.round((N(a,true)-N(b,true))/Ab)}function yb(a,b,e,d){if(b!==ma&&b!=a.getFullYear()){a.setDate(1);a.setMonth(0);a.setFullYear(b)}if(e!==ma&&e!=a.getMonth()){a.setDate(1);a.setMonth(e)}d!==ma&&a.setDate(d)}function kb(a,b){if(typeof a=="object")return a;if(typeof a=="number")return new Date(a*1E3);if(typeof a=="string"){if(a.match(/^\d+(\.\d+)?$/))return new Date(parseFloat(a)* -1E3);if(b===ma)b=true;return Bb(a,b)||(a?new Date(a):null)}return null}function Bb(a,b){a=a.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/);if(!a)return null;var e=new Date(a[1],0,1);if(b||!a[13]){b=new Date(a[1],0,1,9,0);if(a[3]){e.setMonth(a[3]-1);b.setMonth(a[3]-1)}if(a[5]){e.setDate(a[5]);b.setDate(a[5])}lb(e,b);a[7]&&e.setHours(a[7]);a[8]&&e.setMinutes(a[8]);a[10]&&e.setSeconds(a[10]);a[12]&&e.setMilliseconds(Number("0."+ -a[12])*1E3);lb(e,b)}else{e.setUTCFullYear(a[1],a[3]?a[3]-1:0,a[5]||1);e.setUTCHours(a[7]||0,a[8]||0,a[10]||0,a[12]?Number("0."+a[12])*1E3:0);if(a[14]){b=Number(a[16])*60+(a[18]?Number(a[18]):0);b*=a[15]=="-"?1:-1;e=new Date(+e+b*60*1E3)}}return e}function mb(a){if(typeof a=="number")return a*60;if(typeof a=="object")return a.getHours()*60+a.getMinutes();if(a=a.match(/(\d+)(?::(\d+))?\s*(\w+)?/)){var b=parseInt(a[1],10);if(a[3]){b%=12;if(a[3].toLowerCase().charAt(0)=="p")b+=12}return b*60+(a[2]?parseInt(a[2], -10):0)}}function Oa(a,b,e){return ib(a,null,b,e)}function ib(a,b,e,d){d=d||Ya;var f=a,g=b,l,j=e.length,t,y,S,Q="";for(l=0;l<j;l++){t=e.charAt(l);if(t=="'")for(y=l+1;y<j;y++){if(e.charAt(y)=="'"){if(f){Q+=y==l+1?"'":e.substring(l+1,y);l=y}break}}else if(t=="(")for(y=l+1;y<j;y++){if(e.charAt(y)==")"){l=Oa(f,e.substring(l+1,y),d);if(parseInt(l.replace(/\D/,""),10))Q+=l;l=y;break}}else if(t=="[")for(y=l+1;y<j;y++){if(e.charAt(y)=="]"){t=e.substring(l+1,y);l=Oa(f,t,d);if(l!=Oa(g,t,d))Q+=l;l=y;break}}else if(t== -"{"){f=b;g=a}else if(t=="}"){f=a;g=b}else{for(y=j;y>l;y--)if(S=dc[e.substring(l,y)]){if(f)Q+=S(f,d);l=y-1;break}if(y==l)if(f)Q+=t}}return Q}function Ua(a){return a.end?ec(a.end,a.allDay):ba(N(a.start),1)}function ec(a,b){a=N(a);return b||a.getHours()||a.getMinutes()?ba(a,1):Ka(a)}function fc(a,b){return(b.msLength-a.msLength)*100+(a.event.start-b.event.start)}function Cb(a,b){return a.end>b.start&&a.start<b.end}function nb(a,b,e,d){var f=[],g,l=a.length,j,t,y,S,Q;for(g=0;g<l;g++){j=a[g];t=j.start; -y=b[g];if(y>e&&t<d){if(t<e){t=N(e);S=false}else{t=t;S=true}if(y>d){y=N(d);Q=false}else{y=y;Q=true}f.push({event:j,start:t,end:y,isStart:S,isEnd:Q,msLength:y-t})}}return f.sort(fc)}function ob(a){var b=[],e,d=a.length,f,g,l,j;for(e=0;e<d;e++){f=a[e];for(g=0;;){l=false;if(b[g])for(j=0;j<b[g].length;j++)if(Cb(b[g][j],f)){l=true;break}if(l)g++;else break}if(b[g])b[g].push(f);else b[g]=[f]}return b}function Db(a,b,e){a.unbind("mouseover").mouseover(function(d){for(var f=d.target,g;f!=this;){g=f;f=f.parentNode}if((f= -g._fci)!==ma){g._fci=ma;g=b[f];e(g.event,g.element,g);m(d.target).trigger(d)}d.stopPropagation()})}function Va(a,b,e){for(var d=0,f;d<a.length;d++){f=m(a[d]);f.width(Math.max(0,b-pb(f,e)))}}function Eb(a,b,e){for(var d=0,f;d<a.length;d++){f=m(a[d]);f.height(Math.max(0,b-Sa(f,e)))}}function pb(a,b){return gc(a)+hc(a)+(b?ic(a):0)}function gc(a){return(parseFloat(m.curCSS(a[0],"paddingLeft",true))||0)+(parseFloat(m.curCSS(a[0],"paddingRight",true))||0)}function ic(a){return(parseFloat(m.curCSS(a[0], -"marginLeft",true))||0)+(parseFloat(m.curCSS(a[0],"marginRight",true))||0)}function hc(a){return(parseFloat(m.curCSS(a[0],"borderLeftWidth",true))||0)+(parseFloat(m.curCSS(a[0],"borderRightWidth",true))||0)}function Sa(a,b){return jc(a)+kc(a)+(b?Fb(a):0)}function jc(a){return(parseFloat(m.curCSS(a[0],"paddingTop",true))||0)+(parseFloat(m.curCSS(a[0],"paddingBottom",true))||0)}function Fb(a){return(parseFloat(m.curCSS(a[0],"marginTop",true))||0)+(parseFloat(m.curCSS(a[0],"marginBottom",true))||0)} -function kc(a){return(parseFloat(m.curCSS(a[0],"borderTopWidth",true))||0)+(parseFloat(m.curCSS(a[0],"borderBottomWidth",true))||0)}function Za(a,b){b=typeof b=="number"?b+"px":b;a.each(function(e,d){d.style.cssText+=";min-height:"+b+";_height:"+b})}function xb(){}function Gb(a,b){return a-b}function Hb(a){return Math.max.apply(Math,a)}function Pa(a){return(a<10?"0":"")+a}function jb(a,b){if(a[b]!==ma)return a[b];b=b.split(/(?=[A-Z])/);for(var e=b.length-1,d;e>=0;e--){d=a[b[e].toLowerCase()];if(d!== -ma)return d}return a[""]}function Qa(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"<br />")}function Ib(a){return a.id+"/"+a.className+"/"+a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig,"")}function qb(a){a.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})}function ab(a){a.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")} -function rb(a,b){a.each(function(e,d){d.className=d.className.replace(/^fc-\w*/,"fc-"+lc[b.getDay()])})}function Jb(a,b){var e=a.source||{},d=a.color,f=e.color,g=b("eventColor"),l=a.backgroundColor||d||e.backgroundColor||f||b("eventBackgroundColor")||g;d=a.borderColor||d||e.borderColor||f||b("eventBorderColor")||g;a=a.textColor||e.textColor||b("eventTextColor");b=[];l&&b.push("background-color:"+l);d&&b.push("border-color:"+d);a&&b.push("color:"+a);return b.join(";")}function $a(a,b,e){if(m.isFunction(a))a= -[a];if(a){var d,f;for(d=0;d<a.length;d++)f=a[d].apply(b,e)||f;return f}}function Ta(){for(var a=0;a<arguments.length;a++)if(arguments[a]!==ma)return arguments[a]}function mc(a,b){function e(j,t){if(t){hb(j,t);j.setDate(1)}j=N(j,true);j.setDate(1);t=hb(N(j),1);var y=N(j),S=N(t),Q=f("firstDay"),q=f("weekends")?0:1;if(q){Fa(y);Fa(S,-1,true)}ba(y,-((y.getDay()-Math.max(Q,q)+7)%7));ba(S,(7-S.getDay()+Math.max(Q,q))%7);Q=Math.round((S-y)/(Ab*7));if(f("weekMode")=="fixed"){ba(S,(6-Q)*7);Q=6}d.title=l(j, -f("titleFormat"));d.start=j;d.end=t;d.visStart=y;d.visEnd=S;g(6,Q,q?5:7,true)}var d=this;d.render=e;sb.call(d,a,b,"month");var f=d.opt,g=d.renderBasic,l=b.formatDate}function nc(a,b){function e(j,t){t&&ba(j,t*7);j=ba(N(j),-((j.getDay()-f("firstDay")+7)%7));t=ba(N(j),7);var y=N(j),S=N(t),Q=f("weekends");if(!Q){Fa(y);Fa(S,-1,true)}d.title=l(y,ba(N(S),-1),f("titleFormat"));d.start=j;d.end=t;d.visStart=y;d.visEnd=S;g(1,1,Q?7:5,false)}var d=this;d.render=e;sb.call(d,a,b,"basicWeek");var f=d.opt,g=d.renderBasic, -l=b.formatDates}function oc(a,b){function e(j,t){if(t){ba(j,t);f("weekends")||Fa(j,t<0?-1:1)}d.title=l(j,f("titleFormat"));d.start=d.visStart=N(j,true);d.end=d.visEnd=ba(N(d.start),1);g(1,1,1,false)}var d=this;d.render=e;sb.call(d,a,b,"basicDay");var f=d.opt,g=d.renderBasic,l=b.formatDate}function sb(a,b,e){function d(w,I,R,V){v=I;F=R;f();(I=!C)?g(w,V):z();l(I)}function f(){if(k=L("isRTL")){D=-1;Z=F-1}else{D=1;Z=0}ja=L("firstDay");ia=L("weekends")?0:1;la=L("theme")?"ui":"fc";$=L("columnFormat")}function g(w, -I){var R,V=la+"-widget-header",ea=la+"-widget-content",aa;R="<table class='fc-border-separate' style='width:100%' cellspacing='0'><thead><tr>";for(aa=0;aa<F;aa++)R+="<th class='fc- "+V+"'/>";R+="</tr></thead><tbody>";for(aa=0;aa<w;aa++){R+="<tr class='fc-week"+aa+"'>";for(V=0;V<F;V++)R+="<td class='fc- "+ea+" fc-day"+(aa*F+V)+"'><div>"+(I?"<div class='fc-day-number'/>":"")+"<div class='fc-day-content'><div style='position:relative'> </div></div></div></td>";R+="</tr>"}R+="</tbody></table>";w= -m(R).appendTo(a);K=w.find("thead");i=K.find("th");C=w.find("tbody");P=C.find("tr");E=C.find("td");B=E.filter(":first-child");n=P.eq(0).find("div.fc-day-content div");ab(K.add(K.find("tr")));ab(P);P.eq(0).addClass("fc-first");y(E);Y=m("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(a)}function l(w){var I=w||v==1,R=p.start.getMonth(),V=Ka(new Date),ea,aa,va;I&&i.each(function(wa,Ga){ea=m(Ga);aa=ca(wa);ea.html(ya(aa,$));rb(ea,aa)});E.each(function(wa,Ga){ea=m(Ga);aa=ca(wa);aa.getMonth()== -R?ea.removeClass("fc-other-month"):ea.addClass("fc-other-month");+aa==+V?ea.addClass(la+"-state-highlight fc-today"):ea.removeClass(la+"-state-highlight fc-today");ea.find("div.fc-day-number").text(aa.getDate());I&&rb(ea,aa)});P.each(function(wa,Ga){va=m(Ga);if(wa<v){va.show();wa==v-1?va.addClass("fc-last"):va.removeClass("fc-last")}else va.hide()})}function j(w){o=w;w=o-K.height();var I,R,V;if(L("weekMode")=="variable")I=R=Math.floor(w/(v==1?2:6));else{I=Math.floor(w/v);R=w-I*(v-1)}B.each(function(ea, -aa){if(ea<v){V=m(aa);Za(V.find("> div"),(ea==v-1?R:I)-Sa(V))}})}function t(w){W=w;M.clear();s=Math.floor(W/F);Va(i.slice(0,-1),s)}function y(w){w.click(S).mousedown(X)}function S(w){if(!L("selectable")){var I=parseInt(this.className.match(/fc\-day(\d+)/)[1]);I=ca(I);c("dayClick",this,I,true,w)}}function Q(w,I,R){R&&r.build();R=N(p.visStart);for(var V=ba(N(R),F),ea=0;ea<v;ea++){var aa=new Date(Math.max(R,w)),va=new Date(Math.min(V,I));if(aa<va){var wa;if(k){wa=Ca(va,R)*D+Z+1;aa=Ca(aa,R)*D+Z+1}else{wa= -Ca(aa,R);aa=Ca(va,R)}y(q(ea,wa,ea,aa-1))}ba(R,7);ba(V,7)}}function q(w,I,R,V){w=r.rect(w,I,R,V,a);return H(w,a)}function u(w){return N(w)}function fa(w,I){Q(w,ba(N(I),1),true)}function oa(){T()}function ga(w,I,R){var V=ua(w);c("dayClick",E[V.row*F+V.col],w,I,R)}function ra(w,I){J.start(function(R){T();R&&q(R.row,R.col,R.row,R.col)},I)}function sa(w,I,R){var V=J.stop();T();if(V){V=pa(V);c("drop",w,V,true,I,R)}}function ha(w){return N(w.start)}function da(w){return M.left(w)}function na(w){return M.right(w)} -function ua(w){return{row:Math.floor(Ca(w,p.visStart)/7),col:ka(w.getDay())}}function pa(w){return U(w.row,w.col)}function U(w,I){return ba(N(p.visStart),w*7+I*D+Z)}function ca(w){return U(Math.floor(w/F),w%F)}function ka(w){return(w-Math.max(ja,ia)+F)%F*D+Z}function qa(w){return P.eq(w)}function G(){return{left:0,right:W}}var p=this;p.renderBasic=d;p.setHeight=j;p.setWidth=t;p.renderDayOverlay=Q;p.defaultSelectionEnd=u;p.renderSelection=fa;p.clearSelection=oa;p.reportDayClick=ga;p.dragStart=ra;p.dragStop= -sa;p.defaultEventEnd=ha;p.getHoverListener=function(){return J};p.colContentLeft=da;p.colContentRight=na;p.dayOfWeekCol=ka;p.dateCell=ua;p.cellDate=pa;p.cellIsAllDay=function(){return true};p.allDayRow=qa;p.allDayBounds=G;p.getRowCnt=function(){return v};p.getColCnt=function(){return F};p.getColWidth=function(){return s};p.getDaySegmentContainer=function(){return Y};Kb.call(p,a,b,e);Lb.call(p);Mb.call(p);pc.call(p);var L=p.opt,c=p.trigger,z=p.clearEvents,H=p.renderOverlay,T=p.clearOverlays,X=p.daySelectionMousedown, -ya=b.formatDate,K,i,C,P,E,B,n,Y,W,o,s,v,F,r,J,M,k,D,Z,ja,ia,la,$;qb(a.addClass("fc-grid"));r=new Nb(function(w,I){var R,V,ea;i.each(function(aa,va){R=m(va);V=R.offset().left;if(aa)ea[1]=V;ea=[V];I[aa]=ea});ea[1]=V+R.outerWidth();P.each(function(aa,va){if(aa<v){R=m(va);V=R.offset().top;if(aa)ea[1]=V;ea=[V];w[aa]=ea}});ea[1]=V+R.outerHeight()});J=new Ob(r);M=new Pb(function(w){return n.eq(w)})}function pc(){function a(U,ca){S(U);ua(e(U),ca)}function b(){Q();ga().empty()}function e(U){var ca=da(),ka= -na(),qa=N(g.visStart);ka=ba(N(qa),ka);var G=m.map(U,Ua),p,L,c,z,H,T,X=[];for(p=0;p<ca;p++){L=ob(nb(U,G,qa,ka));for(c=0;c<L.length;c++){z=L[c];for(H=0;H<z.length;H++){T=z[H];T.row=p;T.level=c;X.push(T)}}ba(qa,7);ba(ka,7)}return X}function d(U,ca,ka){t(U)&&f(U,ca);ka.isEnd&&y(U)&&pa(U,ca,ka);q(U,ca)}function f(U,ca){var ka=ra(),qa;ca.draggable({zIndex:9,delay:50,opacity:l("dragOpacity"),revertDuration:l("dragRevertDuration"),start:function(G,p){j("eventDragStart",ca,U,G,p);fa(U,ca);ka.start(function(L, -c,z,H){ca.draggable("option","revert",!L||!z&&!H);ha();if(L){qa=z*7+H*(l("isRTL")?-1:1);sa(ba(N(U.start),qa),ba(Ua(U),qa))}else qa=0},G,"drag")},stop:function(G,p){ka.stop();ha();j("eventDragStop",ca,U,G,p);if(qa)oa(this,U,qa,0,U.allDay,G,p);else{ca.css("filter","");u(U,ca)}}})}var g=this;g.renderEvents=a;g.compileDaySegs=e;g.clearEvents=b;g.bindDaySeg=d;Qb.call(g);var l=g.opt,j=g.trigger,t=g.isEventDraggable,y=g.isEventResizable,S=g.reportEvents,Q=g.reportEventClear,q=g.eventElementHandlers,u=g.showEvents, -fa=g.hideEvents,oa=g.eventDrop,ga=g.getDaySegmentContainer,ra=g.getHoverListener,sa=g.renderDayOverlay,ha=g.clearOverlays,da=g.getRowCnt,na=g.getColCnt,ua=g.renderDaySegs,pa=g.resizableDayEvent}function qc(a,b){function e(j,t){t&&ba(j,t*7);j=ba(N(j),-((j.getDay()-f("firstDay")+7)%7));t=ba(N(j),7);var y=N(j),S=N(t),Q=f("weekends");if(!Q){Fa(y);Fa(S,-1,true)}d.title=l(y,ba(N(S),-1),f("titleFormat"));d.start=j;d.end=t;d.visStart=y;d.visEnd=S;g(Q?7:5)}var d=this;d.render=e;Rb.call(d,a,b,"agendaWeek"); -var f=d.opt,g=d.renderAgenda,l=b.formatDates}function rc(a,b){function e(j,t){if(t){ba(j,t);f("weekends")||Fa(j,t<0?-1:1)}t=N(j,true);var y=ba(N(t),1);d.title=l(j,f("titleFormat"));d.start=d.visStart=t;d.end=d.visEnd=y;g(1)}var d=this;d.render=e;Rb.call(d,a,b,"agendaDay");var f=d.opt,g=d.renderAgenda,l=b.formatDate}function Rb(a,b,e){function d(h){Ba=h;f();v?P():g();l()}function f(){Wa=i("theme")?"ui":"fc";Sb=i("weekends")?0:1;Tb=i("firstDay");if(Ub=i("isRTL")){Ha=-1;Ia=Ba-1}else{Ha=1;Ia=0}La=mb(i("minTime")); -bb=mb(i("maxTime"));Vb=i("columnFormat")}function g(){var h=Wa+"-widget-header",O=Wa+"-widget-content",x,A,ta,za,Da,Ea=i("slotMinutes")%15==0;x="<table style='width:100%' class='fc-agenda-days fc-border-separate' cellspacing='0'><thead><tr><th class='fc-agenda-axis "+h+"'> </th>";for(A=0;A<Ba;A++)x+="<th class='fc- fc-col"+A+" "+h+"'/>";x+="<th class='fc-agenda-gutter "+h+"'> </th></tr></thead><tbody><tr><th class='fc-agenda-axis "+h+"'> </th>";for(A=0;A<Ba;A++)x+="<td class='fc- fc-col"+ -A+" "+O+"'><div><div class='fc-day-content'><div style='position:relative'> </div></div></div></td>";x+="<td class='fc-agenda-gutter "+O+"'> </td></tr></tbody></table>";v=m(x).appendTo(a);F=v.find("thead");r=F.find("th").slice(1,-1);J=v.find("tbody");M=J.find("td").slice(0,-1);k=M.find("div.fc-day-content div");D=M.eq(0);Z=D.find("> div");ab(F.add(F.find("tr")));ab(J.add(J.find("tr")));aa=F.find("th:first");va=v.find(".fc-agenda-gutter");ja=m("<div style='position:absolute;z-index:2;left:0;width:100%'/>").appendTo(a); -if(i("allDaySlot")){ia=m("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(ja);x="<table style='width:100%' class='fc-agenda-allday' cellspacing='0'><tr><th class='"+h+" fc-agenda-axis'>"+i("allDayText")+"</th><td><div class='fc-day-content'><div style='position:relative'/></div></td><th class='"+h+" fc-agenda-gutter'> </th></tr></table>";la=m(x).appendTo(ja);$=la.find("tr");q($.find("td"));aa=aa.add(la.find("th:first"));va=va.add(la.find("th.fc-agenda-gutter"));ja.append("<div class='fc-agenda-divider "+ -h+"'><div class='fc-agenda-divider-inner'/></div>")}else ia=m([]);w=m("<div style='position:absolute;width:100%;overflow-x:hidden;overflow-y:auto'/>").appendTo(ja);I=m("<div style='position:relative;width:100%;overflow:hidden'/>").appendTo(w);R=m("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(I);x="<table class='fc-agenda-slots' style='width:100%' cellspacing='0'><tbody>";ta=zb();za=xa(N(ta),bb);xa(ta,La);for(A=tb=0;ta<za;A++){Da=ta.getMinutes();x+="<tr class='fc-slot"+A+" "+ -(!Da?"":"fc-minor")+"'><th class='fc-agenda-axis "+h+"'>"+(!Ea||!Da?s(ta,i("axisFormat")):" ")+"</th><td class='"+O+"'><div style='position:relative'> </div></td></tr>";xa(ta,i("slotMinutes"));tb++}x+="</tbody></table>";V=m(x).appendTo(I);ea=V.find("div:first");u(V.find("td"));aa=aa.add(V.find("th:first"))}function l(){var h,O,x,A,ta=Ka(new Date);for(h=0;h<Ba;h++){A=ua(h);O=r.eq(h);O.html(s(A,Vb));x=M.eq(h);+A==+ta?x.addClass(Wa+"-state-highlight fc-today"):x.removeClass(Wa+"-state-highlight fc-today"); -rb(O.add(x),A)}}function j(h,O){if(h===ma)h=Wb;Wb=h;ub={};var x=J.position().top,A=w.position().top;h=Math.min(h-x,V.height()+A+1);Z.height(h-Sa(D));ja.css("top",x);w.height(h-A-1);Xa=ea.height()+1;O&&y()}function t(h){Ga=h;cb.clear();Ma=0;Va(aa.width("").each(function(O,x){Ma=Math.max(Ma,m(x).outerWidth())}),Ma);h=w[0].clientWidth;if(vb=w.width()-h){Va(va,vb);va.show().prev().removeClass("fc-last")}else va.hide().prev().addClass("fc-last");db=Math.floor((h-Ma)/Ba);Va(r.slice(0,-1),db)}function y(){function h(){w.scrollTop(A)} -var O=zb(),x=N(O);x.setHours(i("firstHour"));var A=ca(O,x)+1;h();setTimeout(h,0)}function S(){Xb=w.scrollTop()}function Q(){w.scrollTop(Xb)}function q(h){h.click(fa).mousedown(W)}function u(h){h.click(fa).mousedown(H)}function fa(h){if(!i("selectable")){var O=Math.min(Ba-1,Math.floor((h.pageX-v.offset().left-Ma)/db)),x=ua(O),A=this.parentNode.className.match(/fc-slot(\d+)/);if(A){A=parseInt(A[1])*i("slotMinutes");var ta=Math.floor(A/60);x.setHours(ta);x.setMinutes(A%60+La);C("dayClick",M[O],x,false, -h)}else C("dayClick",M[O],x,true,h)}}function oa(h,O,x){x&&Na.build();var A=N(K.visStart);if(Ub){x=Ca(O,A)*Ha+Ia+1;h=Ca(h,A)*Ha+Ia+1}else{x=Ca(h,A);h=Ca(O,A)}x=Math.max(0,x);h=Math.min(Ba,h);x<h&&q(ga(0,x,0,h-1))}function ga(h,O,x,A){h=Na.rect(h,O,x,A,ja);return E(h,ja)}function ra(h,O){for(var x=N(K.visStart),A=ba(N(x),1),ta=0;ta<Ba;ta++){var za=new Date(Math.max(x,h)),Da=new Date(Math.min(A,O));if(za<Da){var Ea=ta*Ha+Ia;Ea=Na.rect(0,Ea,0,Ea,I);za=ca(x,za);Da=ca(x,Da);Ea.top=za;Ea.height=Da-za;u(E(Ea, -I))}ba(x,1);ba(A,1)}}function sa(h){return cb.left(h)}function ha(h){return cb.right(h)}function da(h){return{row:Math.floor(Ca(h,K.visStart)/7),col:U(h.getDay())}}function na(h){var O=ua(h.col);h=h.row;i("allDaySlot")&&h--;h>=0&&xa(O,La+h*i("slotMinutes"));return O}function ua(h){return ba(N(K.visStart),h*Ha+Ia)}function pa(h){return i("allDaySlot")&&!h.row}function U(h){return(h-Math.max(Tb,Sb)+Ba)%Ba*Ha+Ia}function ca(h,O){h=N(h,true);if(O<xa(N(h),La))return 0;if(O>=xa(N(h),bb))return V.height(); -h=i("slotMinutes");O=O.getHours()*60+O.getMinutes()-La;var x=Math.floor(O/h),A=ub[x];if(A===ma)A=ub[x]=V.find("tr:eq("+x+") td div")[0].offsetTop;return Math.max(0,Math.round(A-1+Xa*(O%h/h)))}function ka(){return{left:Ma,right:Ga-vb}}function qa(){return $}function G(h){var O=N(h.start);if(h.allDay)return O;return xa(O,i("defaultEventMinutes"))}function p(h,O){if(O)return N(h);return xa(N(h),i("slotMinutes"))}function L(h,O,x){if(x)i("allDaySlot")&&oa(h,ba(N(O),1),true);else c(h,O)}function c(h,O){var x= -i("selectHelper");Na.build();if(x){var A=Ca(h,K.visStart)*Ha+Ia;if(A>=0&&A<Ba){A=Na.rect(0,A,0,A,I);var ta=ca(h,h),za=ca(h,O);if(za>ta){A.top=ta;A.height=za-ta;A.left+=2;A.width-=5;if(m.isFunction(x)){if(h=x(h,O)){A.position="absolute";A.zIndex=8;wa=m(h).css(A).appendTo(I)}}else{A.isStart=true;A.isEnd=true;wa=m(o({title:"",start:h,end:O,className:["fc-select-helper"],editable:false},A));wa.css("opacity",i("dragOpacity"))}if(wa){u(wa);I.append(wa);Va(wa,A.width,true);Eb(wa,A.height,true)}}}}else ra(h, -O)}function z(){B();if(wa){wa.remove();wa=null}}function H(h){if(h.which==1&&i("selectable")){Y(h);var O;Ra.start(function(x,A){z();if(x&&x.col==A.col&&!pa(x)){A=na(A);x=na(x);O=[A,xa(N(A),i("slotMinutes")),x,xa(N(x),i("slotMinutes"))].sort(Gb);c(O[0],O[3])}else O=null},h);m(document).one("mouseup",function(x){Ra.stop();if(O){+O[0]==+O[1]&&T(O[0],false,x);n(O[0],O[3],false,x)}})}}function T(h,O,x){C("dayClick",M[U(h.getDay())],h,O,x)}function X(h,O){Ra.start(function(x){B();if(x)if(pa(x))ga(x.row, -x.col,x.row,x.col);else{x=na(x);var A=xa(N(x),i("defaultEventMinutes"));ra(x,A)}},O)}function ya(h,O,x){var A=Ra.stop();B();A&&C("drop",h,na(A),pa(A),O,x)}var K=this;K.renderAgenda=d;K.setWidth=t;K.setHeight=j;K.beforeHide=S;K.afterShow=Q;K.defaultEventEnd=G;K.timePosition=ca;K.dayOfWeekCol=U;K.dateCell=da;K.cellDate=na;K.cellIsAllDay=pa;K.allDayRow=qa;K.allDayBounds=ka;K.getHoverListener=function(){return Ra};K.colContentLeft=sa;K.colContentRight=ha;K.getDaySegmentContainer=function(){return ia}; -K.getSlotSegmentContainer=function(){return R};K.getMinMinute=function(){return La};K.getMaxMinute=function(){return bb};K.getBodyContent=function(){return I};K.getRowCnt=function(){return 1};K.getColCnt=function(){return Ba};K.getColWidth=function(){return db};K.getSlotHeight=function(){return Xa};K.defaultSelectionEnd=p;K.renderDayOverlay=oa;K.renderSelection=L;K.clearSelection=z;K.reportDayClick=T;K.dragStart=X;K.dragStop=ya;Kb.call(K,a,b,e);Lb.call(K);Mb.call(K);sc.call(K);var i=K.opt,C=K.trigger, -P=K.clearEvents,E=K.renderOverlay,B=K.clearOverlays,n=K.reportSelection,Y=K.unselect,W=K.daySelectionMousedown,o=K.slotSegHtml,s=b.formatDate,v,F,r,J,M,k,D,Z,ja,ia,la,$,w,I,R,V,ea,aa,va,wa,Ga,Wb,Ma,db,vb,Xa,Xb,Ba,tb,Na,Ra,cb,ub={},Wa,Tb,Sb,Ub,Ha,Ia,La,bb,Vb;qb(a.addClass("fc-agenda"));Na=new Nb(function(h,O){function x(eb){return Math.max(Ea,Math.min(tc,eb))}var A,ta,za;r.each(function(eb,uc){A=m(uc);ta=A.offset().left;if(eb)za[1]=ta;za=[ta];O[eb]=za});za[1]=ta+A.outerWidth();if(i("allDaySlot")){A= -$;ta=A.offset().top;h[0]=[ta,ta+A.outerHeight()]}for(var Da=I.offset().top,Ea=w.offset().top,tc=Ea+w.outerHeight(),fb=0;fb<tb;fb++)h.push([x(Da+Xa*fb),x(Da+Xa*(fb+1))])});Ra=new Ob(Na);cb=new Pb(function(h){return k.eq(h)})}function sc(){function a(o,s){sa(o);var v,F=o.length,r=[],J=[];for(v=0;v<F;v++)o[v].allDay?r.push(o[v]):J.push(o[v]);if(u("allDaySlot")){L(e(r),s);na()}g(d(J),s)}function b(){ha();ua().empty();pa().empty()}function e(o){o=ob(nb(o,m.map(o,Ua),q.visStart,q.visEnd));var s,v=o.length, -F,r,J,M=[];for(s=0;s<v;s++){F=o[s];for(r=0;r<F.length;r++){J=F[r];J.row=0;J.level=s;M.push(J)}}return M}function d(o){var s=z(),v=ka(),F=ca(),r=xa(N(q.visStart),v),J=m.map(o,f),M,k,D,Z,ja,ia,la=[];for(M=0;M<s;M++){k=ob(nb(o,J,r,xa(N(r),F-v)));vc(k);for(D=0;D<k.length;D++){Z=k[D];for(ja=0;ja<Z.length;ja++){ia=Z[ja];ia.col=M;ia.level=D;la.push(ia)}}ba(r,1,true)}return la}function f(o){return o.end?N(o.end):xa(N(o.start),u("defaultEventMinutes"))}function g(o,s){var v,F=o.length,r,J,M,k,D,Z,ja,ia,la, -$="",w,I,R={},V={},ea=pa(),aa;v=z();if(w=u("isRTL")){I=-1;aa=v-1}else{I=1;aa=0}for(v=0;v<F;v++){r=o[v];J=r.event;M=qa(r.start,r.start);k=qa(r.start,r.end);D=r.col;Z=r.level;ja=r.forward||0;ia=G(D*I+aa);la=p(D*I+aa)-ia;la=Math.min(la-6,la*0.95);D=Z?la/(Z+ja+1):ja?(la/(ja+1)-6)*2:la;Z=ia+la/(Z+ja+1)*Z*I+(w?la-D:0);r.top=M;r.left=Z;r.outerWidth=D;r.outerHeight=k-M;$+=l(J,r)}ea[0].innerHTML=$;w=ea.children();for(v=0;v<F;v++){r=o[v];J=r.event;$=m(w[v]);I=fa("eventRender",J,J,$);if(I===false)$.remove(); -else{if(I&&I!==true){$.remove();$=m(I).css({position:"absolute",top:r.top,left:r.left}).appendTo(ea)}r.element=$;if(J._id===s)t(J,$,r);else $[0]._fci=v;ya(J,$)}}Db(ea,o,t);for(v=0;v<F;v++){r=o[v];if($=r.element){J=R[s=r.key=Ib($[0])];r.vsides=J===ma?(R[s]=Sa($,true)):J;J=V[s];r.hsides=J===ma?(V[s]=pb($,true)):J;s=$.find("div.fc-event-content");if(s.length)r.contentTop=s[0].offsetTop}}for(v=0;v<F;v++){r=o[v];if($=r.element){$[0].style.width=Math.max(0,r.outerWidth-r.hsides)+"px";R=Math.max(0,r.outerHeight- -r.vsides);$[0].style.height=R+"px";J=r.event;if(r.contentTop!==ma&&R-r.contentTop<10){$.find("div.fc-event-time").text(Y(J.start,u("timeFormat"))+" - "+J.title);$.find("div.fc-event-title").remove()}fa("eventAfterRender",J,J,$)}}}function l(o,s){var v="<",F=o.url,r=Jb(o,u),J=r?" style='"+r+"'":"",M=["fc-event","fc-event-skin","fc-event-vert"];oa(o)&&M.push("fc-event-draggable");s.isStart&&M.push("fc-corner-top");s.isEnd&&M.push("fc-corner-bottom");M=M.concat(o.className);if(o.source)M=M.concat(o.source.className|| -[]);v+=F?"a href='"+Qa(o.url)+"'":"div";v+=" class='"+M.join(" ")+"' style='position:absolute;z-index:8;top:"+s.top+"px;left:"+s.left+"px;"+r+"'><div class='fc-event-inner fc-event-skin'"+J+"><div class='fc-event-head fc-event-skin'"+J+"><div class='fc-event-time'>"+Qa(W(o.start,o.end,u("timeFormat")))+"</div></div><div class='fc-event-content'><div class='fc-event-title'>"+Qa(o.title)+"</div></div><div class='fc-event-bg'></div></div>";if(s.isEnd&&ga(o))v+="<div class='ui-resizable-handle ui-resizable-s'>=</div>"; -v+="</"+(F?"a":"div")+">";return v}function j(o,s,v){oa(o)&&y(o,s,v.isStart);v.isEnd&&ga(o)&&c(o,s,v);da(o,s)}function t(o,s,v){var F=s.find("div.fc-event-time");oa(o)&&S(o,s,F);v.isEnd&&ga(o)&&Q(o,s,F);da(o,s)}function y(o,s,v){function F(){if(!M){s.width(r).height("").draggable("option","grid",null);M=true}}var r,J,M=true,k,D=u("isRTL")?-1:1,Z=U(),ja=H(),ia=T(),la=ka();s.draggable({zIndex:9,opacity:u("dragOpacity","month"),revertDuration:u("dragRevertDuration"),start:function($,w){fa("eventDragStart", -s,o,$,w);i(o,s);r=s.width();Z.start(function(I,R,V,ea){B();if(I){J=false;k=ea*D;if(I.row)if(v){if(M){s.width(ja-10);Eb(s,ia*Math.round((o.end?(o.end-o.start)/wc:u("defaultEventMinutes"))/u("slotMinutes")));s.draggable("option","grid",[ja,1]);M=false}}else J=true;else{E(ba(N(o.start),k),ba(Ua(o),k));F()}J=J||M&&!k}else{F();J=true}s.draggable("option","revert",J)},$,"drag")},stop:function($,w){Z.stop();B();fa("eventDragStop",s,o,$,w);if(J){F();s.css("filter","");K(o,s)}else{var I=0;M||(I=Math.round((s.offset().top- -X().offset().top)/ia)*u("slotMinutes")+la-(o.start.getHours()*60+o.start.getMinutes()));C(this,o,k,I,M,$,w)}}})}function S(o,s,v){function F(I){var R=xa(N(o.start),I),V;if(o.end)V=xa(N(o.end),I);v.text(W(R,V,u("timeFormat")))}function r(){if(M){v.css("display","");s.draggable("option","grid",[$,w]);M=false}}var J,M=false,k,D,Z,ja=u("isRTL")?-1:1,ia=U(),la=z(),$=H(),w=T();s.draggable({zIndex:9,scroll:false,grid:[$,w],axis:la==1?"y":false,opacity:u("dragOpacity"),revertDuration:u("dragRevertDuration"), -start:function(I,R){fa("eventDragStart",s,o,I,R);i(o,s);J=s.position();D=Z=0;ia.start(function(V,ea,aa,va){s.draggable("option","revert",!V);B();if(V){k=va*ja;if(u("allDaySlot")&&!V.row){if(!M){M=true;v.hide();s.draggable("option","grid",null)}E(ba(N(o.start),k),ba(Ua(o),k))}else r()}},I,"drag")},drag:function(I,R){D=Math.round((R.position.top-J.top)/w)*u("slotMinutes");if(D!=Z){M||F(D);Z=D}},stop:function(I,R){var V=ia.stop();B();fa("eventDragStop",s,o,I,R);if(V&&(k||D||M))C(this,o,k,M?0:D,M,I,R); -else{r();s.css("filter","");s.css(J);F(0);K(o,s)}}})}function Q(o,s,v){var F,r,J=T();s.resizable({handles:{s:"div.ui-resizable-s"},grid:J,start:function(M,k){F=r=0;i(o,s);s.css("z-index",9);fa("eventResizeStart",this,o,M,k)},resize:function(M,k){F=Math.round((Math.max(J,s.height())-k.originalSize.height)/J);if(F!=r){v.text(W(o.start,!F&&!o.end?null:xa(ra(o),u("slotMinutes")*F),u("timeFormat")));r=F}},stop:function(M,k){fa("eventResizeStop",this,o,M,k);if(F)P(this,o,0,u("slotMinutes")*F,M,k);else{s.css("z-index", -8);K(o,s)}}})}var q=this;q.renderEvents=a;q.compileDaySegs=e;q.clearEvents=b;q.slotSegHtml=l;q.bindDaySeg=j;Qb.call(q);var u=q.opt,fa=q.trigger,oa=q.isEventDraggable,ga=q.isEventResizable,ra=q.eventEnd,sa=q.reportEvents,ha=q.reportEventClear,da=q.eventElementHandlers,na=q.setHeight,ua=q.getDaySegmentContainer,pa=q.getSlotSegmentContainer,U=q.getHoverListener,ca=q.getMaxMinute,ka=q.getMinMinute,qa=q.timePosition,G=q.colContentLeft,p=q.colContentRight,L=q.renderDaySegs,c=q.resizableDayEvent,z=q.getColCnt, -H=q.getColWidth,T=q.getSlotHeight,X=q.getBodyContent,ya=q.reportEventElement,K=q.showEvents,i=q.hideEvents,C=q.eventDrop,P=q.eventResize,E=q.renderDayOverlay,B=q.clearOverlays,n=q.calendar,Y=n.formatDate,W=n.formatDates}function vc(a){var b,e,d,f,g,l;for(b=a.length-1;b>0;b--){f=a[b];for(e=0;e<f.length;e++){g=f[e];for(d=0;d<a[b-1].length;d++){l=a[b-1][d];if(Cb(g,l))l.forward=Math.max(l.forward||0,(g.forward||0)+1)}}}}function Kb(a,b,e){function d(G,p){G=qa[G];if(typeof G=="object")return jb(G,p||e); -return G}function f(G,p){return b.trigger.apply(b,[G,p||da].concat(Array.prototype.slice.call(arguments,2),[da]))}function g(G){return j(G)&&!d("disableDragging")}function l(G){return j(G)&&!d("disableResizing")}function j(G){return Ta(G.editable,(G.source||{}).editable,d("editable"))}function t(G){U={};var p,L=G.length,c;for(p=0;p<L;p++){c=G[p];if(U[c._id])U[c._id].push(c);else U[c._id]=[c]}}function y(G){return G.end?N(G.end):na(G)}function S(G,p){ca.push(p);if(ka[G._id])ka[G._id].push(p);else ka[G._id]= -[p]}function Q(){ca=[];ka={}}function q(G,p){p.click(function(L){if(!p.hasClass("ui-draggable-dragging")&&!p.hasClass("ui-resizable-resizing"))return f("eventClick",this,G,L)}).hover(function(L){f("eventMouseover",this,G,L)},function(L){f("eventMouseout",this,G,L)})}function u(G,p){oa(G,p,"show")}function fa(G,p){oa(G,p,"hide")}function oa(G,p,L){G=ka[G._id];var c,z=G.length;for(c=0;c<z;c++)if(!p||G[c][0]!=p[0])G[c][L]()}function ga(G,p,L,c,z,H,T){var X=p.allDay,ya=p._id;sa(U[ya],L,c,z);f("eventDrop", -G,p,L,c,z,function(){sa(U[ya],-L,-c,X);pa(ya)},H,T);pa(ya)}function ra(G,p,L,c,z,H){var T=p._id;ha(U[T],L,c);f("eventResize",G,p,L,c,function(){ha(U[T],-L,-c);pa(T)},z,H);pa(T)}function sa(G,p,L,c){L=L||0;for(var z,H=G.length,T=0;T<H;T++){z=G[T];if(c!==ma)z.allDay=c;xa(ba(z.start,p,true),L);if(z.end)z.end=xa(ba(z.end,p,true),L);ua(z,qa)}}function ha(G,p,L){L=L||0;for(var c,z=G.length,H=0;H<z;H++){c=G[H];c.end=xa(ba(y(c),p,true),L);ua(c,qa)}}var da=this;da.element=a;da.calendar=b;da.name=e;da.opt= -d;da.trigger=f;da.isEventDraggable=g;da.isEventResizable=l;da.reportEvents=t;da.eventEnd=y;da.reportEventElement=S;da.reportEventClear=Q;da.eventElementHandlers=q;da.showEvents=u;da.hideEvents=fa;da.eventDrop=ga;da.eventResize=ra;var na=da.defaultEventEnd,ua=b.normalizeEvent,pa=b.reportEventChange,U={},ca=[],ka={},qa=b.options}function Qb(){function a(i,C){var P=z(),E=pa(),B=U(),n=0,Y,W,o=i.length,s,v;P[0].innerHTML=e(i);d(i,P.children());f(i);g(i,P,C);l(i);j(i);t(i);C=y();for(P=0;P<E;P++){Y=[];for(W= -0;W<B;W++)Y[W]=0;for(;n<o&&(s=i[n]).row==P;){W=Hb(Y.slice(s.startCol,s.endCol));s.top=W;W+=s.outerHeight;for(v=s.startCol;v<s.endCol;v++)Y[v]=W;n++}C[P].height(Hb(Y))}Q(i,S(C))}function b(i,C,P){var E=m("<div/>"),B=z(),n=i.length,Y;E[0].innerHTML=e(i);E=E.children();B.append(E);d(i,E);l(i);j(i);t(i);Q(i,S(y()));E=[];for(B=0;B<n;B++)if(Y=i[B].element){i[B].row===C&&Y.css("top",P);E.push(Y[0])}return m(E)}function e(i){var C=fa("isRTL"),P,E=i.length,B,n,Y,W;P=ka();var o=P.left,s=P.right,v,F,r,J,M,k= -"";for(P=0;P<E;P++){B=i[P];n=B.event;W=["fc-event","fc-event-skin","fc-event-hori"];ga(n)&&W.push("fc-event-draggable");if(C){B.isStart&&W.push("fc-corner-right");B.isEnd&&W.push("fc-corner-left");v=p(B.end.getDay()-1);F=p(B.start.getDay());r=B.isEnd?qa(v):o;J=B.isStart?G(F):s}else{B.isStart&&W.push("fc-corner-left");B.isEnd&&W.push("fc-corner-right");v=p(B.start.getDay());F=p(B.end.getDay()-1);r=B.isStart?qa(v):o;J=B.isEnd?G(F):s}W=W.concat(n.className);if(n.source)W=W.concat(n.source.className|| -[]);Y=n.url;M=Jb(n,fa);k+=Y?"<a href='"+Qa(Y)+"'":"<div";k+=" class='"+W.join(" ")+"' style='position:absolute;z-index:8;left:"+r+"px;"+M+"'><div class='fc-event-inner fc-event-skin'"+(M?" style='"+M+"'":"")+">";if(!n.allDay&&B.isStart)k+="<span class='fc-event-time'>"+Qa(T(n.start,n.end,fa("timeFormat")))+"</span>";k+="<span class='fc-event-title'>"+Qa(n.title)+"</span></div>";if(B.isEnd&&ra(n))k+="<div class='ui-resizable-handle ui-resizable-"+(C?"w":"e")+"'> </div>";k+="</"+(Y? -"a":"div")+">";B.left=r;B.outerWidth=J-r;B.startCol=v;B.endCol=F+1}return k}function d(i,C){var P,E=i.length,B,n,Y;for(P=0;P<E;P++){B=i[P];n=B.event;Y=m(C[P]);n=oa("eventRender",n,n,Y);if(n===false)Y.remove();else{if(n&&n!==true){n=m(n).css({position:"absolute",left:B.left});Y.replaceWith(n);Y=n}B.element=Y}}}function f(i){var C,P=i.length,E,B;for(C=0;C<P;C++){E=i[C];(B=E.element)&&ha(E.event,B)}}function g(i,C,P){var E,B=i.length,n,Y,W;for(E=0;E<B;E++){n=i[E];if(Y=n.element){W=n.event;if(W._id=== -P)H(W,Y,n);else Y[0]._fci=E}}Db(C,i,H)}function l(i){var C,P=i.length,E,B,n,Y,W={};for(C=0;C<P;C++){E=i[C];if(B=E.element){n=E.key=Ib(B[0]);Y=W[n];if(Y===ma)Y=W[n]=pb(B,true);E.hsides=Y}}}function j(i){var C,P=i.length,E,B;for(C=0;C<P;C++){E=i[C];if(B=E.element)B[0].style.width=Math.max(0,E.outerWidth-E.hsides)+"px"}}function t(i){var C,P=i.length,E,B,n,Y,W={};for(C=0;C<P;C++){E=i[C];if(B=E.element){n=E.key;Y=W[n];if(Y===ma)Y=W[n]=Fb(B);E.outerHeight=B[0].offsetHeight+Y}}}function y(){var i,C=pa(), -P=[];for(i=0;i<C;i++)P[i]=ca(i).find("td:first div.fc-day-content > div");return P}function S(i){var C,P=i.length,E=[];for(C=0;C<P;C++)E[C]=i[C][0].offsetTop;return E}function Q(i,C){var P,E=i.length,B,n;for(P=0;P<E;P++){B=i[P];if(n=B.element){n[0].style.top=C[B.row]+(B.top||0)+"px";B=B.event;oa("eventAfterRender",B,B,n)}}}function q(i,C,P){var E=fa("isRTL"),B=E?"w":"e",n=C.find("div.ui-resizable-"+B),Y=false;qb(C);C.mousedown(function(W){W.preventDefault()}).click(function(W){if(Y){W.preventDefault(); -W.stopImmediatePropagation()}});n.mousedown(function(W){function o(ia){oa("eventResizeStop",this,i,ia);m("body").css("cursor","");s.stop();ya();k&&ua(this,i,k,0,ia);setTimeout(function(){Y=false},0)}if(W.which==1){Y=true;var s=u.getHoverListener(),v=pa(),F=U(),r=E?-1:1,J=E?F-1:0,M=C.css("top"),k,D,Z=m.extend({},i),ja=L(i.start);K();m("body").css("cursor",B+"-resize").one("mouseup",o);oa("eventResizeStart",this,i,W);s.start(function(ia,la){if(ia){var $=Math.max(ja.row,ia.row);ia=ia.col;if(v==1)$=0; -if($==ja.row)ia=E?Math.min(ja.col,ia):Math.max(ja.col,ia);k=$*7+ia*r+J-(la.row*7+la.col*r+J);la=ba(sa(i),k,true);if(k){Z.end=la;$=D;D=b(c([Z]),P.row,M);D.find("*").css("cursor",B+"-resize");$&&$.remove();na(i)}else if(D){da(i);D.remove();D=null}ya();X(i.start,ba(N(la),1))}},W)}})}var u=this;u.renderDaySegs=a;u.resizableDayEvent=q;var fa=u.opt,oa=u.trigger,ga=u.isEventDraggable,ra=u.isEventResizable,sa=u.eventEnd,ha=u.reportEventElement,da=u.showEvents,na=u.hideEvents,ua=u.eventResize,pa=u.getRowCnt, -U=u.getColCnt,ca=u.allDayRow,ka=u.allDayBounds,qa=u.colContentLeft,G=u.colContentRight,p=u.dayOfWeekCol,L=u.dateCell,c=u.compileDaySegs,z=u.getDaySegmentContainer,H=u.bindDaySeg,T=u.calendar.formatDates,X=u.renderDayOverlay,ya=u.clearOverlays,K=u.clearSelection}function Mb(){function a(Q,q,u){b();q||(q=j(Q,u));t(Q,q,u);e(Q,q,u)}function b(Q){if(S){S=false;y();l("unselect",null,Q)}}function e(Q,q,u,fa){S=true;l("select",null,Q,q,u,fa)}function d(Q){var q=f.cellDate,u=f.cellIsAllDay,fa=f.getHoverListener(), -oa=f.reportDayClick;if(Q.which==1&&g("selectable")){b(Q);var ga;fa.start(function(ra,sa){y();if(ra&&u(ra)){ga=[q(sa),q(ra)].sort(Gb);t(ga[0],ga[1],true)}else ga=null},Q);m(document).one("mouseup",function(ra){fa.stop();if(ga){+ga[0]==+ga[1]&&oa(ga[0],true,ra);e(ga[0],ga[1],true,ra)}})}}var f=this;f.select=a;f.unselect=b;f.reportSelection=e;f.daySelectionMousedown=d;var g=f.opt,l=f.trigger,j=f.defaultSelectionEnd,t=f.renderSelection,y=f.clearSelection,S=false;g("selectable")&&g("unselectAuto")&&m(document).mousedown(function(Q){var q= -g("unselectCancel");if(q)if(m(Q.target).parents(q).length)return;b(Q)})}function Lb(){function a(g,l){var j=f.shift();j||(j=m("<div class='fc-cell-overlay' style='position:absolute;z-index:3'/>"));j[0].parentNode!=l[0]&&j.appendTo(l);d.push(j.css(g).show());return j}function b(){for(var g;g=d.shift();)f.push(g.hide().unbind())}var e=this;e.renderOverlay=a;e.clearOverlays=b;var d=[],f=[]}function Nb(a){var b=this,e,d;b.build=function(){e=[];d=[];a(e,d)};b.cell=function(f,g){var l=e.length,j=d.length, -t,y=-1,S=-1;for(t=0;t<l;t++)if(g>=e[t][0]&&g<e[t][1]){y=t;break}for(t=0;t<j;t++)if(f>=d[t][0]&&f<d[t][1]){S=t;break}return y>=0&&S>=0?{row:y,col:S}:null};b.rect=function(f,g,l,j,t){t=t.offset();return{top:e[f][0]-t.top,left:d[g][0]-t.left,width:d[j][1]-d[g][0],height:e[l][1]-e[f][0]}}}function Ob(a){function b(j){xc(j);j=a.cell(j.pageX,j.pageY);if(!j!=!l||j&&(j.row!=l.row||j.col!=l.col)){if(j){g||(g=j);f(j,g,j.row-g.row,j.col-g.col)}else f(j,g);l=j}}var e=this,d,f,g,l;e.start=function(j,t,y){f=j; -g=l=null;a.build();b(t);d=y||"mousemove";m(document).bind(d,b)};e.stop=function(){m(document).unbind(d,b);return l}}function xc(a){if(a.pageX===ma){a.pageX=a.originalEvent.pageX;a.pageY=a.originalEvent.pageY}}function Pb(a){function b(l){return d[l]=d[l]||a(l)}var e=this,d={},f={},g={};e.left=function(l){return f[l]=f[l]===ma?b(l).position().left:f[l]};e.right=function(l){return g[l]=g[l]===ma?e.left(l)+b(l).width():g[l]};e.clear=function(){d={};f={};g={}}}var Ya={defaultView:"month",aspectRatio:1.35, -header:{left:"title",center:"",right:"today prev,next"},weekends:true,allDayDefault:true,ignoreTimezone:true,lazyFetching:true,startParam:"start",endParam:"end",titleFormat:{month:"MMMM yyyy",week:"MMM d[ yyyy]{ '—'[ MMM] d yyyy}",day:"dddd, MMM d, yyyy"},columnFormat:{month:"ddd",week:"ddd M/d",day:"dddd M/d"},timeFormat:{"":"h(:mm)t"},isRTL:false,firstDay:0,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan", -"Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],buttonText:{prev:" ◄ ",next:" ► ",prevYear:" << ",nextYear:" >> ",today:"today",month:"month",week:"week",day:"day"},theme:false,buttonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e"},unselectAuto:true,dropAccept:"*"},yc= -{header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:" ► ",next:" ◄ ",prevYear:" >> ",nextYear:" << "},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},Aa=m.fullCalendar={version:"1.5.3"},Ja=Aa.views={};m.fn.fullCalendar=function(a){if(typeof a=="string"){var b=Array.prototype.slice.call(arguments,1),e;this.each(function(){var f=m.data(this,"fullCalendar");if(f&&m.isFunction(f[a])){f=f[a].apply(f, -b);if(e===ma)e=f;a=="destroy"&&m.removeData(this,"fullCalendar")}});if(e!==ma)return e;return this}var d=a.eventSources||[];delete a.eventSources;if(a.events){d.push(a.events);delete a.events}a=m.extend(true,{},Ya,a.isRTL||a.isRTL===ma&&Ya.isRTL?yc:{},a);this.each(function(f,g){f=m(g);g=new Yb(f,a,d);f.data("fullCalendar",g);g.render()});return this};Aa.sourceNormalizers=[];Aa.sourceFetchers=[];var ac={dataType:"json",cache:false},bc=1;Aa.addDays=ba;Aa.cloneDate=N;Aa.parseDate=kb;Aa.parseISO8601= -Bb;Aa.parseTime=mb;Aa.formatDate=Oa;Aa.formatDates=ib;var lc=["sun","mon","tue","wed","thu","fri","sat"],Ab=864E5,cc=36E5,wc=6E4,dc={s:function(a){return a.getSeconds()},ss:function(a){return Pa(a.getSeconds())},m:function(a){return a.getMinutes()},mm:function(a){return Pa(a.getMinutes())},h:function(a){return a.getHours()%12||12},hh:function(a){return Pa(a.getHours()%12||12)},H:function(a){return a.getHours()},HH:function(a){return Pa(a.getHours())},d:function(a){return a.getDate()},dd:function(a){return Pa(a.getDate())}, -ddd:function(a,b){return b.dayNamesShort[a.getDay()]},dddd:function(a,b){return b.dayNames[a.getDay()]},M:function(a){return a.getMonth()+1},MM:function(a){return Pa(a.getMonth()+1)},MMM:function(a,b){return b.monthNamesShort[a.getMonth()]},MMMM:function(a,b){return b.monthNames[a.getMonth()]},yy:function(a){return(a.getFullYear()+"").substring(2)},yyyy:function(a){return a.getFullYear()},t:function(a){return a.getHours()<12?"a":"p"},tt:function(a){return a.getHours()<12?"am":"pm"},T:function(a){return a.getHours()< -12?"A":"P"},TT:function(a){return a.getHours()<12?"AM":"PM"},u:function(a){return Oa(a,"yyyy-MM-dd'T'HH:mm:ss'Z'")},S:function(a){a=a.getDate();if(a>10&&a<20)return"th";return["st","nd","rd"][a%10-1]||"th"}};Aa.applyAll=$a;Ja.month=mc;Ja.basicWeek=nc;Ja.basicDay=oc;wb({weekMode:"fixed"});Ja.agendaWeek=qc;Ja.agendaDay=rc;wb({allDaySlot:true,allDayText:"all-day",firstHour:6,slotMinutes:30,defaultEventMinutes:120,axisFormat:"h(:mm)tt",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:0.5},minTime:0, -maxTime:24})})(jQuery); diff --git a/views/default/js/event_calendar/fullcalendar.php b/views/default/js/event_calendar/fullcalendar.php deleted file mode 100644 index d0321f64b..000000000 --- a/views/default/js/event_calendar/fullcalendar.php +++ /dev/null @@ -1,5227 +0,0 @@ -//<script> -/** - * @preserve - * FullCalendar v1.5.3 - * http://arshaw.com/fullcalendar/ - * - * Use fullcalendar.css for basic styling. - * For event drag & drop, requires jQuery UI draggable. - * For event resizing, requires jQuery UI resizable. - * - * Copyright (c) 2011 Adam Shaw - * Dual licensed under the MIT and GPL licenses, located in - * MIT-LICENSE.txt and GPL-LICENSE.txt respectively. - * - * Date: Mon Feb 6 22:40:40 2012 -0800 - * - */ - -(function($, undefined) { - - -var defaults = { - - // display - defaultView: 'month', - aspectRatio: 1.35, - header: { - left: 'title', - center: '', - right: 'today prev,next' - }, - weekends: true, - - // editing - //editable: false, - //disableDragging: false, - //disableResizing: false, - - allDayDefault: true, - ignoreTimezone: true, - - // event ajax - lazyFetching: true, - startParam: 'start', - endParam: 'end', - - // time formats - titleFormat: { - month: 'MMMM yyyy', - week: "MMM d[ yyyy]{ '—'[ MMM] d yyyy}", - day: 'dddd, MMM d, yyyy' - }, - columnFormat: { - month: 'ddd', - week: 'ddd M/d', - day: 'dddd M/d' - }, - timeFormat: { // for event elements - '': 'h(:mm)t' // default - }, - - // locale - isRTL: false, - firstDay: 0, - monthNames: ['January','February','March','April','May','June','July','August','September','October','November','December'], - monthNamesShort: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'], - dayNames: ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'], - dayNamesShort: ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'], - buttonText: { - prev: ' ◄ ', - next: ' ► ', - prevYear: ' << ', - nextYear: ' >> ', - today: 'today', - month: 'month', - week: 'week', - day: 'day' - }, - - // jquery-ui theming - theme: false, - buttonIcons: { - prev: 'circle-triangle-w', - next: 'circle-triangle-e' - }, - - //selectable: false, - unselectAuto: true, - - dropAccept: '*' - -}; - -// right-to-left defaults -var rtlDefaults = { - header: { - left: 'next,prev today', - center: '', - right: 'title' - }, - buttonText: { - prev: ' ► ', - next: ' ◄ ', - prevYear: ' >> ', - nextYear: ' << ' - }, - buttonIcons: { - prev: 'circle-triangle-e', - next: 'circle-triangle-w' - } -}; - - - -var fc = $.fullCalendar = { version: "1.5.3" }; -var fcViews = fc.views = {}; - - -$.fn.fullCalendar = function(options) { - - - // method calling - if (typeof options == 'string') { - var args = Array.prototype.slice.call(arguments, 1); - var res; - this.each(function() { - var calendar = $.data(this, 'fullCalendar'); - if (calendar && $.isFunction(calendar[options])) { - var r = calendar[options].apply(calendar, args); - if (res === undefined) { - res = r; - } - if (options == 'destroy') { - $.removeData(this, 'fullCalendar'); - } - } - }); - if (res !== undefined) { - return res; - } - return this; - } - - - // would like to have this logic in EventManager, but needs to happen before options are recursively extended - var eventSources = options.eventSources || []; - delete options.eventSources; - if (options.events) { - eventSources.push(options.events); - delete options.events; - } - - - options = $.extend(true, {}, - defaults, - (options.isRTL || options.isRTL===undefined && defaults.isRTL) ? rtlDefaults : {}, - options - ); - - - this.each(function(i, _element) { - var element = $(_element); - var calendar = new Calendar(element, options, eventSources); - element.data('fullCalendar', calendar); // TODO: look into memory leak implications - calendar.render(); - }); - - - return this; - -}; - - -// function for adding/overriding defaults -function setDefaults(d) { - $.extend(true, defaults, d); -} - - - - -function Calendar(element, options, eventSources) { - var t = this; - - - // exports - t.options = options; - t.render = render; - t.destroy = destroy; - t.refetchEvents = refetchEvents; - t.reportEvents = reportEvents; - t.reportEventChange = reportEventChange; - t.rerenderEvents = rerenderEvents; - t.changeView = changeView; - t.select = select; - t.unselect = unselect; - t.prev = prev; - t.next = next; - t.prevYear = prevYear; - t.nextYear = nextYear; - t.today = today; - t.gotoDate = gotoDate; - t.incrementDate = incrementDate; - t.formatDate = function(format, date) { return formatDate(format, date, options) }; - t.formatDates = function(format, date1, date2) { return formatDates(format, date1, date2, options) }; - t.getDate = getDate; - t.getView = getView; - t.option = option; - t.trigger = trigger; - - - // imports - EventManager.call(t, options, eventSources); - var isFetchNeeded = t.isFetchNeeded; - var fetchEvents = t.fetchEvents; - - - // locals - var _element = element[0]; - var header; - var headerElement; - var content; - var tm; // for making theme classes - var currentView; - var viewInstances = {}; - var elementOuterWidth; - var suggestedViewHeight; - var absoluteViewElement; - var resizeUID = 0; - var ignoreWindowResize = 0; - var date = new Date(); - var events = []; - var _dragElement; - - - - /* Main Rendering - -----------------------------------------------------------------------------*/ - - - setYMD(date, options.year, options.month, options.date); - - - function render(inc) { - if (!content) { - initialRender(); - }else{ - calcSize(); - markSizesDirty(); - markEventsDirty(); - renderView(inc); - } - } - - - function initialRender() { - tm = options.theme ? 'ui' : 'fc'; - element.addClass('fc'); - if (options.isRTL) { - element.addClass('fc-rtl'); - } - if (options.theme) { - element.addClass('ui-widget'); - } - content = $("<div class='fc-content' style='position:relative'/>") - .prependTo(element); - header = new Header(t, options); - headerElement = header.render(); - if (headerElement) { - element.prepend(headerElement); - } - changeView(options.defaultView); - $(window).resize(windowResize); - // needed for IE in a 0x0 iframe, b/c when it is resized, never triggers a windowResize - if (!bodyVisible()) { - lateRender(); - } - } - - - // called when we know the calendar couldn't be rendered when it was initialized, - // but we think it's ready now - function lateRender() { - setTimeout(function() { // IE7 needs this so dimensions are calculated correctly - if (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once - renderView(); - } - },0); - } - - - function destroy() { - $(window).unbind('resize', windowResize); - header.destroy(); - content.remove(); - element.removeClass('fc fc-rtl ui-widget'); - } - - - - function elementVisible() { - return _element.offsetWidth !== 0; - } - - - function bodyVisible() { - return $('body')[0].offsetWidth !== 0; - } - - - - /* View Rendering - -----------------------------------------------------------------------------*/ - - // TODO: improve view switching (still weird transition in IE, and FF has whiteout problem) - - function changeView(newViewName) { - if (!currentView || newViewName != currentView.name) { - ignoreWindowResize++; // because setMinHeight might change the height before render (and subsequently setSize) is reached - - unselect(); - - var oldView = currentView; - var newViewElement; - - if (oldView) { - (oldView.beforeHide || noop)(); // called before changing min-height. if called after, scroll state is reset (in Opera) - setMinHeight(content, content.height()); - oldView.element.hide(); - }else{ - setMinHeight(content, 1); // needs to be 1 (not 0) for IE7, or else view dimensions miscalculated - } - content.css('overflow', 'hidden'); - - currentView = viewInstances[newViewName]; - if (currentView) { - currentView.element.show(); - }else{ - currentView = viewInstances[newViewName] = new fcViews[newViewName]( - newViewElement = absoluteViewElement = - $("<div class='fc-view fc-view-" + newViewName + "' style='position:absolute'/>") - .appendTo(content), - t // the calendar object - ); - } - - if (oldView) { - header.deactivateButton(oldView.name); - } - header.activateButton(newViewName); - - renderView(); // after height has been set, will make absoluteViewElement's position=relative, then set to null - - content.css('overflow', ''); - if (oldView) { - setMinHeight(content, 1); - } - - if (!newViewElement) { - (currentView.afterShow || noop)(); // called after setting min-height/overflow, so in final scroll state (for Opera) - } - - ignoreWindowResize--; - } - } - - - - function renderView(inc) { - if (elementVisible()) { - ignoreWindowResize++; // because renderEvents might temporarily change the height before setSize is reached - - unselect(); - - if (suggestedViewHeight === undefined) { - calcSize(); - } - - var forceEventRender = false; - if (!currentView.start || inc || date < currentView.start || date >= currentView.end) { - // view must render an entire new date range (and refetch/render events) - currentView.render(date, inc || 0); // responsible for clearing events - setSize(true); - forceEventRender = true; - } - else if (currentView.sizeDirty) { - // view must resize (and rerender events) - currentView.clearEvents(); - setSize(); - forceEventRender = true; - } - else if (currentView.eventsDirty) { - currentView.clearEvents(); - forceEventRender = true; - } - currentView.sizeDirty = false; - currentView.eventsDirty = false; - updateEvents(forceEventRender); - - elementOuterWidth = element.outerWidth(); - - header.updateTitle(currentView.title); - var today = new Date(); - if (today >= currentView.start && today < currentView.end) { - header.disableButton('today'); - }else{ - header.enableButton('today'); - } - - ignoreWindowResize--; - currentView.trigger('viewDisplay', _element); - } - } - - - - /* Resizing - -----------------------------------------------------------------------------*/ - - - function updateSize() { - markSizesDirty(); - if (elementVisible()) { - calcSize(); - setSize(); - unselect(); - currentView.clearEvents(); - currentView.renderEvents(events); - currentView.sizeDirty = false; - } - } - - - function markSizesDirty() { - $.each(viewInstances, function(i, inst) { - inst.sizeDirty = true; - }); - } - - - function calcSize() { - if (options.contentHeight) { - suggestedViewHeight = options.contentHeight; - } - else if (options.height) { - suggestedViewHeight = options.height - (headerElement ? headerElement.height() : 0) - vsides(content); - } - else { - suggestedViewHeight = Math.round(content.width() / Math.max(options.aspectRatio, .5)); - } - } - - - function setSize(dateChanged) { // todo: dateChanged? - ignoreWindowResize++; - currentView.setHeight(suggestedViewHeight, dateChanged); - if (absoluteViewElement) { - absoluteViewElement.css('position', 'relative'); - absoluteViewElement = null; - } - currentView.setWidth(content.width(), dateChanged); - ignoreWindowResize--; - } - - - function windowResize() { - if (!ignoreWindowResize) { - if (currentView.start) { // view has already been rendered - var uid = ++resizeUID; - setTimeout(function() { // add a delay - if (uid == resizeUID && !ignoreWindowResize && elementVisible()) { - if (elementOuterWidth != (elementOuterWidth = element.outerWidth())) { - ignoreWindowResize++; // in case the windowResize callback changes the height - updateSize(); - currentView.trigger('windowResize', _element); - ignoreWindowResize--; - } - } - }, 200); - }else{ - // calendar must have been initialized in a 0x0 iframe that has just been resized - lateRender(); - } - } - } - - - - /* Event Fetching/Rendering - -----------------------------------------------------------------------------*/ - - - // fetches events if necessary, rerenders events if necessary (or if forced) - function updateEvents(forceRender) { - if (!options.lazyFetching || isFetchNeeded(currentView.visStart, currentView.visEnd)) { - refetchEvents(); - } - else if (forceRender) { - rerenderEvents(); - } - } - - - function refetchEvents() { - fetchEvents(currentView.visStart, currentView.visEnd); // will call reportEvents - } - - - // called when event data arrives - function reportEvents(_events) { - events = _events; - rerenderEvents(); - } - - - // called when a single event's data has been changed - function reportEventChange(eventID) { - rerenderEvents(eventID); - } - - - // attempts to rerenderEvents - function rerenderEvents(modifiedEventID) { - markEventsDirty(); - if (elementVisible()) { - currentView.clearEvents(); - currentView.renderEvents(events, modifiedEventID); - currentView.eventsDirty = false; - } - } - - - function markEventsDirty() { - $.each(viewInstances, function(i, inst) { - inst.eventsDirty = true; - }); - } - - - - /* Selection - -----------------------------------------------------------------------------*/ - - - function select(start, end, allDay) { - currentView.select(start, end, allDay===undefined ? true : allDay); - } - - - function unselect() { // safe to be called before renderView - if (currentView) { - currentView.unselect(); - } - } - - - - /* Date - -----------------------------------------------------------------------------*/ - - - function prev() { - renderView(-1); - } - - - function next() { - renderView(1); - } - - - function prevYear() { - addYears(date, -1); - renderView(); - } - - - function nextYear() { - addYears(date, 1); - renderView(); - } - - - function today() { - date = new Date(); - renderView(); - } - - - function gotoDate(year, month, dateOfMonth) { - if (year instanceof Date) { - date = cloneDate(year); // provided 1 argument, a Date - }else{ - setYMD(date, year, month, dateOfMonth); - } - renderView(); - } - - - function incrementDate(years, months, days) { - if (years !== undefined) { - addYears(date, years); - } - if (months !== undefined) { - addMonths(date, months); - } - if (days !== undefined) { - addDays(date, days); - } - renderView(); - } - - - function getDate() { - return cloneDate(date); - } - - - - /* Misc - -----------------------------------------------------------------------------*/ - - - function getView() { - return currentView; - } - - - function option(name, value) { - if (value === undefined) { - return options[name]; - } - if (name == 'height' || name == 'contentHeight' || name == 'aspectRatio') { - options[name] = value; - updateSize(); - } - } - - - function trigger(name, thisObj) { - if (options[name]) { - return options[name].apply( - thisObj || _element, - Array.prototype.slice.call(arguments, 2) - ); - } - } - - - - /* External Dragging - ------------------------------------------------------------------------*/ - - if (options.droppable) { - $(document) - .bind('dragstart', function(ev, ui) { - var _e = ev.target; - var e = $(_e); - if (!e.parents('.fc').length) { // not already inside a calendar - var accept = options.dropAccept; - if ($.isFunction(accept) ? accept.call(_e, e) : e.is(accept)) { - _dragElement = _e; - currentView.dragStart(_dragElement, ev, ui); - } - } - }) - .bind('dragstop', function(ev, ui) { - if (_dragElement) { - currentView.dragStop(_dragElement, ev, ui); - _dragElement = null; - } - }); - } - - -} - -function Header(calendar, options) { - var t = this; - - - // exports - t.render = render; - t.destroy = destroy; - t.updateTitle = updateTitle; - t.activateButton = activateButton; - t.deactivateButton = deactivateButton; - t.disableButton = disableButton; - t.enableButton = enableButton; - - - // locals - var element = $([]); - var tm; - - - - function render() { - tm = options.theme ? 'ui' : 'fc'; - var sections = options.header; - if (sections) { - element = $("<table class='fc-header' style='width:100%'/>") - .append( - $("<tr/>") - .append(renderSection('left')) - .append(renderSection('center')) - .append(renderSection('right')) - ); - return element; - } - } - - - function destroy() { - element.remove(); - } - - - function renderSection(position) { - var e = $("<td class='fc-header-" + position + "'/>"); - var buttonStr = options.header[position]; - if (buttonStr) { - $.each(buttonStr.split(' '), function(i) { - if (i > 0) { - e.append("<span class='fc-header-space'/>"); - } - var prevButton; - $.each(this.split(','), function(j, buttonName) { - if (buttonName == 'title') { - e.append("<span class='fc-header-title'><h2> </h2></span>"); - if (prevButton) { - prevButton.addClass(tm + '-corner-right'); - } - prevButton = null; - }else{ - var buttonClick; - if (calendar[buttonName]) { - buttonClick = calendar[buttonName]; // calendar method - } - else if (fcViews[buttonName]) { - buttonClick = function() { - button.removeClass(tm + '-state-hover'); // forget why - calendar.changeView(buttonName); - }; - } - if (buttonClick) { - var icon = options.theme ? smartProperty(options.buttonIcons, buttonName) : null; // why are we using smartProperty here? - var text = smartProperty(options.buttonText, buttonName); // why are we using smartProperty here? - var button = $( - "<span class='fc-button fc-button-" + buttonName + " " + tm + "-state-default'>" + - "<span class='fc-button-inner'>" + - "<span class='fc-button-content'>" + - (icon ? - "<span class='fc-icon-wrap'>" + - "<span class='ui-icon ui-icon-" + icon + "'/>" + - "</span>" : - text - ) + - "</span>" + - "<span class='fc-button-effect'><span></span></span>" + - "</span>" + - "</span>" - ); - if (button) { - button - .click(function() { - if (!button.hasClass(tm + '-state-disabled')) { - buttonClick(); - } - }) - .mousedown(function() { - button - .not('.' + tm + '-state-active') - .not('.' + tm + '-state-disabled') - .addClass(tm + '-state-down'); - }) - .mouseup(function() { - button.removeClass(tm + '-state-down'); - }) - .hover( - function() { - button - .not('.' + tm + '-state-active') - .not('.' + tm + '-state-disabled') - .addClass(tm + '-state-hover'); - }, - function() { - button - .removeClass(tm + '-state-hover') - .removeClass(tm + '-state-down'); - } - ) - .appendTo(e); - if (!prevButton) { - button.addClass(tm + '-corner-left'); - } - prevButton = button; - } - } - } - }); - if (prevButton) { - prevButton.addClass(tm + '-corner-right'); - } - }); - } - return e; - } - - - function updateTitle(html) { - element.find('h2') - .html(html); - } - - - function activateButton(buttonName) { - element.find('span.fc-button-' + buttonName) - .addClass(tm + '-state-active'); - } - - - function deactivateButton(buttonName) { - element.find('span.fc-button-' + buttonName) - .removeClass(tm + '-state-active'); - } - - - function disableButton(buttonName) { - element.find('span.fc-button-' + buttonName) - .addClass(tm + '-state-disabled'); - } - - - function enableButton(buttonName) { - element.find('span.fc-button-' + buttonName) - .removeClass(tm + '-state-disabled'); - } - - -} - -fc.sourceNormalizers = []; -fc.sourceFetchers = []; - -var ajaxDefaults = { - dataType: 'json', - cache: false -}; - -var eventGUID = 1; - - -function EventManager(options, _sources) { - var t = this; - - - // exports - t.isFetchNeeded = isFetchNeeded; - t.fetchEvents = fetchEvents; - t.addEventSource = addEventSource; - t.removeEventSource = removeEventSource; - t.updateEvent = updateEvent; - t.renderEvent = renderEvent; - t.removeEvents = removeEvents; - t.clientEvents = clientEvents; - t.normalizeEvent = normalizeEvent; - - - // imports - var trigger = t.trigger; - var getView = t.getView; - var reportEvents = t.reportEvents; - - - // locals - var stickySource = { events: [] }; - var sources = [ stickySource ]; - var rangeStart, rangeEnd; - var currentFetchID = 0; - var pendingSourceCnt = 0; - var loadingLevel = 0; - var cache = []; - - - for (var i=0; i<_sources.length; i++) { - _addEventSource(_sources[i]); - } - - - - /* Fetching - -----------------------------------------------------------------------------*/ - - - function isFetchNeeded(start, end) { - return !rangeStart || start < rangeStart || end > rangeEnd; - } - - - function fetchEvents(start, end) { - rangeStart = start; - rangeEnd = end; - cache = []; - var fetchID = ++currentFetchID; - var len = sources.length; - pendingSourceCnt = len; - for (var i=0; i<len; i++) { - fetchEventSource(sources[i], fetchID); - } - } - - - function fetchEventSource(source, fetchID) { - _fetchEventSource(source, function(events) { - if (fetchID == currentFetchID) { - if (events) { - for (var i=0; i<events.length; i++) { - events[i].source = source; - normalizeEvent(events[i]); - } - cache = cache.concat(events); - } - pendingSourceCnt--; - if (!pendingSourceCnt) { - reportEvents(cache); - } - } - }); - } - - - function _fetchEventSource(source, callback) { - var i; - var fetchers = fc.sourceFetchers; - var res; - for (i=0; i<fetchers.length; i++) { - res = fetchers[i](source, rangeStart, rangeEnd, callback); - if (res === true) { - // the fetcher is in charge. made its own async request - return; - } - else if (typeof res == 'object') { - // the fetcher returned a new source. process it - _fetchEventSource(res, callback); - return; - } - } - var events = source.events; - if (events) { - if ($.isFunction(events)) { - pushLoading(); - events(cloneDate(rangeStart), cloneDate(rangeEnd), function(events) { - callback(events); - popLoading(); - }); - } - else if ($.isArray(events)) { - callback(events); - } - else { - callback(); - } - }else{ - var url = source.url; - if (url) { - var success = source.success; - var error = source.error; - var complete = source.complete; - var data = $.extend({}, source.data || {}); - var startParam = firstDefined(source.startParam, options.startParam); - var endParam = firstDefined(source.endParam, options.endParam); - if (startParam) { - data[startParam] = Math.round(+rangeStart / 1000); - } - if (endParam) { - data[endParam] = Math.round(+rangeEnd / 1000); - } - pushLoading(); - $.ajax($.extend({}, ajaxDefaults, source, { - data: data, - success: function(events) { - events = events || []; - var res = applyAll(success, this, arguments); - if ($.isArray(res)) { - events = res; - } - callback(events); - }, - error: function() { - applyAll(error, this, arguments); - callback(); - }, - complete: function() { - applyAll(complete, this, arguments); - popLoading(); - } - })); - }else{ - callback(); - } - } - } - - - - /* Sources - -----------------------------------------------------------------------------*/ - - - function addEventSource(source) { - source = _addEventSource(source); - if (source) { - pendingSourceCnt++; - fetchEventSource(source, currentFetchID); // will eventually call reportEvents - } - } - - - function _addEventSource(source) { - if ($.isFunction(source) || $.isArray(source)) { - source = { events: source }; - } - else if (typeof source == 'string') { - source = { url: source }; - } - if (typeof source == 'object') { - normalizeSource(source); - sources.push(source); - return source; - } - } - - - function removeEventSource(source) { - sources = $.grep(sources, function(src) { - return !isSourcesEqual(src, source); - }); - // remove all client events from that source - cache = $.grep(cache, function(e) { - return !isSourcesEqual(e.source, source); - }); - reportEvents(cache); - } - - - - /* Manipulation - -----------------------------------------------------------------------------*/ - - - function updateEvent(event) { // update an existing event - var i, len = cache.length, e, - defaultEventEnd = getView().defaultEventEnd, // getView??? - startDelta = event.start - event._start, - endDelta = event.end ? - (event.end - (event._end || defaultEventEnd(event))) // event._end would be null if event.end - : 0; // was null and event was just resized - for (i=0; i<len; i++) { - e = cache[i]; - if (e._id == event._id && e != event) { - e.start = new Date(+e.start + startDelta); - if (event.end) { - if (e.end) { - e.end = new Date(+e.end + endDelta); - }else{ - e.end = new Date(+defaultEventEnd(e) + endDelta); - } - }else{ - e.end = null; - } - e.title = event.title; - e.url = event.url; - e.allDay = event.allDay; - e.className = event.className; - e.editable = event.editable; - e.color = event.color; - e.backgroudColor = event.backgroudColor; - e.borderColor = event.borderColor; - e.textColor = event.textColor; - normalizeEvent(e); - } - } - normalizeEvent(event); - reportEvents(cache); - } - - - function renderEvent(event, stick) { - normalizeEvent(event); - if (!event.source) { - if (stick) { - stickySource.events.push(event); - event.source = stickySource; - } - cache.push(event); - } - reportEvents(cache); - } - - - function removeEvents(filter) { - if (!filter) { // remove all - cache = []; - // clear all array sources - for (var i=0; i<sources.length; i++) { - if ($.isArray(sources[i].events)) { - sources[i].events = []; - } - } - }else{ - if (!$.isFunction(filter)) { // an event ID - var id = filter + ''; - filter = function(e) { - return e._id == id; - }; - } - cache = $.grep(cache, filter, true); - // remove events from array sources - for (var i=0; i<sources.length; i++) { - if ($.isArray(sources[i].events)) { - sources[i].events = $.grep(sources[i].events, filter, true); - } - } - } - reportEvents(cache); - } - - - function clientEvents(filter) { - if ($.isFunction(filter)) { - return $.grep(cache, filter); - } - else if (filter) { // an event ID - filter += ''; - return $.grep(cache, function(e) { - return e._id == filter; - }); - } - return cache; // else, return all - } - - - - /* Loading State - -----------------------------------------------------------------------------*/ - - - function pushLoading() { - if (!loadingLevel++) { - trigger('loading', null, true); - } - } - - - function popLoading() { - if (!--loadingLevel) { - trigger('loading', null, false); - } - } - - - - /* Event Normalization - -----------------------------------------------------------------------------*/ - - - function normalizeEvent(event) { - var source = event.source || {}; - var ignoreTimezone = firstDefined(source.ignoreTimezone, options.ignoreTimezone); - event._id = event._id || (event.id === undefined ? '_fc' + eventGUID++ : event.id + ''); - if (event.date) { - if (!event.start) { - event.start = event.date; - } - delete event.date; - } - event._start = cloneDate(event.start = parseDate(event.start, ignoreTimezone)); - event.end = parseDate(event.end, ignoreTimezone); - if (event.end && event.end <= event.start) { - event.end = null; - } - event._end = event.end ? cloneDate(event.end) : null; - if (event.allDay === undefined) { - event.allDay = firstDefined(source.allDayDefault, options.allDayDefault); - } - if (event.className) { - if (typeof event.className == 'string') { - event.className = event.className.split(/\s+/); - } - }else{ - event.className = []; - } - // TODO: if there is no start date, return false to indicate an invalid event - } - - - - /* Utils - ------------------------------------------------------------------------------*/ - - - function normalizeSource(source) { - if (source.className) { - // TODO: repeat code, same code for event classNames - if (typeof source.className == 'string') { - source.className = source.className.split(/\s+/); - } - }else{ - source.className = []; - } - var normalizers = fc.sourceNormalizers; - for (var i=0; i<normalizers.length; i++) { - normalizers[i](source); - } - } - - - function isSourcesEqual(source1, source2) { - return source1 && source2 && getSourcePrimitive(source1) == getSourcePrimitive(source2); - } - - - function getSourcePrimitive(source) { - return ((typeof source == 'object') ? (source.events || source.url) : '') || source; - } - - -} - - -fc.addDays = addDays; -fc.cloneDate = cloneDate; -fc.parseDate = parseDate; -fc.parseISO8601 = parseISO8601; -fc.parseTime = parseTime; -fc.formatDate = formatDate; -fc.formatDates = formatDates; - - - -/* Date Math ------------------------------------------------------------------------------*/ - -var dayIDs = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'], - DAY_MS = 86400000, - HOUR_MS = 3600000, - MINUTE_MS = 60000; - - -function addYears(d, n, keepTime) { - d.setFullYear(d.getFullYear() + n); - if (!keepTime) { - clearTime(d); - } - return d; -} - - -function addMonths(d, n, keepTime) { // prevents day overflow/underflow - if (+d) { // prevent infinite looping on invalid dates - var m = d.getMonth() + n, - check = cloneDate(d); - check.setDate(1); - check.setMonth(m); - d.setMonth(m); - if (!keepTime) { - clearTime(d); - } - while (d.getMonth() != check.getMonth()) { - d.setDate(d.getDate() + (d < check ? 1 : -1)); - } - } - return d; -} - - -function addDays(d, n, keepTime) { // deals with daylight savings - if (+d) { - var dd = d.getDate() + n, - check = cloneDate(d); - check.setHours(9); // set to middle of day - check.setDate(dd); - d.setDate(dd); - if (!keepTime) { - clearTime(d); - } - fixDate(d, check); - } - return d; -} - - -function fixDate(d, check) { // force d to be on check's YMD, for daylight savings purposes - if (+d) { // prevent infinite looping on invalid dates - while (d.getDate() != check.getDate()) { - d.setTime(+d + (d < check ? 1 : -1) * HOUR_MS); - } - } -} - - -function addMinutes(d, n) { - d.setMinutes(d.getMinutes() + n); - return d; -} - - -function clearTime(d) { - d.setHours(0); - d.setMinutes(0); - d.setSeconds(0); - d.setMilliseconds(0); - return d; -} - - -function cloneDate(d, dontKeepTime) { - if (dontKeepTime) { - return clearTime(new Date(+d)); - } - return new Date(+d); -} - - -function zeroDate() { // returns a Date with time 00:00:00 and dateOfMonth=1 - var i=0, d; - do { - d = new Date(1970, i++, 1); - } while (d.getHours()); // != 0 - return d; -} - - -function skipWeekend(date, inc, excl) { - inc = inc || 1; - while (!date.getDay() || (excl && date.getDay()==1 || !excl && date.getDay()==6)) { - addDays(date, inc); - } - return date; -} - - -function dayDiff(d1, d2) { // d1 - d2 - return Math.round((cloneDate(d1, true) - cloneDate(d2, true)) / DAY_MS); -} - - -function setYMD(date, y, m, d) { - if (y !== undefined && y != date.getFullYear()) { - date.setDate(1); - date.setMonth(0); - date.setFullYear(y); - } - if (m !== undefined && m != date.getMonth()) { - date.setDate(1); - date.setMonth(m); - } - if (d !== undefined) { - date.setDate(d); - } -} - - - -/* Date Parsing ------------------------------------------------------------------------------*/ - - -function parseDate(s, ignoreTimezone) { // ignoreTimezone defaults to true - if (typeof s == 'object') { // already a Date object - return s; - } - if (typeof s == 'number') { // a UNIX timestamp - return new Date(s * 1000); - } - if (typeof s == 'string') { - if (s.match(/^\d+(\.\d+)?$/)) { // a UNIX timestamp - return new Date(parseFloat(s) * 1000); - } - if (ignoreTimezone === undefined) { - ignoreTimezone = true; - } - return parseISO8601(s, ignoreTimezone) || (s ? new Date(s) : null); - } - // TODO: never return invalid dates (like from new Date(<string>)), return null instead - return null; -} - - -function parseISO8601(s, ignoreTimezone) { // ignoreTimezone defaults to false - // derived from http://delete.me.uk/2005/03/iso8601.html - // TODO: for a know glitch/feature, read tests/issue_206_parseDate_dst.html - var m = s.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/); - if (!m) { - return null; - } - var date = new Date(m[1], 0, 1); - if (ignoreTimezone || !m[13]) { - var check = new Date(m[1], 0, 1, 9, 0); - if (m[3]) { - date.setMonth(m[3] - 1); - check.setMonth(m[3] - 1); - } - if (m[5]) { - date.setDate(m[5]); - check.setDate(m[5]); - } - fixDate(date, check); - if (m[7]) { - date.setHours(m[7]); - } - if (m[8]) { - date.setMinutes(m[8]); - } - if (m[10]) { - date.setSeconds(m[10]); - } - if (m[12]) { - date.setMilliseconds(Number("0." + m[12]) * 1000); - } - fixDate(date, check); - }else{ - date.setUTCFullYear( - m[1], - m[3] ? m[3] - 1 : 0, - m[5] || 1 - ); - date.setUTCHours( - m[7] || 0, - m[8] || 0, - m[10] || 0, - m[12] ? Number("0." + m[12]) * 1000 : 0 - ); - if (m[14]) { - var offset = Number(m[16]) * 60 + (m[18] ? Number(m[18]) : 0); - offset *= m[15] == '-' ? 1 : -1; - date = new Date(+date + (offset * 60 * 1000)); - } - } - return date; -} - - -function parseTime(s) { // returns minutes since start of day - if (typeof s == 'number') { // an hour - return s * 60; - } - if (typeof s == 'object') { // a Date object - return s.getHours() * 60 + s.getMinutes(); - } - var m = s.match(/(\d+)(?::(\d+))?\s*(\w+)?/); - if (m) { - var h = parseInt(m[1], 10); - if (m[3]) { - h %= 12; - if (m[3].toLowerCase().charAt(0) == 'p') { - h += 12; - } - } - return h * 60 + (m[2] ? parseInt(m[2], 10) : 0); - } -} - - - -/* Date Formatting ------------------------------------------------------------------------------*/ -// TODO: use same function formatDate(date, [date2], format, [options]) - - -function formatDate(date, format, options) { - return formatDates(date, null, format, options); -} - - -function formatDates(date1, date2, format, options) { - options = options || defaults; - var date = date1, - otherDate = date2, - i, len = format.length, c, - i2, formatter, - res = ''; - for (i=0; i<len; i++) { - c = format.charAt(i); - if (c == "'") { - for (i2=i+1; i2<len; i2++) { - if (format.charAt(i2) == "'") { - if (date) { - if (i2 == i+1) { - res += "'"; - }else{ - res += format.substring(i+1, i2); - } - i = i2; - } - break; - } - } - } - else if (c == '(') { - for (i2=i+1; i2<len; i2++) { - if (format.charAt(i2) == ')') { - var subres = formatDate(date, format.substring(i+1, i2), options); - if (parseInt(subres.replace(/\D/, ''), 10)) { - res += subres; - } - i = i2; - break; - } - } - } - else if (c == '[') { - for (i2=i+1; i2<len; i2++) { - if (format.charAt(i2) == ']') { - var subformat = format.substring(i+1, i2); - var subres = formatDate(date, subformat, options); - if (subres != formatDate(otherDate, subformat, options)) { - res += subres; - } - i = i2; - break; - } - } - } - else if (c == '{') { - date = date2; - otherDate = date1; - } - else if (c == '}') { - date = date1; - otherDate = date2; - } - else { - for (i2=len; i2>i; i2--) { - if (formatter = dateFormatters[format.substring(i, i2)]) { - if (date) { - res += formatter(date, options); - } - i = i2 - 1; - break; - } - } - if (i2 == i) { - if (date) { - res += c; - } - } - } - } - return res; -}; - - -var dateFormatters = { - s : function(d) { return d.getSeconds() }, - ss : function(d) { return zeroPad(d.getSeconds()) }, - m : function(d) { return d.getMinutes() }, - mm : function(d) { return zeroPad(d.getMinutes()) }, - h : function(d) { return d.getUTCHours() % 12 || 12 }, - hh : function(d) { return zeroPad(d.getUTCHours() % 12 || 12) }, - H : function(d) { return d.getUTCHours() }, - HH : function(d) { return zeroPad(d.getUTCHours()) }, - d : function(d) { return d.getDate() }, - dd : function(d) { return zeroPad(d.getDate()) }, - ddd : function(d,o) { return o.dayNamesShort[d.getDay()] }, - dddd: function(d,o) { return o.dayNames[d.getDay()] }, - M : function(d) { return d.getMonth() + 1 }, - MM : function(d) { return zeroPad(d.getMonth() + 1) }, - MMM : function(d,o) { return o.monthNamesShort[d.getMonth()] }, - MMMM: function(d,o) { return o.monthNames[d.getMonth()] }, - yy : function(d) { return (d.getFullYear()+'').substring(2) }, - yyyy: function(d) { return d.getFullYear() }, - t : function(d) { return d.getUTCHours() < 12 ? 'a' : 'p' }, - tt : function(d) { return d.getUTCHours() < 12 ? 'am' : 'pm' }, - T : function(d) { return d.getUTCHours() < 12 ? 'A' : 'P' }, - TT : function(d) { return d.getUTCHours() < 12 ? 'AM' : 'PM' }, - u : function(d) { return formatDate(d, "yyyy-MM-dd'T'HH:mm:ss'Z'") }, - S : function(d) { - var date = d.getDate(); - if (date > 10 && date < 20) { - return 'th'; - } - return ['st', 'nd', 'rd'][date%10-1] || 'th'; - } -}; - - - -fc.applyAll = applyAll; - - -/* Event Date Math ------------------------------------------------------------------------------*/ - - -function exclEndDay(event) { - if (event.end) { - return _exclEndDay(event.end, event.allDay); - }else{ - return addDays(cloneDate(event.start), 1); - } -} - - -function _exclEndDay(end, allDay) { - end = cloneDate(end); - return allDay || end.getHours() || end.getMinutes() ? addDays(end, 1) : clearTime(end); -} - - -function segCmp(a, b) { - return (b.msLength - a.msLength) * 100 + (a.event.start - b.event.start); -} - - -function segsCollide(seg1, seg2) { - return seg1.end > seg2.start && seg1.start < seg2.end; -} - - - -/* Event Sorting ------------------------------------------------------------------------------*/ - - -// event rendering utilities -function sliceSegs(events, visEventEnds, start, end) { - var segs = [], - i, len=events.length, event, - eventStart, eventEnd, - segStart, segEnd, - isStart, isEnd; - for (i=0; i<len; i++) { - event = events[i]; - eventStart = event.start; - eventEnd = visEventEnds[i]; - if (eventEnd > start && eventStart < end) { - if (eventStart < start) { - segStart = cloneDate(start); - isStart = false; - }else{ - segStart = eventStart; - isStart = true; - } - if (eventEnd > end) { - segEnd = cloneDate(end); - isEnd = false; - }else{ - segEnd = eventEnd; - isEnd = true; - } - segs.push({ - event: event, - start: segStart, - end: segEnd, - isStart: isStart, - isEnd: isEnd, - msLength: segEnd - segStart - }); - } - } - return segs.sort(segCmp); -} - - -// event rendering calculation utilities -function stackSegs(segs) { - var levels = [], - i, len = segs.length, seg, - j, collide, k; - for (i=0; i<len; i++) { - seg = segs[i]; - j = 0; // the level index where seg should belong - while (true) { - collide = false; - if (levels[j]) { - for (k=0; k<levels[j].length; k++) { - if (segsCollide(levels[j][k], seg)) { - collide = true; - break; - } - } - } - if (collide) { - j++; - }else{ - break; - } - } - if (levels[j]) { - levels[j].push(seg); - }else{ - levels[j] = [seg]; - } - } - return levels; -} - - - -/* Event Element Binding ------------------------------------------------------------------------------*/ - - -function lazySegBind(container, segs, bindHandlers) { - container.unbind('mouseover').mouseover(function(ev) { - var parent=ev.target, e, - i, seg; - while (parent != this) { - e = parent; - parent = parent.parentNode; - } - if ((i = e._fci) !== undefined) { - e._fci = undefined; - seg = segs[i]; - bindHandlers(seg.event, seg.element, seg); - $(ev.target).trigger(ev); - } - ev.stopPropagation(); - }); -} - - - -/* Element Dimensions ------------------------------------------------------------------------------*/ - - -function setOuterWidth(element, width, includeMargins) { - for (var i=0, e; i<element.length; i++) { - e = $(element[i]); - e.width(Math.max(0, width - hsides(e, includeMargins))); - } -} - - -function setOuterHeight(element, height, includeMargins) { - for (var i=0, e; i<element.length; i++) { - e = $(element[i]); - e.height(Math.max(0, height - vsides(e, includeMargins))); - } -} - - -// TODO: curCSS has been deprecated (jQuery 1.4.3 - 10/16/2010) - - -function hsides(element, includeMargins) { - return hpadding(element) + hborders(element) + (includeMargins ? hmargins(element) : 0); -} - - -function hpadding(element) { - return (parseFloat($.curCSS(element[0], 'paddingLeft', true)) || 0) + - (parseFloat($.curCSS(element[0], 'paddingRight', true)) || 0); -} - - -function hmargins(element) { - return (parseFloat($.curCSS(element[0], 'marginLeft', true)) || 0) + - (parseFloat($.curCSS(element[0], 'marginRight', true)) || 0); -} - - -function hborders(element) { - return (parseFloat($.curCSS(element[0], 'borderLeftWidth', true)) || 0) + - (parseFloat($.curCSS(element[0], 'borderRightWidth', true)) || 0); -} - - -function vsides(element, includeMargins) { - return vpadding(element) + vborders(element) + (includeMargins ? vmargins(element) : 0); -} - - -function vpadding(element) { - return (parseFloat($.curCSS(element[0], 'paddingTop', true)) || 0) + - (parseFloat($.curCSS(element[0], 'paddingBottom', true)) || 0); -} - - -function vmargins(element) { - return (parseFloat($.curCSS(element[0], 'marginTop', true)) || 0) + - (parseFloat($.curCSS(element[0], 'marginBottom', true)) || 0); -} - - -function vborders(element) { - return (parseFloat($.curCSS(element[0], 'borderTopWidth', true)) || 0) + - (parseFloat($.curCSS(element[0], 'borderBottomWidth', true)) || 0); -} - - -function setMinHeight(element, height) { - height = (typeof height == 'number' ? height + 'px' : height); - element.each(function(i, _element) { - _element.style.cssText += ';min-height:' + height + ';_height:' + height; - // why can't we just use .css() ? i forget - }); -} - - - -/* Misc Utils ------------------------------------------------------------------------------*/ - - -//TODO: arraySlice -//TODO: isFunction, grep ? - - -function noop() { } - - -function cmp(a, b) { - return a - b; -} - - -function arrayMax(a) { - return Math.max.apply(Math, a); -} - - -function zeroPad(n) { - return (n < 10 ? '0' : '') + n; -} - - -function smartProperty(obj, name) { // get a camel-cased/namespaced property of an object - if (obj[name] !== undefined) { - return obj[name]; - } - var parts = name.split(/(?=[A-Z])/), - i=parts.length-1, res; - for (; i>=0; i--) { - res = obj[parts[i].toLowerCase()]; - if (res !== undefined) { - return res; - } - } - return obj['']; -} - - -function htmlEscape(s) { - return s.replace(/&/g, '&') - .replace(/</g, '<') - .replace(/>/g, '>') - .replace(/'/g, ''') - .replace(/"/g, '"') - .replace(/\n/g, '<br />'); -} - - -function cssKey(_element) { - return _element.id + '/' + _element.className + '/' + _element.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig, ''); -} - - -function disableTextSelection(element) { - element - .attr('unselectable', 'on') - .css('MozUserSelect', 'none') - .bind('selectstart.ui', function() { return false; }); -} - - -/* -function enableTextSelection(element) { - element - .attr('unselectable', 'off') - .css('MozUserSelect', '') - .unbind('selectstart.ui'); -} -*/ - - -function markFirstLast(e) { - e.children() - .removeClass('fc-first fc-last') - .filter(':first-child') - .addClass('fc-first') - .end() - .filter(':last-child') - .addClass('fc-last'); -} - - -function setDayID(cell, date) { - cell.each(function(i, _cell) { - _cell.className = _cell.className.replace(/^fc-\w*/, 'fc-' + dayIDs[date.getDay()]); - // TODO: make a way that doesn't rely on order of classes - }); -} - - -function getSkinCss(event, opt) { - var source = event.source || {}; - var eventColor = event.color; - var sourceColor = source.color; - var optionColor = opt('eventColor'); - var backgroundColor = - event.backgroundColor || - eventColor || - source.backgroundColor || - sourceColor || - opt('eventBackgroundColor') || - optionColor; - var borderColor = - event.borderColor || - eventColor || - source.borderColor || - sourceColor || - opt('eventBorderColor') || - optionColor; - var textColor = - event.textColor || - source.textColor || - opt('eventTextColor'); - var statements = []; - if (backgroundColor) { - statements.push('background-color:' + backgroundColor); - } - if (borderColor) { - statements.push('border-color:' + borderColor); - } - if (textColor) { - statements.push('color:' + textColor); - } - return statements.join(';'); -} - - -function applyAll(functions, thisObj, args) { - if ($.isFunction(functions)) { - functions = [ functions ]; - } - if (functions) { - var i; - var ret; - for (i=0; i<functions.length; i++) { - ret = functions[i].apply(thisObj, args) || ret; - } - return ret; - } -} - - -function firstDefined() { - for (var i=0; i<arguments.length; i++) { - if (arguments[i] !== undefined) { - return arguments[i]; - } - } -} - - - -fcViews.month = MonthView; - -function MonthView(element, calendar) { - var t = this; - - - // exports - t.render = render; - - - // imports - BasicView.call(t, element, calendar, 'month'); - var opt = t.opt; - var renderBasic = t.renderBasic; - var formatDate = calendar.formatDate; - - - - function render(date, delta) { - if (delta) { - addMonths(date, delta); - date.setDate(1); - } - var start = cloneDate(date, true); - start.setDate(1); - var end = addMonths(cloneDate(start), 1); - var visStart = cloneDate(start); - var visEnd = cloneDate(end); - var firstDay = opt('firstDay'); - var nwe = opt('weekends') ? 0 : 1; - if (nwe) { - skipWeekend(visStart); - skipWeekend(visEnd, -1, true); - } - addDays(visStart, -((visStart.getDay() - Math.max(firstDay, nwe) + 7) % 7)); - addDays(visEnd, (7 - visEnd.getDay() + Math.max(firstDay, nwe)) % 7); - var rowCnt = Math.round((visEnd - visStart) / (DAY_MS * 7)); - if (opt('weekMode') == 'fixed') { - addDays(visEnd, (6 - rowCnt) * 7); - rowCnt = 6; - } - t.title = formatDate(start, opt('titleFormat')); - t.start = start; - t.end = end; - t.visStart = visStart; - t.visEnd = visEnd; - renderBasic(6, rowCnt, nwe ? 5 : 7, true); - } - - -} - -fcViews.basicWeek = BasicWeekView; - -function BasicWeekView(element, calendar) { - var t = this; - - - // exports - t.render = render; - - - // imports - BasicView.call(t, element, calendar, 'basicWeek'); - var opt = t.opt; - var renderBasic = t.renderBasic; - var formatDates = calendar.formatDates; - - - - function render(date, delta) { - if (delta) { - addDays(date, delta * 7); - } - var start = addDays(cloneDate(date), -((date.getDay() - opt('firstDay') + 7) % 7)); - var end = addDays(cloneDate(start), 7); - var visStart = cloneDate(start); - var visEnd = cloneDate(end); - var weekends = opt('weekends'); - if (!weekends) { - skipWeekend(visStart); - skipWeekend(visEnd, -1, true); - } - t.title = formatDates( - visStart, - addDays(cloneDate(visEnd), -1), - opt('titleFormat') - ); - t.start = start; - t.end = end; - t.visStart = visStart; - t.visEnd = visEnd; - renderBasic(1, 1, weekends ? 7 : 5, false); - } - - -} - -fcViews.basicDay = BasicDayView; - -//TODO: when calendar's date starts out on a weekend, shouldn't happen - - -function BasicDayView(element, calendar) { - var t = this; - - - // exports - t.render = render; - - - // imports - BasicView.call(t, element, calendar, 'basicDay'); - var opt = t.opt; - var renderBasic = t.renderBasic; - var formatDate = calendar.formatDate; - - - - function render(date, delta) { - if (delta) { - addDays(date, delta); - if (!opt('weekends')) { - skipWeekend(date, delta < 0 ? -1 : 1); - } - } - t.title = formatDate(date, opt('titleFormat')); - t.start = t.visStart = cloneDate(date, true); - t.end = t.visEnd = addDays(cloneDate(t.start), 1); - renderBasic(1, 1, 1, false); - } - - -} - -setDefaults({ - weekMode: 'fixed' -}); - - -function BasicView(element, calendar, viewName) { - var t = this; - - - // exports - t.renderBasic = renderBasic; - t.setHeight = setHeight; - t.setWidth = setWidth; - t.renderDayOverlay = renderDayOverlay; - t.defaultSelectionEnd = defaultSelectionEnd; - t.renderSelection = renderSelection; - t.clearSelection = clearSelection; - t.reportDayClick = reportDayClick; // for selection (kinda hacky) - t.dragStart = dragStart; - t.dragStop = dragStop; - t.defaultEventEnd = defaultEventEnd; - t.getHoverListener = function() { return hoverListener }; - t.colContentLeft = colContentLeft; - t.colContentRight = colContentRight; - t.dayOfWeekCol = dayOfWeekCol; - t.dateCell = dateCell; - t.cellDate = cellDate; - t.cellIsAllDay = function() { return true }; - t.allDayRow = allDayRow; - t.allDayBounds = allDayBounds; - t.getRowCnt = function() { return rowCnt }; - t.getColCnt = function() { return colCnt }; - t.getColWidth = function() { return colWidth }; - t.getDaySegmentContainer = function() { return daySegmentContainer }; - - - // imports - View.call(t, element, calendar, viewName); - OverlayManager.call(t); - SelectionManager.call(t); - BasicEventRenderer.call(t); - var opt = t.opt; - var trigger = t.trigger; - var clearEvents = t.clearEvents; - var renderOverlay = t.renderOverlay; - var clearOverlays = t.clearOverlays; - var daySelectionMousedown = t.daySelectionMousedown; - var formatDate = calendar.formatDate; - - - // locals - - var head; - var headCells; - var body; - var bodyRows; - var bodyCells; - var bodyFirstCells; - var bodyCellTopInners; - var daySegmentContainer; - - var viewWidth; - var viewHeight; - var colWidth; - - var rowCnt, colCnt; - var coordinateGrid; - var hoverListener; - var colContentPositions; - - var rtl, dis, dit; - var firstDay; - var nwe; - var tm; - var colFormat; - - - - /* Rendering - ------------------------------------------------------------*/ - - - disableTextSelection(element.addClass('fc-grid')); - - - function renderBasic(maxr, r, c, showNumbers) { - rowCnt = r; - colCnt = c; - updateOptions(); - var firstTime = !body; - if (firstTime) { - buildSkeleton(maxr, showNumbers); - }else{ - clearEvents(); - } - updateCells(firstTime); - } - - - - function updateOptions() { - rtl = opt('isRTL'); - if (rtl) { - dis = -1; - dit = colCnt - 1; - }else{ - dis = 1; - dit = 0; - } - firstDay = opt('firstDay'); - nwe = opt('weekends') ? 0 : 1; - tm = opt('theme') ? 'ui' : 'fc'; - colFormat = opt('columnFormat'); - } - - - - function buildSkeleton(maxRowCnt, showNumbers) { - var s; - var headerClass = tm + "-widget-header"; - var contentClass = tm + "-widget-content"; - var i, j; - var table; - - s = - "<table class='fc-border-separate' style='width:100%' cellspacing='0'>" + - "<thead>" + - "<tr>"; - for (i=0; i<colCnt; i++) { - s += - "<th class='fc- " + headerClass + "'/>"; // need fc- for setDayID - } - s += - "</tr>" + - "</thead>" + - "<tbody>"; - for (i=0; i<maxRowCnt; i++) { - s += - "<tr class='fc-week" + i + "'>"; - for (j=0; j<colCnt; j++) { - s += - "<td class='fc- " + contentClass + " fc-day" + (i*colCnt+j) + "'>" + // need fc- for setDayID - "<div>" + - (showNumbers ? - "<div class='fc-day-number'/>" : - '' - ) + - "<div class='fc-day-content'>" + - "<div style='position:relative'> </div>" + - "</div>" + - "</div>" + - "</td>"; - } - s += - "</tr>"; - } - s += - "</tbody>" + - "</table>"; - table = $(s).appendTo(element); - - head = table.find('thead'); - headCells = head.find('th'); - body = table.find('tbody'); - bodyRows = body.find('tr'); - bodyCells = body.find('td'); - bodyFirstCells = bodyCells.filter(':first-child'); - bodyCellTopInners = bodyRows.eq(0).find('div.fc-day-content div'); - - markFirstLast(head.add(head.find('tr'))); // marks first+last tr/th's - markFirstLast(bodyRows); // marks first+last td's - bodyRows.eq(0).addClass('fc-first'); // fc-last is done in updateCells - - dayBind(bodyCells); - - daySegmentContainer = - $("<div style='position:absolute;z-index:8;top:0;left:0'/>") - .appendTo(element); - } - - - - function updateCells(firstTime) { - var dowDirty = firstTime || rowCnt == 1; // could the cells' day-of-weeks need updating? - var month = t.start.getMonth(); - var today = clearTime(new Date()); - var cell; - var date; - var row; - - if (dowDirty) { - headCells.each(function(i, _cell) { - cell = $(_cell); - date = indexDate(i); - cell.html(formatDate(date, colFormat)); - setDayID(cell, date); - }); - } - - bodyCells.each(function(i, _cell) { - cell = $(_cell); - date = indexDate(i); - if (date.getMonth() == month) { - cell.removeClass('fc-other-month'); - }else{ - cell.addClass('fc-other-month'); - } - if (+date == +today) { - cell.addClass(tm + '-state-highlight fc-today'); - }else{ - cell.removeClass(tm + '-state-highlight fc-today'); - } - cell.find('div.fc-day-number').text(date.getDate()); - if (dowDirty) { - setDayID(cell, date); - } - }); - - bodyRows.each(function(i, _row) { - row = $(_row); - if (i < rowCnt) { - row.show(); - if (i == rowCnt-1) { - row.addClass('fc-last'); - }else{ - row.removeClass('fc-last'); - } - }else{ - row.hide(); - } - }); - } - - - - function setHeight(height) { - viewHeight = height; - - var bodyHeight = viewHeight - head.height(); - var rowHeight; - var rowHeightLast; - var cell; - - if (opt('weekMode') == 'variable') { - rowHeight = rowHeightLast = Math.floor(bodyHeight / (rowCnt==1 ? 2 : 6)); - }else{ - rowHeight = Math.floor(bodyHeight / rowCnt); - rowHeightLast = bodyHeight - rowHeight * (rowCnt-1); - } - - bodyFirstCells.each(function(i, _cell) { - if (i < rowCnt) { - cell = $(_cell); - setMinHeight( - cell.find('> div'), - (i==rowCnt-1 ? rowHeightLast : rowHeight) - vsides(cell) - ); - } - }); - - } - - - function setWidth(width) { - viewWidth = width; - colContentPositions.clear(); - colWidth = Math.floor(viewWidth / colCnt); - setOuterWidth(headCells.slice(0, -1), colWidth); - } - - - - /* Day clicking and binding - -----------------------------------------------------------*/ - - - function dayBind(days) { - days.click(dayClick) - .mousedown(daySelectionMousedown); - } - - - function dayClick(ev) { - if (!opt('selectable')) { // if selectable, SelectionManager will worry about dayClick - var index = parseInt(this.className.match(/fc\-day(\d+)/)[1]); // TODO: maybe use .data - var date = indexDate(index); - trigger('dayClick', this, date, true, ev); - } - } - - - - /* Semi-transparent Overlay Helpers - ------------------------------------------------------*/ - - - function renderDayOverlay(overlayStart, overlayEnd, refreshCoordinateGrid) { // overlayEnd is exclusive - if (refreshCoordinateGrid) { - coordinateGrid.build(); - } - var rowStart = cloneDate(t.visStart); - var rowEnd = addDays(cloneDate(rowStart), colCnt); - for (var i=0; i<rowCnt; i++) { - var stretchStart = new Date(Math.max(rowStart, overlayStart)); - var stretchEnd = new Date(Math.min(rowEnd, overlayEnd)); - if (stretchStart < stretchEnd) { - var colStart, colEnd; - if (rtl) { - colStart = dayDiff(stretchEnd, rowStart)*dis+dit+1; - colEnd = dayDiff(stretchStart, rowStart)*dis+dit+1; - }else{ - colStart = dayDiff(stretchStart, rowStart); - colEnd = dayDiff(stretchEnd, rowStart); - } - dayBind( - renderCellOverlay(i, colStart, i, colEnd-1) - ); - } - addDays(rowStart, 7); - addDays(rowEnd, 7); - } - } - - - function renderCellOverlay(row0, col0, row1, col1) { // row1,col1 is inclusive - var rect = coordinateGrid.rect(row0, col0, row1, col1, element); - return renderOverlay(rect, element); - } - - - - /* Selection - -----------------------------------------------------------------------*/ - - - function defaultSelectionEnd(startDate, allDay) { - return cloneDate(startDate); - } - - - function renderSelection(startDate, endDate, allDay) { - renderDayOverlay(startDate, addDays(cloneDate(endDate), 1), true); // rebuild every time??? - } - - - function clearSelection() { - clearOverlays(); - } - - - function reportDayClick(date, allDay, ev) { - var cell = dateCell(date); - var _element = bodyCells[cell.row*colCnt + cell.col]; - trigger('dayClick', _element, date, allDay, ev); - } - - - - /* External Dragging - -----------------------------------------------------------------------*/ - - - function dragStart(_dragElement, ev, ui) { - hoverListener.start(function(cell) { - clearOverlays(); - if (cell) { - renderCellOverlay(cell.row, cell.col, cell.row, cell.col); - } - }, ev); - } - - - function dragStop(_dragElement, ev, ui) { - var cell = hoverListener.stop(); - clearOverlays(); - if (cell) { - var d = cellDate(cell); - trigger('drop', _dragElement, d, true, ev, ui); - } - } - - - - /* Utilities - --------------------------------------------------------*/ - - - function defaultEventEnd(event) { - return cloneDate(event.start); - } - - - coordinateGrid = new CoordinateGrid(function(rows, cols) { - var e, n, p; - headCells.each(function(i, _e) { - e = $(_e); - n = e.offset().left; - if (i) { - p[1] = n; - } - p = [n]; - cols[i] = p; - }); - p[1] = n + e.outerWidth(); - bodyRows.each(function(i, _e) { - if (i < rowCnt) { - e = $(_e); - n = e.offset().top; - if (i) { - p[1] = n; - } - p = [n]; - rows[i] = p; - } - }); - p[1] = n + e.outerHeight(); - }); - - - hoverListener = new HoverListener(coordinateGrid); - - - colContentPositions = new HorizontalPositionCache(function(col) { - return bodyCellTopInners.eq(col); - }); - - - function colContentLeft(col) { - return colContentPositions.left(col); - } - - - function colContentRight(col) { - return colContentPositions.right(col); - } - - - - - function dateCell(date) { - return { - row: Math.floor(dayDiff(date, t.visStart) / 7), - col: dayOfWeekCol(date.getDay()) - }; - } - - - function cellDate(cell) { - return _cellDate(cell.row, cell.col); - } - - - function _cellDate(row, col) { - return addDays(cloneDate(t.visStart), row*7 + col*dis+dit); - // what about weekends in middle of week? - } - - - function indexDate(index) { - return _cellDate(Math.floor(index/colCnt), index%colCnt); - } - - - function dayOfWeekCol(dayOfWeek) { - return ((dayOfWeek - Math.max(firstDay, nwe) + colCnt) % colCnt) * dis + dit; - } - - - - - function allDayRow(i) { - return bodyRows.eq(i); - } - - - function allDayBounds(i) { - return { - left: 0, - right: viewWidth - }; - } - - -} - -function BasicEventRenderer() { - var t = this; - - - // exports - t.renderEvents = renderEvents; - t.compileDaySegs = compileSegs; // for DayEventRenderer - t.clearEvents = clearEvents; - t.bindDaySeg = bindDaySeg; - - - // imports - DayEventRenderer.call(t); - var opt = t.opt; - var trigger = t.trigger; - //var setOverflowHidden = t.setOverflowHidden; - var isEventDraggable = t.isEventDraggable; - var isEventResizable = t.isEventResizable; - var reportEvents = t.reportEvents; - var reportEventClear = t.reportEventClear; - var eventElementHandlers = t.eventElementHandlers; - var showEvents = t.showEvents; - var hideEvents = t.hideEvents; - var eventDrop = t.eventDrop; - var getDaySegmentContainer = t.getDaySegmentContainer; - var getHoverListener = t.getHoverListener; - var renderDayOverlay = t.renderDayOverlay; - var clearOverlays = t.clearOverlays; - var getRowCnt = t.getRowCnt; - var getColCnt = t.getColCnt; - var renderDaySegs = t.renderDaySegs; - var resizableDayEvent = t.resizableDayEvent; - - - - /* Rendering - --------------------------------------------------------------------*/ - - - function renderEvents(events, modifiedEventId) { - reportEvents(events); - renderDaySegs(compileSegs(events), modifiedEventId); - } - - - function clearEvents() { - reportEventClear(); - getDaySegmentContainer().empty(); - } - - - function compileSegs(events) { - var rowCnt = getRowCnt(), - colCnt = getColCnt(), - d1 = cloneDate(t.visStart), - d2 = addDays(cloneDate(d1), colCnt), - visEventsEnds = $.map(events, exclEndDay), - i, row, - j, level, - k, seg, - segs=[]; - for (i=0; i<rowCnt; i++) { - row = stackSegs(sliceSegs(events, visEventsEnds, d1, d2)); - for (j=0; j<row.length; j++) { - level = row[j]; - for (k=0; k<level.length; k++) { - seg = level[k]; - seg.row = i; - seg.level = j; // not needed anymore - segs.push(seg); - } - } - addDays(d1, 7); - addDays(d2, 7); - } - return segs; - } - - - function bindDaySeg(event, eventElement, seg) { - if (isEventDraggable(event)) { - draggableDayEvent(event, eventElement); - } - if (seg.isEnd && isEventResizable(event)) { - resizableDayEvent(event, eventElement, seg); - } - eventElementHandlers(event, eventElement); - // needs to be after, because resizableDayEvent might stopImmediatePropagation on click - } - - - - /* Dragging - ----------------------------------------------------------------------------*/ - - - function draggableDayEvent(event, eventElement) { - var hoverListener = getHoverListener(); - var dayDelta; - eventElement.draggable({ - zIndex: 9, - delay: 50, - opacity: opt('dragOpacity'), - revertDuration: opt('dragRevertDuration'), - start: function(ev, ui) { - trigger('eventDragStart', eventElement, event, ev, ui); - hideEvents(event, eventElement); - hoverListener.start(function(cell, origCell, rowDelta, colDelta) { - eventElement.draggable('option', 'revert', !cell || !rowDelta && !colDelta); - clearOverlays(); - if (cell) { - //setOverflowHidden(true); - dayDelta = rowDelta*7 + colDelta * (opt('isRTL') ? -1 : 1); - renderDayOverlay( - addDays(cloneDate(event.start), dayDelta), - addDays(exclEndDay(event), dayDelta) - ); - }else{ - //setOverflowHidden(false); - dayDelta = 0; - } - }, ev, 'drag'); - }, - stop: function(ev, ui) { - hoverListener.stop(); - clearOverlays(); - trigger('eventDragStop', eventElement, event, ev, ui); - if (dayDelta) { - eventDrop(this, event, dayDelta, 0, event.allDay, ev, ui); - }else{ - eventElement.css('filter', ''); // clear IE opacity side-effects - showEvents(event, eventElement); - } - //setOverflowHidden(false); - } - }); - } - - -} - -fcViews.agendaWeek = AgendaWeekView; - -function AgendaWeekView(element, calendar) { - var t = this; - - - // exports - t.render = render; - - - // imports - AgendaView.call(t, element, calendar, 'agendaWeek'); - var opt = t.opt; - var renderAgenda = t.renderAgenda; - var formatDates = calendar.formatDates; - - - - function render(date, delta) { - if (delta) { - addDays(date, delta * 7); - } - var start = addDays(cloneDate(date), -((date.getDay() - opt('firstDay') + 7) % 7)); - var end = addDays(cloneDate(start), 7); - var visStart = cloneDate(start); - var visEnd = cloneDate(end); - var weekends = opt('weekends'); - if (!weekends) { - skipWeekend(visStart); - skipWeekend(visEnd, -1, true); - } - t.title = formatDates( - visStart, - addDays(cloneDate(visEnd), -1), - opt('titleFormat') - ); - t.start = start; - t.end = end; - t.visStart = visStart; - t.visEnd = visEnd; - renderAgenda(weekends ? 7 : 5); - } - - -} - -fcViews.agendaDay = AgendaDayView; - -function AgendaDayView(element, calendar) { - var t = this; - - - // exports - t.render = render; - - - // imports - AgendaView.call(t, element, calendar, 'agendaDay'); - var opt = t.opt; - var renderAgenda = t.renderAgenda; - var formatDate = calendar.formatDate; - - - - function render(date, delta) { - if (delta) { - addDays(date, delta); - if (!opt('weekends')) { - skipWeekend(date, delta < 0 ? -1 : 1); - } - } - var start = cloneDate(date, true); - var end = addDays(cloneDate(start), 1); - t.title = formatDate(date, opt('titleFormat')); - t.start = t.visStart = start; - t.end = t.visEnd = end; - renderAgenda(1); - } - - -} - -setDefaults({ - allDaySlot: true, - allDayText: 'all-day', - firstHour: 6, - slotMinutes: 30, - defaultEventMinutes: 120, - axisFormat: 'h(:mm)tt', - timeFormat: { - agenda: 'h:mm{ - h:mm}' - }, - dragOpacity: { - agenda: .5 - }, - minTime: 0, - maxTime: 24 -}); - - -// TODO: make it work in quirks mode (event corners, all-day height) -// TODO: test liquid width, especially in IE6 - - -function AgendaView(element, calendar, viewName) { - var t = this; - - - // exports - t.renderAgenda = renderAgenda; - t.setWidth = setWidth; - t.setHeight = setHeight; - t.beforeHide = beforeHide; - t.afterShow = afterShow; - t.defaultEventEnd = defaultEventEnd; - t.timePosition = timePosition; - t.dayOfWeekCol = dayOfWeekCol; - t.dateCell = dateCell; - t.cellDate = cellDate; - t.cellIsAllDay = cellIsAllDay; - t.allDayRow = getAllDayRow; - t.allDayBounds = allDayBounds; - t.getHoverListener = function() { return hoverListener }; - t.colContentLeft = colContentLeft; - t.colContentRight = colContentRight; - t.getDaySegmentContainer = function() { return daySegmentContainer }; - t.getSlotSegmentContainer = function() { return slotSegmentContainer }; - t.getMinMinute = function() { return minMinute }; - t.getMaxMinute = function() { return maxMinute }; - t.getBodyContent = function() { return slotContent }; // !!?? - t.getRowCnt = function() { return 1 }; - t.getColCnt = function() { return colCnt }; - t.getColWidth = function() { return colWidth }; - t.getSlotHeight = function() { return slotHeight }; - t.defaultSelectionEnd = defaultSelectionEnd; - t.renderDayOverlay = renderDayOverlay; - t.renderSelection = renderSelection; - t.clearSelection = clearSelection; - t.reportDayClick = reportDayClick; // selection mousedown hack - t.dragStart = dragStart; - t.dragStop = dragStop; - - - // imports - View.call(t, element, calendar, viewName); - OverlayManager.call(t); - SelectionManager.call(t); - AgendaEventRenderer.call(t); - var opt = t.opt; - var trigger = t.trigger; - var clearEvents = t.clearEvents; - var renderOverlay = t.renderOverlay; - var clearOverlays = t.clearOverlays; - var reportSelection = t.reportSelection; - var unselect = t.unselect; - var daySelectionMousedown = t.daySelectionMousedown; - var slotSegHtml = t.slotSegHtml; - var formatDate = calendar.formatDate; - - - // locals - - var dayTable; - var dayHead; - var dayHeadCells; - var dayBody; - var dayBodyCells; - var dayBodyCellInners; - var dayBodyFirstCell; - var dayBodyFirstCellStretcher; - var slotLayer; - var daySegmentContainer; - var allDayTable; - var allDayRow; - var slotScroller; - var slotContent; - var slotSegmentContainer; - var slotTable; - var slotTableFirstInner; - var axisFirstCells; - var gutterCells; - var selectionHelper; - - var viewWidth; - var viewHeight; - var axisWidth; - var colWidth; - var gutterWidth; - var slotHeight; // TODO: what if slotHeight changes? (see issue 650) - var savedScrollTop; - - var colCnt; - var slotCnt; - var coordinateGrid; - var hoverListener; - var colContentPositions; - var slotTopCache = {}; - - var tm; - var firstDay; - var nwe; // no weekends (int) - var rtl, dis, dit; // day index sign / translate - var minMinute, maxMinute; - var colFormat; - - - - /* Rendering - -----------------------------------------------------------------------------*/ - - - disableTextSelection(element.addClass('fc-agenda')); - - - function renderAgenda(c) { - colCnt = c; - updateOptions(); - if (!dayTable) { - buildSkeleton(); - }else{ - clearEvents(); - } - updateCells(); - } - - - - function updateOptions() { - tm = opt('theme') ? 'ui' : 'fc'; - nwe = opt('weekends') ? 0 : 1; - firstDay = opt('firstDay'); - if (rtl = opt('isRTL')) { - dis = -1; - dit = colCnt - 1; - }else{ - dis = 1; - dit = 0; - } - minMinute = parseTime(opt('minTime')); - maxMinute = parseTime(opt('maxTime')); - colFormat = opt('columnFormat'); - } - - - - function buildSkeleton() { - var headerClass = tm + "-widget-header"; - var contentClass = tm + "-widget-content"; - var s; - var i; - var d; - var maxd; - var minutes; - var slotNormal = opt('slotMinutes') % 15 == 0; - - s = - "<table style='width:100%' class='fc-agenda-days fc-border-separate' cellspacing='0'>" + - "<thead>" + - "<tr>" + - "<th class='fc-agenda-axis " + headerClass + "'> </th>"; - for (i=0; i<colCnt; i++) { - s += - "<th class='fc- fc-col" + i + ' ' + headerClass + "'/>"; // fc- needed for setDayID - } - s += - "<th class='fc-agenda-gutter " + headerClass + "'> </th>" + - "</tr>" + - "</thead>" + - "<tbody>" + - "<tr>" + - "<th class='fc-agenda-axis " + headerClass + "'> </th>"; - for (i=0; i<colCnt; i++) { - s += - "<td class='fc- fc-col" + i + ' ' + contentClass + "'>" + // fc- needed for setDayID - "<div>" + - "<div class='fc-day-content'>" + - "<div style='position:relative'> </div>" + - "</div>" + - "</div>" + - "</td>"; - } - s += - "<td class='fc-agenda-gutter " + contentClass + "'> </td>" + - "</tr>" + - "</tbody>" + - "</table>"; - dayTable = $(s).appendTo(element); - dayHead = dayTable.find('thead'); - dayHeadCells = dayHead.find('th').slice(1, -1); - dayBody = dayTable.find('tbody'); - dayBodyCells = dayBody.find('td').slice(0, -1); - dayBodyCellInners = dayBodyCells.find('div.fc-day-content div'); - dayBodyFirstCell = dayBodyCells.eq(0); - dayBodyFirstCellStretcher = dayBodyFirstCell.find('> div'); - - markFirstLast(dayHead.add(dayHead.find('tr'))); - markFirstLast(dayBody.add(dayBody.find('tr'))); - - axisFirstCells = dayHead.find('th:first'); - gutterCells = dayTable.find('.fc-agenda-gutter'); - - slotLayer = - $("<div style='position:absolute;z-index:2;left:0;width:100%'/>") - .appendTo(element); - - if (opt('allDaySlot')) { - - daySegmentContainer = - $("<div style='position:absolute;z-index:8;top:0;left:0'/>") - .appendTo(slotLayer); - - s = - "<table style='width:100%' class='fc-agenda-allday' cellspacing='0'>" + - "<tr>" + - "<th class='" + headerClass + " fc-agenda-axis'>" + opt('allDayText') + "</th>" + - "<td>" + - "<div class='fc-day-content'><div style='position:relative'/></div>" + - "</td>" + - "<th class='" + headerClass + " fc-agenda-gutter'> </th>" + - "</tr>" + - "</table>"; - allDayTable = $(s).appendTo(slotLayer); - allDayRow = allDayTable.find('tr'); - - dayBind(allDayRow.find('td')); - - axisFirstCells = axisFirstCells.add(allDayTable.find('th:first')); - gutterCells = gutterCells.add(allDayTable.find('th.fc-agenda-gutter')); - - slotLayer.append( - "<div class='fc-agenda-divider " + headerClass + "'>" + - "<div class='fc-agenda-divider-inner'/>" + - "</div>" - ); - - }else{ - - daySegmentContainer = $([]); // in jQuery 1.4, we can just do $() - - } - - slotScroller = - $("<div style='position:absolute;width:100%;overflow-x:hidden;overflow-y:auto'/>") - .appendTo(slotLayer); - - slotContent = - $("<div style='position:relative;width:100%;overflow:hidden'/>") - .appendTo(slotScroller); - - slotSegmentContainer = - $("<div style='position:absolute;z-index:8;top:0;left:0'/>") - .appendTo(slotContent); - - s = - "<table class='fc-agenda-slots' style='width:100%' cellspacing='0'>" + - "<tbody>"; - d = zeroDate(); - maxd = addMinutes(cloneDate(d), maxMinute); - addMinutes(d, minMinute); - slotCnt = 0; - for (i=0; d < maxd; i++) { - minutes = d.getMinutes(); - s += - "<tr class='fc-slot" + i + ' ' + (!minutes ? '' : 'fc-minor') + "'>" + - "<th class='fc-agenda-axis " + headerClass + "'>" + - ((!slotNormal || !minutes) ? formatDate(d, opt('axisFormat')) : ' ') + - "</th>" + - "<td class='" + contentClass + "'>" + - "<div style='position:relative'> </div>" + - "</td>" + - "</tr>"; - addMinutes(d, opt('slotMinutes')); - slotCnt++; - } - s += - "</tbody>" + - "</table>"; - slotTable = $(s).appendTo(slotContent); - slotTableFirstInner = slotTable.find('div:first'); - - slotBind(slotTable.find('td')); - - axisFirstCells = axisFirstCells.add(slotTable.find('th:first')); - } - - - - function updateCells() { - var i; - var headCell; - var bodyCell; - var date; - var today = clearTime(new Date()); - for (i=0; i<colCnt; i++) { - date = colDate(i); - headCell = dayHeadCells.eq(i); - headCell.html(formatDate(date, colFormat)); - bodyCell = dayBodyCells.eq(i); - if (+date == +today) { - bodyCell.addClass(tm + '-state-highlight fc-today'); - }else{ - bodyCell.removeClass(tm + '-state-highlight fc-today'); - } - setDayID(headCell.add(bodyCell), date); - } - } - - - - function setHeight(height, dateChanged) { - if (height === undefined) { - height = viewHeight; - } - viewHeight = height; - slotTopCache = {}; - - var headHeight = dayBody.position().top; - var allDayHeight = slotScroller.position().top; // including divider - var bodyHeight = Math.min( // total body height, including borders - height - headHeight, // when scrollbars - slotTable.height() + allDayHeight + 1 // when no scrollbars. +1 for bottom border - ); - - dayBodyFirstCellStretcher - .height(bodyHeight - vsides(dayBodyFirstCell)); - - slotLayer.css('top', headHeight); - - slotScroller.height(bodyHeight - allDayHeight - 1); - - slotHeight = slotTableFirstInner.height() + 1; // +1 for border - - if (dateChanged) { - resetScroll(); - } - } - - - - function setWidth(width) { - viewWidth = width; - colContentPositions.clear(); - - axisWidth = 0; - setOuterWidth( - axisFirstCells - .width('') - .each(function(i, _cell) { - axisWidth = Math.max(axisWidth, $(_cell).outerWidth()); - }), - axisWidth - ); - - var slotTableWidth = slotScroller[0].clientWidth; // needs to be done after axisWidth (for IE7) - //slotTable.width(slotTableWidth); - - gutterWidth = slotScroller.width() - slotTableWidth; - if (gutterWidth) { - setOuterWidth(gutterCells, gutterWidth); - gutterCells - .show() - .prev() - .removeClass('fc-last'); - }else{ - gutterCells - .hide() - .prev() - .addClass('fc-last'); - } - - colWidth = Math.floor((slotTableWidth - axisWidth) / colCnt); - setOuterWidth(dayHeadCells.slice(0, -1), colWidth); - } - - - - function resetScroll() { - var d0 = zeroDate(); - var scrollDate = cloneDate(d0); - scrollDate.setHours(opt('firstHour')); - var top = timePosition(d0, scrollDate) + 1; // +1 for the border - function scroll() { - slotScroller.scrollTop(top); - } - scroll(); - setTimeout(scroll, 0); // overrides any previous scroll state made by the browser - } - - - function beforeHide() { - savedScrollTop = slotScroller.scrollTop(); - } - - - function afterShow() { - slotScroller.scrollTop(savedScrollTop); - } - - - - /* Slot/Day clicking and binding - -----------------------------------------------------------------------*/ - - - function dayBind(cells) { - cells.click(slotClick) - .mousedown(daySelectionMousedown); - } - - - function slotBind(cells) { - cells.click(slotClick) - .mousedown(slotSelectionMousedown); - } - - - function slotClick(ev) { - if (!opt('selectable')) { // if selectable, SelectionManager will worry about dayClick - var col = Math.min(colCnt-1, Math.floor((ev.pageX - dayTable.offset().left - axisWidth) / colWidth)); - var date = colDate(col); - var rowMatch = this.parentNode.className.match(/fc-slot(\d+)/); // TODO: maybe use data - if (rowMatch) { - var mins = parseInt(rowMatch[1]) * opt('slotMinutes'); - var hours = Math.floor(mins/60); - date.setHours(hours); - date.setMinutes(mins%60 + minMinute); - trigger('dayClick', dayBodyCells[col], date, false, ev); - }else{ - trigger('dayClick', dayBodyCells[col], date, true, ev); - } - } - } - - - - /* Semi-transparent Overlay Helpers - -----------------------------------------------------*/ - - - function renderDayOverlay(startDate, endDate, refreshCoordinateGrid) { // endDate is exclusive - if (refreshCoordinateGrid) { - coordinateGrid.build(); - } - var visStart = cloneDate(t.visStart); - var startCol, endCol; - if (rtl) { - startCol = dayDiff(endDate, visStart)*dis+dit+1; - endCol = dayDiff(startDate, visStart)*dis+dit+1; - }else{ - startCol = dayDiff(startDate, visStart); - endCol = dayDiff(endDate, visStart); - } - startCol = Math.max(0, startCol); - endCol = Math.min(colCnt, endCol); - if (startCol < endCol) { - dayBind( - renderCellOverlay(0, startCol, 0, endCol-1) - ); - } - } - - - function renderCellOverlay(row0, col0, row1, col1) { // only for all-day? - var rect = coordinateGrid.rect(row0, col0, row1, col1, slotLayer); - return renderOverlay(rect, slotLayer); - } - - - function renderSlotOverlay(overlayStart, overlayEnd) { - var dayStart = cloneDate(t.visStart); - var dayEnd = addDays(cloneDate(dayStart), 1); - for (var i=0; i<colCnt; i++) { - var stretchStart = new Date(Math.max(dayStart, overlayStart)); - var stretchEnd = new Date(Math.min(dayEnd, overlayEnd)); - if (stretchStart < stretchEnd) { - var col = i*dis+dit; - var rect = coordinateGrid.rect(0, col, 0, col, slotContent); // only use it for horizontal coords - var top = timePosition(dayStart, stretchStart); - var bottom = timePosition(dayStart, stretchEnd); - rect.top = top; - rect.height = bottom - top; - slotBind( - renderOverlay(rect, slotContent) - ); - } - addDays(dayStart, 1); - addDays(dayEnd, 1); - } - } - - - - /* Coordinate Utilities - -----------------------------------------------------------------------------*/ - - - coordinateGrid = new CoordinateGrid(function(rows, cols) { - var e, n, p; - dayHeadCells.each(function(i, _e) { - e = $(_e); - n = e.offset().left; - if (i) { - p[1] = n; - } - p = [n]; - cols[i] = p; - }); - p[1] = n + e.outerWidth(); - if (opt('allDaySlot')) { - e = allDayRow; - n = e.offset().top; - rows[0] = [n, n+e.outerHeight()]; - } - var slotTableTop = slotContent.offset().top; - var slotScrollerTop = slotScroller.offset().top; - var slotScrollerBottom = slotScrollerTop + slotScroller.outerHeight(); - function constrain(n) { - return Math.max(slotScrollerTop, Math.min(slotScrollerBottom, n)); - } - for (var i=0; i<slotCnt; i++) { - rows.push([ - constrain(slotTableTop + slotHeight*i), - constrain(slotTableTop + slotHeight*(i+1)) - ]); - } - }); - - - hoverListener = new HoverListener(coordinateGrid); - - - colContentPositions = new HorizontalPositionCache(function(col) { - return dayBodyCellInners.eq(col); - }); - - - function colContentLeft(col) { - return colContentPositions.left(col); - } - - - function colContentRight(col) { - return colContentPositions.right(col); - } - - - - - function dateCell(date) { // "cell" terminology is now confusing - return { - row: Math.floor(dayDiff(date, t.visStart) / 7), - col: dayOfWeekCol(date.getDay()) - }; - } - - - function cellDate(cell) { - var d = colDate(cell.col); - var slotIndex = cell.row; - if (opt('allDaySlot')) { - slotIndex--; - } - if (slotIndex >= 0) { - addMinutes(d, minMinute + slotIndex * opt('slotMinutes')); - } - return d; - } - - - function colDate(col) { // returns dates with 00:00:00 - return addDays(cloneDate(t.visStart), col*dis+dit); - } - - - function cellIsAllDay(cell) { - return opt('allDaySlot') && !cell.row; - } - - - function dayOfWeekCol(dayOfWeek) { - return ((dayOfWeek - Math.max(firstDay, nwe) + colCnt) % colCnt)*dis+dit; - } - - - - - // get the Y coordinate of the given time on the given day (both Date objects) - function timePosition(day, time) { // both date objects. day holds 00:00 of current day - day = cloneDate(day, true); - if (time < addMinutes(cloneDate(day), minMinute)) { - return 0; - } - if (time >= addMinutes(cloneDate(day), maxMinute)) { - return slotTable.height(); - } - var slotMinutes = opt('slotMinutes'), - minutes = time.getHours()*60 + time.getMinutes() - minMinute, - slotI = Math.floor(minutes / slotMinutes), - slotTop = slotTopCache[slotI]; - if (slotTop === undefined) { - slotTop = slotTopCache[slotI] = slotTable.find('tr:eq(' + slotI + ') td div')[0].offsetTop; //.position().top; // need this optimization??? - } - return Math.max(0, Math.round( - slotTop - 1 + slotHeight * ((minutes % slotMinutes) / slotMinutes) - )); - } - - - function allDayBounds() { - return { - left: axisWidth, - right: viewWidth - gutterWidth - } - } - - - function getAllDayRow(index) { - return allDayRow; - } - - - function defaultEventEnd(event) { - var start = cloneDate(event.start); - if (event.allDay) { - return start; - } - return addMinutes(start, opt('defaultEventMinutes')); - } - - - - /* Selection - ---------------------------------------------------------------------------------*/ - - - function defaultSelectionEnd(startDate, allDay) { - if (allDay) { - return cloneDate(startDate); - } - return addMinutes(cloneDate(startDate), opt('slotMinutes')); - } - - - function renderSelection(startDate, endDate, allDay) { // only for all-day - if (allDay) { - if (opt('allDaySlot')) { - renderDayOverlay(startDate, addDays(cloneDate(endDate), 1), true); - } - }else{ - renderSlotSelection(startDate, endDate); - } - } - - - function renderSlotSelection(startDate, endDate) { - var helperOption = opt('selectHelper'); - coordinateGrid.build(); - if (helperOption) { - var col = dayDiff(startDate, t.visStart) * dis + dit; - if (col >= 0 && col < colCnt) { // only works when times are on same day - var rect = coordinateGrid.rect(0, col, 0, col, slotContent); // only for horizontal coords - var top = timePosition(startDate, startDate); - var bottom = timePosition(startDate, endDate); - if (bottom > top) { // protect against selections that are entirely before or after visible range - rect.top = top; - rect.height = bottom - top; - rect.left += 2; - rect.width -= 5; - if ($.isFunction(helperOption)) { - var helperRes = helperOption(startDate, endDate); - if (helperRes) { - rect.position = 'absolute'; - rect.zIndex = 8; - selectionHelper = $(helperRes) - .css(rect) - .appendTo(slotContent); - } - }else{ - rect.isStart = true; // conside rect a "seg" now - rect.isEnd = true; // - selectionHelper = $(slotSegHtml( - { - title: '', - start: startDate, - end: endDate, - className: ['fc-select-helper'], - editable: false - }, - rect - )); - selectionHelper.css('opacity', opt('dragOpacity')); - } - if (selectionHelper) { - slotBind(selectionHelper); - slotContent.append(selectionHelper); - setOuterWidth(selectionHelper, rect.width, true); // needs to be after appended - setOuterHeight(selectionHelper, rect.height, true); - } - } - } - }else{ - renderSlotOverlay(startDate, endDate); - } - } - - - function clearSelection() { - clearOverlays(); - if (selectionHelper) { - selectionHelper.remove(); - selectionHelper = null; - } - } - - - function slotSelectionMousedown(ev) { - if (ev.which == 1 && opt('selectable')) { // ev.which==1 means left mouse button - unselect(ev); - var dates; - hoverListener.start(function(cell, origCell) { - clearSelection(); - if (cell && cell.col == origCell.col && !cellIsAllDay(cell)) { - var d1 = cellDate(origCell); - var d2 = cellDate(cell); - dates = [ - d1, - addMinutes(cloneDate(d1), opt('slotMinutes')), - d2, - addMinutes(cloneDate(d2), opt('slotMinutes')) - ].sort(cmp); - renderSlotSelection(dates[0], dates[3]); - }else{ - dates = null; - } - }, ev); - $(document).one('mouseup', function(ev) { - hoverListener.stop(); - if (dates) { - if (+dates[0] == +dates[1]) { - reportDayClick(dates[0], false, ev); - } - reportSelection(dates[0], dates[3], false, ev); - } - }); - } - } - - - function reportDayClick(date, allDay, ev) { - trigger('dayClick', dayBodyCells[dayOfWeekCol(date.getDay())], date, allDay, ev); - } - - - - /* External Dragging - --------------------------------------------------------------------------------*/ - - - function dragStart(_dragElement, ev, ui) { - hoverListener.start(function(cell) { - clearOverlays(); - if (cell) { - if (cellIsAllDay(cell)) { - renderCellOverlay(cell.row, cell.col, cell.row, cell.col); - }else{ - var d1 = cellDate(cell); - var d2 = addMinutes(cloneDate(d1), opt('defaultEventMinutes')); - renderSlotOverlay(d1, d2); - } - } - }, ev); - } - - - function dragStop(_dragElement, ev, ui) { - var cell = hoverListener.stop(); - clearOverlays(); - if (cell) { - trigger('drop', _dragElement, cellDate(cell), cellIsAllDay(cell), ev, ui); - } - } - - -} - -function AgendaEventRenderer() { - var t = this; - - - // exports - t.renderEvents = renderEvents; - t.compileDaySegs = compileDaySegs; // for DayEventRenderer - t.clearEvents = clearEvents; - t.slotSegHtml = slotSegHtml; - t.bindDaySeg = bindDaySeg; - - - // imports - DayEventRenderer.call(t); - var opt = t.opt; - var trigger = t.trigger; - //var setOverflowHidden = t.setOverflowHidden; - var isEventDraggable = t.isEventDraggable; - var isEventResizable = t.isEventResizable; - var eventEnd = t.eventEnd; - var reportEvents = t.reportEvents; - var reportEventClear = t.reportEventClear; - var eventElementHandlers = t.eventElementHandlers; - var setHeight = t.setHeight; - var getDaySegmentContainer = t.getDaySegmentContainer; - var getSlotSegmentContainer = t.getSlotSegmentContainer; - var getHoverListener = t.getHoverListener; - var getMaxMinute = t.getMaxMinute; - var getMinMinute = t.getMinMinute; - var timePosition = t.timePosition; - var colContentLeft = t.colContentLeft; - var colContentRight = t.colContentRight; - var renderDaySegs = t.renderDaySegs; - var resizableDayEvent = t.resizableDayEvent; // TODO: streamline binding architecture - var getColCnt = t.getColCnt; - var getColWidth = t.getColWidth; - var getSlotHeight = t.getSlotHeight; - var getBodyContent = t.getBodyContent; - var reportEventElement = t.reportEventElement; - var showEvents = t.showEvents; - var hideEvents = t.hideEvents; - var eventDrop = t.eventDrop; - var eventResize = t.eventResize; - var renderDayOverlay = t.renderDayOverlay; - var clearOverlays = t.clearOverlays; - var calendar = t.calendar; - var formatDate = calendar.formatDate; - var formatDates = calendar.formatDates; - - - - /* Rendering - ----------------------------------------------------------------------------*/ - - - function renderEvents(events, modifiedEventId) { - reportEvents(events); - var i, len=events.length, - dayEvents=[], - slotEvents=[]; - for (i=0; i<len; i++) { - if (events[i].allDay) { - dayEvents.push(events[i]); - }else{ - slotEvents.push(events[i]); - } - } - if (opt('allDaySlot')) { - renderDaySegs(compileDaySegs(dayEvents), modifiedEventId); - setHeight(); // no params means set to viewHeight - } - renderSlotSegs(compileSlotSegs(slotEvents), modifiedEventId); - } - - - function clearEvents() { - reportEventClear(); - getDaySegmentContainer().empty(); - getSlotSegmentContainer().empty(); - } - - - function compileDaySegs(events) { - var levels = stackSegs(sliceSegs(events, $.map(events, exclEndDay), t.visStart, t.visEnd)), - i, levelCnt=levels.length, level, - j, seg, - segs=[]; - for (i=0; i<levelCnt; i++) { - level = levels[i]; - for (j=0; j<level.length; j++) { - seg = level[j]; - seg.row = 0; - seg.level = i; // not needed anymore - segs.push(seg); - } - } - return segs; - } - - - function compileSlotSegs(events) { - var colCnt = getColCnt(), - minMinute = getMinMinute(), - maxMinute = getMaxMinute(), - d = addMinutes(cloneDate(t.visStart), minMinute), - visEventEnds = $.map(events, slotEventEnd), - i, col, - j, level, - k, seg, - segs=[]; - for (i=0; i<colCnt; i++) { - col = stackSegs(sliceSegs(events, visEventEnds, d, addMinutes(cloneDate(d), maxMinute-minMinute))); - countForwardSegs(col); - for (j=0; j<col.length; j++) { - level = col[j]; - for (k=0; k<level.length; k++) { - seg = level[k]; - seg.col = i; - seg.level = j; - segs.push(seg); - } - } - addDays(d, 1, true); - } - return segs; - } - - - function slotEventEnd(event) { - if (event.end) { - return cloneDate(event.end); - }else{ - return addMinutes(cloneDate(event.start), opt('defaultEventMinutes')); - } - } - - - // renders events in the 'time slots' at the bottom - - function renderSlotSegs(segs, modifiedEventId) { - - var i, segCnt=segs.length, seg, - event, - classes, - top, bottom, - colI, levelI, forward, - leftmost, - availWidth, - outerWidth, - left, - html='', - eventElements, - eventElement, - triggerRes, - vsideCache={}, - hsideCache={}, - key, val, - contentElement, - height, - slotSegmentContainer = getSlotSegmentContainer(), - rtl, dis, dit, - colCnt = getColCnt(); - - if (rtl = opt('isRTL')) { - dis = -1; - dit = colCnt - 1; - }else{ - dis = 1; - dit = 0; - } - - // calculate position/dimensions, create html - for (i=0; i<segCnt; i++) { - seg = segs[i]; - event = seg.event; - top = timePosition(seg.start, seg.start); - bottom = timePosition(seg.start, seg.end); - colI = seg.col; - levelI = seg.level; - forward = seg.forward || 0; - leftmost = colContentLeft(colI*dis + dit); - availWidth = colContentRight(colI*dis + dit) - leftmost; - availWidth = Math.min(availWidth-6, availWidth*.95); // TODO: move this to CSS - if (levelI) { - // indented and thin - outerWidth = availWidth / (levelI + forward + 1); - }else{ - if (forward) { - // moderately wide, aligned left still - outerWidth = ((availWidth / (forward + 1)) - (12/2)) * 2; // 12 is the predicted width of resizer = - }else{ - // can be entire width, aligned left - outerWidth = availWidth; - } - } - left = leftmost + // leftmost possible - (availWidth / (levelI + forward + 1) * levelI) // indentation - * dis + (rtl ? availWidth - outerWidth : 0); // rtl - seg.top = top; - seg.left = left; - seg.outerWidth = outerWidth; - seg.outerHeight = bottom - top; - html += slotSegHtml(event, seg); - } - slotSegmentContainer[0].innerHTML = html; // faster than html() - eventElements = slotSegmentContainer.children(); - - // retrieve elements, run through eventRender callback, bind event handlers - for (i=0; i<segCnt; i++) { - seg = segs[i]; - event = seg.event; - eventElement = $(eventElements[i]); // faster than eq() - triggerRes = trigger('eventRender', event, event, eventElement); - if (triggerRes === false) { - eventElement.remove(); - }else{ - if (triggerRes && triggerRes !== true) { - eventElement.remove(); - eventElement = $(triggerRes) - .css({ - position: 'absolute', - top: seg.top, - left: seg.left - }) - .appendTo(slotSegmentContainer); - } - seg.element = eventElement; - if (event._id === modifiedEventId) { - bindSlotSeg(event, eventElement, seg); - }else{ - eventElement[0]._fci = i; // for lazySegBind - } - reportEventElement(event, eventElement); - } - } - - lazySegBind(slotSegmentContainer, segs, bindSlotSeg); - - // record event sides and title positions - for (i=0; i<segCnt; i++) { - seg = segs[i]; - if (eventElement = seg.element) { - val = vsideCache[key = seg.key = cssKey(eventElement[0])]; - seg.vsides = val === undefined ? (vsideCache[key] = vsides(eventElement, true)) : val; - val = hsideCache[key]; - seg.hsides = val === undefined ? (hsideCache[key] = hsides(eventElement, true)) : val; - contentElement = eventElement.find('div.fc-event-content'); - if (contentElement.length) { - seg.contentTop = contentElement[0].offsetTop; - } - } - } - - // set all positions/dimensions at once - for (i=0; i<segCnt; i++) { - seg = segs[i]; - if (eventElement = seg.element) { - eventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px'; - height = Math.max(0, seg.outerHeight - seg.vsides); - eventElement[0].style.height = height + 'px'; - event = seg.event; - if (seg.contentTop !== undefined && height - seg.contentTop < 10) { - // not enough room for title, put it in the time header - eventElement.find('div.fc-event-time') - .text(formatDate(event.start, opt('timeFormat')) + ' - ' + event.title); - eventElement.find('div.fc-event-title') - .remove(); - } - trigger('eventAfterRender', event, event, eventElement); - } - } - - } - - - function slotSegHtml(event, seg) { - var html = "<"; - var url = event.url; - var skinCss = getSkinCss(event, opt); - var skinCssAttr = (skinCss ? " style='" + skinCss + "'" : ''); - var classes = ['fc-event', 'fc-event-skin', 'fc-event-vert']; - if (isEventDraggable(event)) { - classes.push('fc-event-draggable'); - } - if (seg.isStart) { - classes.push('fc-corner-top'); - } - if (seg.isEnd) { - classes.push('fc-corner-bottom'); - } - classes = classes.concat(event.className); - if (event.source) { - classes = classes.concat(event.source.className || []); - } - if (url) { - html += "a href='" + htmlEscape(event.url) + "'"; - }else{ - html += "div"; - } - html += - " class='" + classes.join(' ') + "'" + - " style='position:absolute;z-index:8;top:" + seg.top + "px;left:" + seg.left + "px;" + skinCss + "'" + - ">" + - "<div class='fc-event-inner fc-event-skin'" + skinCssAttr + ">" + - "<div class='fc-event-head fc-event-skin'" + skinCssAttr + ">" + - "<div class='fc-event-time'>" + - htmlEscape(formatDates(event.start, event.end, opt('timeFormat'))) + - "</div>" + - "</div>" + - "<div class='fc-event-content'>" + - "<div class='fc-event-title'>" + - htmlEscape(event.title) + - "</div>" + - "</div>" + - "<div class='fc-event-bg'></div>" + - "</div>"; // close inner - if (seg.isEnd && isEventResizable(event)) { - html += - "<div class='ui-resizable-handle ui-resizable-s'>=</div>"; - } - html += - "</" + (url ? "a" : "div") + ">"; - return html; - } - - - function bindDaySeg(event, eventElement, seg) { - if (isEventDraggable(event)) { - draggableDayEvent(event, eventElement, seg.isStart); - } - if (seg.isEnd && isEventResizable(event)) { - resizableDayEvent(event, eventElement, seg); - } - eventElementHandlers(event, eventElement); - // needs to be after, because resizableDayEvent might stopImmediatePropagation on click - } - - - function bindSlotSeg(event, eventElement, seg) { - var timeElement = eventElement.find('div.fc-event-time'); - if (isEventDraggable(event)) { - draggableSlotEvent(event, eventElement, timeElement); - } - if (seg.isEnd && isEventResizable(event)) { - resizableSlotEvent(event, eventElement, timeElement); - } - eventElementHandlers(event, eventElement); - } - - - - /* Dragging - -----------------------------------------------------------------------------------*/ - - - // when event starts out FULL-DAY - - function draggableDayEvent(event, eventElement, isStart) { - var origWidth; - var revert; - var allDay=true; - var dayDelta; - var dis = opt('isRTL') ? -1 : 1; - var hoverListener = getHoverListener(); - var colWidth = getColWidth(); - var slotHeight = getSlotHeight(); - var minMinute = getMinMinute(); - eventElement.draggable({ - zIndex: 9, - opacity: opt('dragOpacity', 'month'), // use whatever the month view was using - revertDuration: opt('dragRevertDuration'), - start: function(ev, ui) { - trigger('eventDragStart', eventElement, event, ev, ui); - hideEvents(event, eventElement); - origWidth = eventElement.width(); - hoverListener.start(function(cell, origCell, rowDelta, colDelta) { - clearOverlays(); - if (cell) { - //setOverflowHidden(true); - revert = false; - dayDelta = colDelta * dis; - if (!cell.row) { - // on full-days - renderDayOverlay( - addDays(cloneDate(event.start), dayDelta), - addDays(exclEndDay(event), dayDelta) - ); - resetElement(); - }else{ - // mouse is over bottom slots - if (isStart) { - if (allDay) { - // convert event to temporary slot-event - eventElement.width(colWidth - 10); // don't use entire width - setOuterHeight( - eventElement, - slotHeight * Math.round( - (event.end ? ((event.end - event.start) / MINUTE_MS) : opt('defaultEventMinutes')) - / opt('slotMinutes') - ) - ); - eventElement.draggable('option', 'grid', [colWidth, 1]); - allDay = false; - } - }else{ - revert = true; - } - } - revert = revert || (allDay && !dayDelta); - }else{ - resetElement(); - //setOverflowHidden(false); - revert = true; - } - eventElement.draggable('option', 'revert', revert); - }, ev, 'drag'); - }, - stop: function(ev, ui) { - hoverListener.stop(); - clearOverlays(); - trigger('eventDragStop', eventElement, event, ev, ui); - if (revert) { - // hasn't moved or is out of bounds (draggable has already reverted) - resetElement(); - eventElement.css('filter', ''); // clear IE opacity side-effects - showEvents(event, eventElement); - }else{ - // changed! - var minuteDelta = 0; - if (!allDay) { - minuteDelta = Math.round((eventElement.offset().top - getBodyContent().offset().top) / slotHeight) - * opt('slotMinutes') - + minMinute - - (event.start.getHours() * 60 + event.start.getMinutes()); - } - eventDrop(this, event, dayDelta, minuteDelta, allDay, ev, ui); - } - //setOverflowHidden(false); - } - }); - function resetElement() { - if (!allDay) { - eventElement - .width(origWidth) - .height('') - .draggable('option', 'grid', null); - allDay = true; - } - } - } - - - // when event starts out IN TIMESLOTS - - function draggableSlotEvent(event, eventElement, timeElement) { - var origPosition; - var allDay=false; - var dayDelta; - var minuteDelta; - var prevMinuteDelta; - var dis = opt('isRTL') ? -1 : 1; - var hoverListener = getHoverListener(); - var colCnt = getColCnt(); - var colWidth = getColWidth(); - var slotHeight = getSlotHeight(); - eventElement.draggable({ - zIndex: 9, - scroll: false, - grid: [colWidth, slotHeight], - axis: colCnt==1 ? 'y' : false, - opacity: opt('dragOpacity'), - revertDuration: opt('dragRevertDuration'), - start: function(ev, ui) { - trigger('eventDragStart', eventElement, event, ev, ui); - hideEvents(event, eventElement); - origPosition = eventElement.position(); - minuteDelta = prevMinuteDelta = 0; - hoverListener.start(function(cell, origCell, rowDelta, colDelta) { - eventElement.draggable('option', 'revert', !cell); - clearOverlays(); - if (cell) { - dayDelta = colDelta * dis; - if (opt('allDaySlot') && !cell.row) { - // over full days - if (!allDay) { - // convert to temporary all-day event - allDay = true; - timeElement.hide(); - eventElement.draggable('option', 'grid', null); - } - renderDayOverlay( - addDays(cloneDate(event.start), dayDelta), - addDays(exclEndDay(event), dayDelta) - ); - }else{ - // on slots - resetElement(); - } - } - }, ev, 'drag'); - }, - drag: function(ev, ui) { - minuteDelta = Math.round((ui.position.top - origPosition.top) / slotHeight) * opt('slotMinutes'); - if (minuteDelta != prevMinuteDelta) { - if (!allDay) { - updateTimeText(minuteDelta); - } - prevMinuteDelta = minuteDelta; - } - }, - stop: function(ev, ui) { - var cell = hoverListener.stop(); - clearOverlays(); - trigger('eventDragStop', eventElement, event, ev, ui); - if (cell && (dayDelta || minuteDelta || allDay)) { - // changed! - eventDrop(this, event, dayDelta, allDay ? 0 : minuteDelta, allDay, ev, ui); - }else{ - // either no change or out-of-bounds (draggable has already reverted) - resetElement(); - eventElement.css('filter', ''); // clear IE opacity side-effects - eventElement.css(origPosition); // sometimes fast drags make event revert to wrong position - updateTimeText(0); - showEvents(event, eventElement); - } - } - }); - function updateTimeText(minuteDelta) { - var newStart = addMinutes(cloneDate(event.start), minuteDelta); - var newEnd; - if (event.end) { - newEnd = addMinutes(cloneDate(event.end), minuteDelta); - } - timeElement.text(formatDates(newStart, newEnd, opt('timeFormat'))); - } - function resetElement() { - // convert back to original slot-event - if (allDay) { - timeElement.css('display', ''); // show() was causing display=inline - eventElement.draggable('option', 'grid', [colWidth, slotHeight]); - allDay = false; - } - } - } - - - - /* Resizing - --------------------------------------------------------------------------------------*/ - - - function resizableSlotEvent(event, eventElement, timeElement) { - var slotDelta, prevSlotDelta; - var slotHeight = getSlotHeight(); - eventElement.resizable({ - handles: { - s: 'div.ui-resizable-s' - }, - grid: slotHeight, - start: function(ev, ui) { - slotDelta = prevSlotDelta = 0; - hideEvents(event, eventElement); - eventElement.css('z-index', 9); - trigger('eventResizeStart', this, event, ev, ui); - }, - resize: function(ev, ui) { - // don't rely on ui.size.height, doesn't take grid into account - slotDelta = Math.round((Math.max(slotHeight, eventElement.height()) - ui.originalSize.height) / slotHeight); - if (slotDelta != prevSlotDelta) { - timeElement.text( - formatDates( - event.start, - (!slotDelta && !event.end) ? null : // no change, so don't display time range - addMinutes(eventEnd(event), opt('slotMinutes')*slotDelta), - opt('timeFormat') - ) - ); - prevSlotDelta = slotDelta; - } - }, - stop: function(ev, ui) { - trigger('eventResizeStop', this, event, ev, ui); - if (slotDelta) { - eventResize(this, event, 0, opt('slotMinutes')*slotDelta, ev, ui); - }else{ - eventElement.css('z-index', 8); - showEvents(event, eventElement); - // BUG: if event was really short, need to put title back in span - } - } - }); - } - - -} - - -function countForwardSegs(levels) { - var i, j, k, level, segForward, segBack; - for (i=levels.length-1; i>0; i--) { - level = levels[i]; - for (j=0; j<level.length; j++) { - segForward = level[j]; - for (k=0; k<levels[i-1].length; k++) { - segBack = levels[i-1][k]; - if (segsCollide(segForward, segBack)) { - segBack.forward = Math.max(segBack.forward||0, (segForward.forward||0)+1); - } - } - } - } -} - - - - -function View(element, calendar, viewName) { - var t = this; - - - // exports - t.element = element; - t.calendar = calendar; - t.name = viewName; - t.opt = opt; - t.trigger = trigger; - //t.setOverflowHidden = setOverflowHidden; - t.isEventDraggable = isEventDraggable; - t.isEventResizable = isEventResizable; - t.reportEvents = reportEvents; - t.eventEnd = eventEnd; - t.reportEventElement = reportEventElement; - t.reportEventClear = reportEventClear; - t.eventElementHandlers = eventElementHandlers; - t.showEvents = showEvents; - t.hideEvents = hideEvents; - t.eventDrop = eventDrop; - t.eventResize = eventResize; - // t.title - // t.start, t.end - // t.visStart, t.visEnd - - - // imports - var defaultEventEnd = t.defaultEventEnd; - var normalizeEvent = calendar.normalizeEvent; // in EventManager - var reportEventChange = calendar.reportEventChange; - - - // locals - var eventsByID = {}; - var eventElements = []; - var eventElementsByID = {}; - var options = calendar.options; - - - - function opt(name, viewNameOverride) { - var v = options[name]; - if (typeof v == 'object') { - return smartProperty(v, viewNameOverride || viewName); - } - return v; - } - - - function trigger(name, thisObj) { - return calendar.trigger.apply( - calendar, - [name, thisObj || t].concat(Array.prototype.slice.call(arguments, 2), [t]) - ); - } - - - /* - function setOverflowHidden(bool) { - element.css('overflow', bool ? 'hidden' : ''); - } - */ - - - function isEventDraggable(event) { - return isEventEditable(event) && !opt('disableDragging'); - } - - - function isEventResizable(event) { // but also need to make sure the seg.isEnd == true - return isEventEditable(event) && !opt('disableResizing'); - } - - - function isEventEditable(event) { - return firstDefined(event.editable, (event.source || {}).editable, opt('editable')); - } - - - - /* Event Data - ------------------------------------------------------------------------------*/ - - - // report when view receives new events - function reportEvents(events) { // events are already normalized at this point - eventsByID = {}; - var i, len=events.length, event; - for (i=0; i<len; i++) { - event = events[i]; - if (eventsByID[event._id]) { - eventsByID[event._id].push(event); - }else{ - eventsByID[event._id] = [event]; - } - } - } - - - // returns a Date object for an event's end - function eventEnd(event) { - return event.end ? cloneDate(event.end) : defaultEventEnd(event); - } - - - - /* Event Elements - ------------------------------------------------------------------------------*/ - - - // report when view creates an element for an event - function reportEventElement(event, element) { - eventElements.push(element); - if (eventElementsByID[event._id]) { - eventElementsByID[event._id].push(element); - }else{ - eventElementsByID[event._id] = [element]; - } - } - - - function reportEventClear() { - eventElements = []; - eventElementsByID = {}; - } - - - // attaches eventClick, eventMouseover, eventMouseout - function eventElementHandlers(event, eventElement) { - eventElement - .click(function(ev) { - if (!eventElement.hasClass('ui-draggable-dragging') && - !eventElement.hasClass('ui-resizable-resizing')) { - return trigger('eventClick', this, event, ev); - } - }) - .hover( - function(ev) { - trigger('eventMouseover', this, event, ev); - }, - function(ev) { - trigger('eventMouseout', this, event, ev); - } - ); - // TODO: don't fire eventMouseover/eventMouseout *while* dragging is occuring (on subject element) - // TODO: same for resizing - } - - - function showEvents(event, exceptElement) { - eachEventElement(event, exceptElement, 'show'); - } - - - function hideEvents(event, exceptElement) { - eachEventElement(event, exceptElement, 'hide'); - } - - - function eachEventElement(event, exceptElement, funcName) { - var elements = eventElementsByID[event._id], - i, len = elements.length; - for (i=0; i<len; i++) { - if (!exceptElement || elements[i][0] != exceptElement[0]) { - elements[i][funcName](); - } - } - } - - - - /* Event Modification Reporting - ---------------------------------------------------------------------------------*/ - - - function eventDrop(e, event, dayDelta, minuteDelta, allDay, ev, ui) { - var oldAllDay = event.allDay; - var eventId = event._id; - moveEvents(eventsByID[eventId], dayDelta, minuteDelta, allDay); - trigger( - 'eventDrop', - e, - event, - dayDelta, - minuteDelta, - allDay, - function() { - // TODO: investigate cases where this inverse technique might not work - moveEvents(eventsByID[eventId], -dayDelta, -minuteDelta, oldAllDay); - reportEventChange(eventId); - }, - ev, - ui - ); - reportEventChange(eventId); - } - - - function eventResize(e, event, dayDelta, minuteDelta, ev, ui) { - var eventId = event._id; - elongateEvents(eventsByID[eventId], dayDelta, minuteDelta); - trigger( - 'eventResize', - e, - event, - dayDelta, - minuteDelta, - function() { - // TODO: investigate cases where this inverse technique might not work - elongateEvents(eventsByID[eventId], -dayDelta, -minuteDelta); - reportEventChange(eventId); - }, - ev, - ui - ); - reportEventChange(eventId); - } - - - - /* Event Modification Math - ---------------------------------------------------------------------------------*/ - - - function moveEvents(events, dayDelta, minuteDelta, allDay) { - minuteDelta = minuteDelta || 0; - for (var e, len=events.length, i=0; i<len; i++) { - e = events[i]; - if (allDay !== undefined) { - e.allDay = allDay; - } - addMinutes(addDays(e.start, dayDelta, true), minuteDelta); - if (e.end) { - e.end = addMinutes(addDays(e.end, dayDelta, true), minuteDelta); - } - normalizeEvent(e, options); - } - } - - - function elongateEvents(events, dayDelta, minuteDelta) { - minuteDelta = minuteDelta || 0; - for (var e, len=events.length, i=0; i<len; i++) { - e = events[i]; - e.end = addMinutes(addDays(eventEnd(e), dayDelta, true), minuteDelta); - normalizeEvent(e, options); - } - } - - -} - -function DayEventRenderer() { - var t = this; - - - // exports - t.renderDaySegs = renderDaySegs; - t.resizableDayEvent = resizableDayEvent; - - - // imports - var opt = t.opt; - var trigger = t.trigger; - var isEventDraggable = t.isEventDraggable; - var isEventResizable = t.isEventResizable; - var eventEnd = t.eventEnd; - var reportEventElement = t.reportEventElement; - var showEvents = t.showEvents; - var hideEvents = t.hideEvents; - var eventResize = t.eventResize; - var getRowCnt = t.getRowCnt; - var getColCnt = t.getColCnt; - var getColWidth = t.getColWidth; - var allDayRow = t.allDayRow; - var allDayBounds = t.allDayBounds; - var colContentLeft = t.colContentLeft; - var colContentRight = t.colContentRight; - var dayOfWeekCol = t.dayOfWeekCol; - var dateCell = t.dateCell; - var compileDaySegs = t.compileDaySegs; - var getDaySegmentContainer = t.getDaySegmentContainer; - var bindDaySeg = t.bindDaySeg; //TODO: streamline this - var formatDates = t.calendar.formatDates; - var renderDayOverlay = t.renderDayOverlay; - var clearOverlays = t.clearOverlays; - var clearSelection = t.clearSelection; - - - - /* Rendering - -----------------------------------------------------------------------------*/ - - - function renderDaySegs(segs, modifiedEventId) { - var segmentContainer = getDaySegmentContainer(); - var rowDivs; - var rowCnt = getRowCnt(); - var colCnt = getColCnt(); - var i = 0; - var rowI; - var levelI; - var colHeights; - var j; - var segCnt = segs.length; - var seg; - var top; - var k; - segmentContainer[0].innerHTML = daySegHTML(segs); // faster than .html() - daySegElementResolve(segs, segmentContainer.children()); - daySegElementReport(segs); - daySegHandlers(segs, segmentContainer, modifiedEventId); - daySegCalcHSides(segs); - daySegSetWidths(segs); - daySegCalcHeights(segs); - rowDivs = getRowDivs(); - // set row heights, calculate event tops (in relation to row top) - for (rowI=0; rowI<rowCnt; rowI++) { - levelI = 0; - colHeights = []; - for (j=0; j<colCnt; j++) { - colHeights[j] = 0; - } - while (i<segCnt && (seg = segs[i]).row == rowI) { - // loop through segs in a row - top = arrayMax(colHeights.slice(seg.startCol, seg.endCol)); - seg.top = top; - top += seg.outerHeight; - for (k=seg.startCol; k<seg.endCol; k++) { - colHeights[k] = top; - } - i++; - } - rowDivs[rowI].height(arrayMax(colHeights)); - } - daySegSetTops(segs, getRowTops(rowDivs)); - } - - - function renderTempDaySegs(segs, adjustRow, adjustTop) { - var tempContainer = $("<div/>"); - var elements; - var segmentContainer = getDaySegmentContainer(); - var i; - var segCnt = segs.length; - var element; - tempContainer[0].innerHTML = daySegHTML(segs); // faster than .html() - elements = tempContainer.children(); - segmentContainer.append(elements); - daySegElementResolve(segs, elements); - daySegCalcHSides(segs); - daySegSetWidths(segs); - daySegCalcHeights(segs); - daySegSetTops(segs, getRowTops(getRowDivs())); - elements = []; - for (i=0; i<segCnt; i++) { - element = segs[i].element; - if (element) { - if (segs[i].row === adjustRow) { - element.css('top', adjustTop); - } - elements.push(element[0]); - } - } - return $(elements); - } - - - function daySegHTML(segs) { // also sets seg.left and seg.outerWidth - var rtl = opt('isRTL'); - var i; - var segCnt=segs.length; - var seg; - var event; - var url; - var classes; - var bounds = allDayBounds(); - var minLeft = bounds.left; - var maxLeft = bounds.right; - var leftCol; - var rightCol; - var left; - var right; - var skinCss; - var html = ''; - // calculate desired position/dimensions, create html - for (i=0; i<segCnt; i++) { - seg = segs[i]; - event = seg.event; - classes = ['fc-event', 'fc-event-skin', 'fc-event-hori']; - if (isEventDraggable(event)) { - classes.push('fc-event-draggable'); - } - if (rtl) { - if (seg.isStart) { - classes.push('fc-corner-right'); - } - if (seg.isEnd) { - classes.push('fc-corner-left'); - } - leftCol = dayOfWeekCol(seg.end.getDay()-1); - rightCol = dayOfWeekCol(seg.start.getDay()); - left = seg.isEnd ? colContentLeft(leftCol) : minLeft; - right = seg.isStart ? colContentRight(rightCol) : maxLeft; - }else{ - if (seg.isStart) { - classes.push('fc-corner-left'); - } - if (seg.isEnd) { - classes.push('fc-corner-right'); - } - leftCol = dayOfWeekCol(seg.start.getDay()); - rightCol = dayOfWeekCol(seg.end.getDay()-1); - left = seg.isStart ? colContentLeft(leftCol) : minLeft; - right = seg.isEnd ? colContentRight(rightCol) : maxLeft; - } - classes = classes.concat(event.className); - if (event.source) { - classes = classes.concat(event.source.className || []); - } - url = event.url; - skinCss = getSkinCss(event, opt); - if (url) { - html += "<a href='" + htmlEscape(url) + "'"; - }else{ - html += "<div"; - } - html += - " class='" + classes.join(' ') + "'" + - " style='position:absolute;z-index:8;left:"+left+"px;" + skinCss + "'" + - ">" + - "<div" + - " class='fc-event-inner fc-event-skin'" + - (skinCss ? " style='" + skinCss + "'" : '') + - ">"; - if (!event.allDay && seg.isStart) { - html += - "<span class='fc-event-time'>" + - htmlEscape(formatDates(event.start, event.end, opt('timeFormat'))) + - "</span>"; - } - html += - "<span class='fc-event-title'>" + htmlEscape(event.title) + "</span>" + - "</div>"; - if (seg.isEnd && isEventResizable(event)) { - html += - "<div class='ui-resizable-handle ui-resizable-" + (rtl ? 'w' : 'e') + "'>" + - " " + // makes hit area a lot better for IE6/7 - "</div>"; - } - html += - "</" + (url ? "a" : "div" ) + ">"; - seg.left = left; - seg.outerWidth = right - left; - seg.startCol = leftCol; - seg.endCol = rightCol + 1; // needs to be exclusive - } - return html; - } - - - function daySegElementResolve(segs, elements) { // sets seg.element - var i; - var segCnt = segs.length; - var seg; - var event; - var element; - var triggerRes; - for (i=0; i<segCnt; i++) { - seg = segs[i]; - event = seg.event; - element = $(elements[i]); // faster than .eq() - triggerRes = trigger('eventRender', event, event, element); - if (triggerRes === false) { - element.remove(); - }else{ - if (triggerRes && triggerRes !== true) { - triggerRes = $(triggerRes) - .css({ - position: 'absolute', - left: seg.left - }); - element.replaceWith(triggerRes); - element = triggerRes; - } - seg.element = element; - } - } - } - - - function daySegElementReport(segs) { - var i; - var segCnt = segs.length; - var seg; - var element; - for (i=0; i<segCnt; i++) { - seg = segs[i]; - element = seg.element; - if (element) { - reportEventElement(seg.event, element); - } - } - } - - - function daySegHandlers(segs, segmentContainer, modifiedEventId) { - var i; - var segCnt = segs.length; - var seg; - var element; - var event; - // retrieve elements, run through eventRender callback, bind handlers - for (i=0; i<segCnt; i++) { - seg = segs[i]; - element = seg.element; - if (element) { - event = seg.event; - if (event._id === modifiedEventId) { - bindDaySeg(event, element, seg); - }else{ - element[0]._fci = i; // for lazySegBind - } - } - } - lazySegBind(segmentContainer, segs, bindDaySeg); - } - - - function daySegCalcHSides(segs) { // also sets seg.key - var i; - var segCnt = segs.length; - var seg; - var element; - var key, val; - var hsideCache = {}; - // record event horizontal sides - for (i=0; i<segCnt; i++) { - seg = segs[i]; - element = seg.element; - if (element) { - key = seg.key = cssKey(element[0]); - val = hsideCache[key]; - if (val === undefined) { - val = hsideCache[key] = hsides(element, true); - } - seg.hsides = val; - } - } - } - - - function daySegSetWidths(segs) { - var i; - var segCnt = segs.length; - var seg; - var element; - for (i=0; i<segCnt; i++) { - seg = segs[i]; - element = seg.element; - if (element) { - element[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px'; - } - } - } - - - function daySegCalcHeights(segs) { - var i; - var segCnt = segs.length; - var seg; - var element; - var key, val; - var vmarginCache = {}; - // record event heights - for (i=0; i<segCnt; i++) { - seg = segs[i]; - element = seg.element; - if (element) { - key = seg.key; // created in daySegCalcHSides - val = vmarginCache[key]; - if (val === undefined) { - val = vmarginCache[key] = vmargins(element); - } - seg.outerHeight = element[0].offsetHeight + val; - } - } - } - - - function getRowDivs() { - var i; - var rowCnt = getRowCnt(); - var rowDivs = []; - for (i=0; i<rowCnt; i++) { - rowDivs[i] = allDayRow(i) - .find('td:first div.fc-day-content > div'); // optimal selector? - } - return rowDivs; - } - - - function getRowTops(rowDivs) { - var i; - var rowCnt = rowDivs.length; - var tops = []; - for (i=0; i<rowCnt; i++) { - tops[i] = rowDivs[i][0].offsetTop; // !!?? but this means the element needs position:relative if in a table cell!!!! - } - return tops; - } - - - function daySegSetTops(segs, rowTops) { // also triggers eventAfterRender - var i; - var segCnt = segs.length; - var seg; - var element; - var event; - for (i=0; i<segCnt; i++) { - seg = segs[i]; - element = seg.element; - if (element) { - element[0].style.top = rowTops[seg.row] + (seg.top||0) + 'px'; - event = seg.event; - trigger('eventAfterRender', event, event, element); - } - } - } - - - - /* Resizing - -----------------------------------------------------------------------------------*/ - - - function resizableDayEvent(event, element, seg) { - var rtl = opt('isRTL'); - var direction = rtl ? 'w' : 'e'; - var handle = element.find('div.ui-resizable-' + direction); - var isResizing = false; - - // TODO: look into using jquery-ui mouse widget for this stuff - disableTextSelection(element); // prevent native <a> selection for IE - element - .mousedown(function(ev) { // prevent native <a> selection for others - ev.preventDefault(); - }) - .click(function(ev) { - if (isResizing) { - ev.preventDefault(); // prevent link from being visited (only method that worked in IE6) - ev.stopImmediatePropagation(); // prevent fullcalendar eventClick handler from being called - // (eventElementHandlers needs to be bound after resizableDayEvent) - } - }); - - handle.mousedown(function(ev) { - if (ev.which != 1) { - return; // needs to be left mouse button - } - isResizing = true; - var hoverListener = t.getHoverListener(); - var rowCnt = getRowCnt(); - var colCnt = getColCnt(); - var dis = rtl ? -1 : 1; - var dit = rtl ? colCnt-1 : 0; - var elementTop = element.css('top'); - var dayDelta; - var helpers; - var eventCopy = $.extend({}, event); - var minCell = dateCell(event.start); - clearSelection(); - $('body') - .css('cursor', direction + '-resize') - .one('mouseup', mouseup); - trigger('eventResizeStart', this, event, ev); - hoverListener.start(function(cell, origCell) { - if (cell) { - var r = Math.max(minCell.row, cell.row); - var c = cell.col; - if (rowCnt == 1) { - r = 0; // hack for all-day area in agenda views - } - if (r == minCell.row) { - if (rtl) { - c = Math.min(minCell.col, c); - }else{ - c = Math.max(minCell.col, c); - } - } - dayDelta = (r*7 + c*dis+dit) - (origCell.row*7 + origCell.col*dis+dit); - var newEnd = addDays(eventEnd(event), dayDelta, true); - if (dayDelta) { - eventCopy.end = newEnd; - var oldHelpers = helpers; - helpers = renderTempDaySegs(compileDaySegs([eventCopy]), seg.row, elementTop); - helpers.find('*').css('cursor', direction + '-resize'); - if (oldHelpers) { - oldHelpers.remove(); - } - hideEvents(event); - }else{ - if (helpers) { - showEvents(event); - helpers.remove(); - helpers = null; - } - } - clearOverlays(); - renderDayOverlay(event.start, addDays(cloneDate(newEnd), 1)); // coordinate grid already rebuild at hoverListener.start - } - }, ev); - - function mouseup(ev) { - trigger('eventResizeStop', this, event, ev); - $('body').css('cursor', ''); - hoverListener.stop(); - clearOverlays(); - if (dayDelta) { - eventResize(this, event, dayDelta, 0, ev); - // event redraw will clear helpers - } - // otherwise, the drag handler already restored the old events - - setTimeout(function() { // make this happen after the element's click event - isResizing = false; - },0); - } - - }); - } - - -} - -//BUG: unselect needs to be triggered when events are dragged+dropped - -function SelectionManager() { - var t = this; - - - // exports - t.select = select; - t.unselect = unselect; - t.reportSelection = reportSelection; - t.daySelectionMousedown = daySelectionMousedown; - - - // imports - var opt = t.opt; - var trigger = t.trigger; - var defaultSelectionEnd = t.defaultSelectionEnd; - var renderSelection = t.renderSelection; - var clearSelection = t.clearSelection; - - - // locals - var selected = false; - - - - // unselectAuto - if (opt('selectable') && opt('unselectAuto')) { - $(document).mousedown(function(ev) { - var ignore = opt('unselectCancel'); - if (ignore) { - if ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match - return; - } - } - unselect(ev); - }); - } - - - function select(startDate, endDate, allDay) { - unselect(); - if (!endDate) { - endDate = defaultSelectionEnd(startDate, allDay); - } - renderSelection(startDate, endDate, allDay); - reportSelection(startDate, endDate, allDay); - } - - - function unselect(ev) { - if (selected) { - selected = false; - clearSelection(); - trigger('unselect', null, ev); - } - } - - - function reportSelection(startDate, endDate, allDay, ev) { - selected = true; - trigger('select', null, startDate, endDate, allDay, ev); - } - - - function daySelectionMousedown(ev) { // not really a generic manager method, oh well - var cellDate = t.cellDate; - var cellIsAllDay = t.cellIsAllDay; - var hoverListener = t.getHoverListener(); - var reportDayClick = t.reportDayClick; // this is hacky and sort of weird - if (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button - unselect(ev); - var _mousedownElement = this; - var dates; - hoverListener.start(function(cell, origCell) { // TODO: maybe put cellDate/cellIsAllDay info in cell - clearSelection(); - if (cell && cellIsAllDay(cell)) { - dates = [ cellDate(origCell), cellDate(cell) ].sort(cmp); - renderSelection(dates[0], dates[1], true); - }else{ - dates = null; - } - }, ev); - $(document).one('mouseup', function(ev) { - hoverListener.stop(); - if (dates) { - if (+dates[0] == +dates[1]) { - reportDayClick(dates[0], true, ev); - } - reportSelection(dates[0], dates[1], true, ev); - } - }); - } - } - - -} - -function OverlayManager() { - var t = this; - - - // exports - t.renderOverlay = renderOverlay; - t.clearOverlays = clearOverlays; - - - // locals - var usedOverlays = []; - var unusedOverlays = []; - - - function renderOverlay(rect, parent) { - var e = unusedOverlays.shift(); - if (!e) { - e = $("<div class='fc-cell-overlay' style='position:absolute;z-index:3'/>"); - } - if (e[0].parentNode != parent[0]) { - e.appendTo(parent); - } - usedOverlays.push(e.css(rect).show()); - return e; - } - - - function clearOverlays() { - var e; - while (e = usedOverlays.shift()) { - unusedOverlays.push(e.hide().unbind()); - } - } - - -} - -function CoordinateGrid(buildFunc) { - - var t = this; - var rows; - var cols; - - - t.build = function() { - rows = []; - cols = []; - buildFunc(rows, cols); - }; - - - t.cell = function(x, y) { - var rowCnt = rows.length; - var colCnt = cols.length; - var i, r=-1, c=-1; - for (i=0; i<rowCnt; i++) { - if (y >= rows[i][0] && y < rows[i][1]) { - r = i; - break; - } - } - for (i=0; i<colCnt; i++) { - if (x >= cols[i][0] && x < cols[i][1]) { - c = i; - break; - } - } - return (r>=0 && c>=0) ? { row:r, col:c } : null; - }; - - - t.rect = function(row0, col0, row1, col1, originElement) { // row1,col1 is inclusive - var origin = originElement.offset(); - return { - top: rows[row0][0] - origin.top, - left: cols[col0][0] - origin.left, - width: cols[col1][1] - cols[col0][0], - height: rows[row1][1] - rows[row0][0] - }; - }; - -} - -function HoverListener(coordinateGrid) { - - - var t = this; - var bindType; - var change; - var firstCell; - var cell; - - - t.start = function(_change, ev, _bindType) { - change = _change; - firstCell = cell = null; - coordinateGrid.build(); - mouse(ev); - bindType = _bindType || 'mousemove'; - $(document).bind(bindType, mouse); - }; - - - function mouse(ev) { - _fixUIEvent(ev); // see below - var newCell = coordinateGrid.cell(ev.pageX, ev.pageY); - if (!newCell != !cell || newCell && (newCell.row != cell.row || newCell.col != cell.col)) { - if (newCell) { - if (!firstCell) { - firstCell = newCell; - } - change(newCell, firstCell, newCell.row-firstCell.row, newCell.col-firstCell.col); - }else{ - change(newCell, firstCell); - } - cell = newCell; - } - } - - - t.stop = function() { - $(document).unbind(bindType, mouse); - return cell; - }; - - -} - - - -// this fix was only necessary for jQuery UI 1.8.16 (and jQuery 1.7 or 1.7.1) -// upgrading to jQuery UI 1.8.17 (and using either jQuery 1.7 or 1.7.1) fixed the problem -// but keep this in here for 1.8.16 users -// and maybe remove it down the line - -function _fixUIEvent(event) { // for issue 1168 - if (event.pageX === undefined) { - event.pageX = event.originalEvent.pageX; - event.pageY = event.originalEvent.pageY; - } -} -function HorizontalPositionCache(getElement) { - - var t = this, - elements = {}, - lefts = {}, - rights = {}; - - function e(i) { - return elements[i] = elements[i] || getElement(i); - } - - t.left = function(i) { - return lefts[i] = lefts[i] === undefined ? e(i).position().left : lefts[i]; - }; - - t.right = function(i) { - return rights[i] = rights[i] === undefined ? t.left(i) + e(i).width() : rights[i]; - }; - - t.clear = function() { - elements = {}; - lefts = {}; - rights = {}; - }; - -} - -})(jQuery); - -//</script> diff --git a/views/default/js/event_calendar/gcal.js b/views/default/js/event_calendar/gcal.js deleted file mode 100644 index e9bbe26d8..000000000 --- a/views/default/js/event_calendar/gcal.js +++ /dev/null @@ -1,112 +0,0 @@ -/* - * FullCalendar v1.5.3 Google Calendar Plugin - * - * Copyright (c) 2011 Adam Shaw - * Dual licensed under the MIT and GPL licenses, located in - * MIT-LICENSE.txt and GPL-LICENSE.txt respectively. - * - * Date: Mon Feb 6 22:40:40 2012 -0800 - * - */ - -(function($) { - - -var fc = $.fullCalendar; -var formatDate = fc.formatDate; -var parseISO8601 = fc.parseISO8601; -var addDays = fc.addDays; -var applyAll = fc.applyAll; - - -fc.sourceNormalizers.push(function(sourceOptions) { - if (sourceOptions.dataType == 'gcal' || - sourceOptions.dataType === undefined && - (sourceOptions.url || '').match(/^(http|https):\/\/www.google.com\/calendar\/feeds\//)) { - sourceOptions.dataType = 'gcal'; - if (sourceOptions.editable === undefined) { - sourceOptions.editable = false; - } - } -}); - - -fc.sourceFetchers.push(function(sourceOptions, start, end) { - if (sourceOptions.dataType == 'gcal') { - return transformOptions(sourceOptions, start, end); - } -}); - - -function transformOptions(sourceOptions, start, end) { - - var success = sourceOptions.success; - var data = $.extend({}, sourceOptions.data || {}, { - 'start-min': formatDate(start, 'u'), - 'start-max': formatDate(end, 'u'), - 'singleevents': true, - 'max-results': 9999 - }); - - var ctz = sourceOptions.currentTimezone; - if (ctz) { - data.ctz = ctz = ctz.replace(' ', '_'); - } - - return $.extend({}, sourceOptions, { - url: sourceOptions.url.replace(/\/basic$/, '/full') + '?alt=json-in-script&callback=?', - dataType: 'jsonp', - data: data, - startParam: false, - endParam: false, - success: function(data) { - var events = []; - if (data.feed.entry) { - $.each(data.feed.entry, function(i, entry) { - var startStr = entry['gd$when'][0]['startTime']; - var start = parseISO8601(startStr, true); - var end = parseISO8601(entry['gd$when'][0]['endTime'], true); - var allDay = startStr.indexOf('T') == -1; - var url; - $.each(entry.link, function(i, link) { - if (link.type == 'text/html') { - url = link.href; - if (ctz) { - url += (url.indexOf('?') == -1 ? '?' : '&') + 'ctz=' + ctz; - } - } - }); - if (allDay) { - addDays(end, -1); // make inclusive - } - events.push({ - id: entry['gCal$uid']['value'], - title: entry['title']['$t'], - url: url, - start: start, - end: end, - allDay: allDay, - location: entry['gd$where'][0]['valueString'], - description: entry['content']['$t'] - }); - }); - } - var args = [events].concat(Array.prototype.slice.call(arguments, 1)); - var res = applyAll(success, this, args); - if ($.isArray(res)) { - return res; - } - return events; - } - }); - -} - - -// legacy -fc.gcalFeed = function(url, sourceOptions) { - return $.extend({}, sourceOptions, { url: url, dataType: 'gcal' }); -}; - - -})(jQuery); diff --git a/views/default/js/initialise_elgg.php b/views/default/js/initialise_elgg.php new file mode 100644 index 000000000..3d617953a --- /dev/null +++ b/views/default/js/initialise_elgg.php @@ -0,0 +1,4 @@ +<?php +/** + * 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 new file mode 100644 index 000000000..c51d7bcb2 --- /dev/null +++ b/views/default/js/languages.php @@ -0,0 +1,15 @@ +<?php +/** + * @uses $vars['language'] + */ +global $CONFIG; + +$language = $vars['language']; + +$translations = $CONFIG->translations['en']; + +if ($language != 'en') { + $translations = array_merge($translations, $CONFIG->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 new file mode 100644 index 000000000..8a604cc12 --- /dev/null +++ b/views/default/js/languages/en.php @@ -0,0 +1,2 @@ +<?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/walled_garden.php b/views/default/js/walled_garden.php new file mode 100644 index 000000000..7a482fe23 --- /dev/null +++ b/views/default/js/walled_garden.php @@ -0,0 +1,57 @@ +<?php +/** + * Walled garden JavaScript + * + * @since 1.8 + */ + +// note that this assumes the button view is not using single quotes +$cancel_button = elgg_view('input/button', array( + 'value' => elgg_echo('cancel'), + 'class' => 'elgg-button-cancel mlm', +)); +$cancel_button = trim($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) { + if ($('.elgg-walledgarden-single').is(':visible')) { + $('.elgg-walledgarden-double').fadeToggle(); + $('.elgg-walledgarden-single').fadeToggle(); + $('.elgg-walledgarden-single').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('_', '-'); + elgg.get('walled_garden/' + view, { + 'success' : function(data) { + $('.elgg-body-walledgarden').append(data); + $(id).find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>'); + $('#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/navigation/breadcrumbs.php b/views/default/navigation/breadcrumbs.php new file mode 100644 index 000000000..88577a8ff --- /dev/null +++ b/views/default/navigation/breadcrumbs.php @@ -0,0 +1,41 @@ +<?php +/** + * Displays breadcrumbs. + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['breadcrumbs'] (Optional) Array of arrays with keys 'title' and 'link' + * @uses $vars['class'] + * + * @see elgg_push_breadcrumb + */ + +if (isset($vars['breadcrumbs'])) { + $breadcrumbs = $vars['breadcrumbs']; +} else { + $breadcrumbs = elgg_get_breadcrumbs(); +} + +$class = 'elgg-menu elgg-breadcrumbs'; +$additional_class = elgg_extract('class', $vars, ''); +if ($additional_class) { + $class = "$class $additional_class"; +} + +if (is_array($breadcrumbs) && count($breadcrumbs) > 0) { + echo "<ul class=\"$class\">"; + foreach ($breadcrumbs as $breadcrumb) { + if (!empty($breadcrumb['link'])) { + $crumb = elgg_view('output/url', array( + 'href' => $breadcrumb['link'], + 'text' => $breadcrumb['title'], + 'is_trusted' => true, + )); + } else { + $crumb = $breadcrumb['title']; + } + echo "<li>$crumb</li>"; + } + echo '</ul>'; +} 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 new file mode 100644 index 000000000..04044c51c --- /dev/null +++ b/views/default/navigation/pagination.php @@ -0,0 +1,132 @@ +<?php +/** + * Elgg pagination + * + * @package Elgg + * @subpackage Core + * + * @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 + */ + +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_extract('limit', $vars, 10)) { + $limit = 10; +} + +$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; + } + + $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; + } + + $pages->items = range($first_page, $current_page - 1); +} + + +$pages->items[] = $current_page; + + +// add pages after the current one +if ($current_page < $total_pages) { + $next_offset = $offset + $limit; + if ($next_offset >= $count) { + $next_offset--; + } + + $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; + } + + $pages->items = array_merge($pages->items, range($current_page + 1, $last_page)); +} + + +echo '<ul class="elgg-pagination">'; + +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>"; +} + +echo '</ul>'; diff --git a/views/default/navigation/tabs.php b/views/default/navigation/tabs.php new file mode 100644 index 000000000..95e3f2669 --- /dev/null +++ b/views/default/navigation/tabs.php @@ -0,0 +1,81 @@ +<?php +/** + * Tab navigation + * + * @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( + * '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'); + +if ($type == 'horizontal') { + $options['class'] = "elgg-tabs elgg-htabs"; +} else { + $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 <?php echo $attributes; ?>> + <?php + foreach ($vars['tabs'] as $info) { + $class = elgg_extract('class', $info, ''); + $id = elgg_extract('id', $info, ''); + + $selected = elgg_extract('selected', $info, FALSE); + if ($selected) { + $class .= ' elgg-state-selected'; + } + + $class_str = ($class) ? "class=\"$class\"" : ''; + $id_str = ($id) ? "id=\"$id\"" : ''; + + $options = $info; + unset($options['class']); + unset($options['id']); + unset($options['selected']); + + 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']); + } + + if (isset($info['link_id'])) { + $options['id'] = $options['link_id']; + unset($options['link_id']); + } + + $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 new file mode 100644 index 000000000..307f03fc6 --- /dev/null +++ b/views/default/navigation/topbar_tools.php @@ -0,0 +1,9 @@ +<?php +/** + * Empty view for backward compatibility. + * + * @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 new file mode 100644 index 000000000..6dfa4ebc7 --- /dev/null +++ b/views/default/navigation/viewtype.php @@ -0,0 +1,11 @@ +<?php +/** + * Elgg list view switcher + * + * @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', 1.8); diff --git a/views/default/object/admin_notice.php b/views/default/object/admin_notice.php new file mode 100644 index 000000000..11524567e --- /dev/null +++ b/views/default/object/admin_notice.php @@ -0,0 +1,20 @@ +<?php +/** + * A persistent admin notice to be displayed on all admin pages until cleared. + */ + +if (isset($vars['entity']) && elgg_instanceof($vars['entity'], 'object', 'admin_notice')) { + $notice = $vars['entity']; + $message = $notice->description; + + $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 new file mode 100644 index 000000000..110648304 --- /dev/null +++ b/views/default/object/default.php @@ -0,0 +1,49 @@ +<?php +/** + * ElggObject default view. + * + * @warning This view may be used for other ElggEntity objects + * + * @package Elgg + * @subpackage Core + */ + +$icon = elgg_view_entity_icon($vars['entity'], 'small'); + +$title = $vars['entity']->title; +if (!$title) { + $title = $vars['entity']->name; +} +if (!$title) { + $title = get_class($vars['entity']); +} + +if (elgg_instanceof($vars['entity'], 'object')) { + $metadata = elgg_view('navigation/menu/metadata', $vars); +} + +$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, + 'tags' => $vars['entity']->tags, +); +$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..9b89f9706 --- /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 $class"; +} else { + $class = "elgg-content"; +} + +$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..c0f3ad340 --- /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' => $text, + '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/event_calendar.php b/views/default/object/event_calendar.php deleted file mode 100644 index 17f7ff130..000000000 --- a/views/default/object/event_calendar.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php - -/** - * Elgg event_calendar object view - * - * @package event_calendar - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Kevin Jardine <kevin@radagast.biz> - * @copyright Radagast Solutions 2008 - * @link http://radagast.biz/ - * - */ - -elgg_load_library('elgg:event_calendar'); - -$event = $vars['entity']; -$full = elgg_extract('full_view', $vars, FALSE); - -if ($full) { - $body = elgg_view('event_calendar/strapline',$vars); - if ($event->web_conference) { - $body .= '<br />'; - $body .= elgg_view('event_calendar/conference_button',array('event'=>$event)); - } - $event_items = event_calendar_get_formatted_full_items($event); - $body .= '<br />'; - - foreach($event_items as $item) { - $value = $item->value; - if (!empty($value)) { - - //This function controls the alternating class - $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; - $body .= "<p class=\"{$even_odd}\"><b>"; - $body .= $item->title.':</b> '; - $body .= $item->value; - } - } - $metadata = elgg_view_menu('entity', array( - 'entity' => $event, - 'handler' => 'event_calendar', - 'sort_by' => 'priority', - 'class' => 'elgg-menu-hz', - )); - - $tags = elgg_view('output/tags', array('tags' => $event->tags)); - - $params = array( - 'entity' => $event, - 'metadata' => $metadata, - 'tags' => $tags, - 'title' => false, - ); - $list_body = elgg_view('object/elements/summary', $params); - echo $list_body; - echo $body; - if ($event->long_description) { - echo '<div class="elgg-output">'.$event->long_description.'</div>'; - } else { - echo '<div class="elgg-output">'.$event->description.'</div>'; - } - if ($vars['light_box'] == TRUE) { - $event_calendar_add_users = elgg_get_plugin_setting('add_users', 'event_calendar'); - if ($event_calendar_add_users == 'yes') { - $url = "event_calendar/manage_users/$event->guid"; - echo '<p>'.elgg_view('output/url',array('text'=> elgg_echo('event_calendar:manage_users:breadcrumb'), 'href'=>$url)).'</p>'; - } - } - if (elgg_get_plugin_setting('add_to_group_calendar', 'event_calendar') == 'yes') { - echo elgg_view('event_calendar/forms/add_to_group',array('event' => $event)); - } - -} else { - - $time_bit = event_calendar_get_formatted_time($event); - $icon = '<img src="'.elgg_view("icon/object/event_calendar/small").'" />'; - $extras = array($time_bit); - if ($event->description) { - $extras[] = $event->description; - } - - if ($event_calendar_venue_view = elgg_get_plugin_setting('venue_view', 'event_calendar') == 'yes') { - $extras[] = $event->venue; - } - if ($extras) { - $info = "<p>".implode("<br />",$extras)."</p>"; - } else { - $info = ''; - } - - if (elgg_in_context('widgets')) { - $metadata = ''; - } else { - $metadata = elgg_view_menu('entity', array( - 'entity' => $event, - 'handler' => 'event_calendar', - 'sort_by' => 'priority', - 'class' => 'elgg-menu-hz', - )); - } - - $tags = elgg_view('output/tags', array('tags' => $event->tags)); - - $params = array( - 'entity' => $event, - 'metadata' => $metadata, - 'subtitle' => $info, - 'tags' => $tags, - ); - $list_body = elgg_view('object/elements/summary', $params); - - echo elgg_view_image_block($icon, $list_body); -} - -?> diff --git a/views/default/object/plugin.php b/views/default/object/plugin.php new file mode 100644 index 000000000..5c7138e96 --- /dev/null +++ b/views/default/object/plugin.php @@ -0,0 +1,20 @@ +<?php +/** + * Used to show plugin user settings. + * + * @package Elgg.Core + * @subpackage Plugins + * + */ + +if (!elgg_in_context('admin')) { + forward('/', 403); +} + +$plugin = $vars['entity']; + +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 new file mode 100644 index 000000000..0c7994f2b --- /dev/null +++ b/views/default/object/widget.php @@ -0,0 +1,75 @@ +<?php +/** + * Widget object + * + * @uses $vars['entity'] ElggWidget + * @uses $vars['show_access'] Show the access control in edit area? (true) + */ + +$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 new file mode 100644 index 000000000..91c5c721e --- /dev/null +++ b/views/default/output/access.php @@ -0,0 +1,42 @@ +<?php +/** + * Displays HTML for entity access levels. + * Requires an entity because some special logic for containers is used. + * + * @uses int $vars['entity'] - The entity whose access ID to display. + */ + +//sort out the access level for display +if (isset($vars['entity']) && elgg_instanceof($vars['entity'])) { + $access_id = $vars['entity']->access_id; + $access_class = 'elgg-access'; + $access_id_string = get_readable_access_level($access_id); + $access_id_string = htmlentities($access_id_string, ENT_QUOTES, 'UTF-8'); + + // 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 = $vars['entity']->getContainerEntity(); + + 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 = $container->membership; + + if ($membership == ACCESS_PUBLIC) { + $access_class .= ' elgg-access-group-open'; + } else { + $access_class .= ' elgg-access-group-closed'; + } + + // @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_class .= ' elgg-access-private'; + } + + $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 new file mode 100644 index 000000000..fa0bd0c04 --- /dev/null +++ b/views/default/output/calendar.php @@ -0,0 +1,13 @@ +<?php +/** + * Elgg calendar output + * Displays a calendar output field + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['value'] The current value, if any + * + */ +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/checkboxes.php b/views/default/output/checkboxes.php new file mode 100644 index 000000000..56d2588ac --- /dev/null +++ b/views/default/output/checkboxes.php @@ -0,0 +1,13 @@ +<?php +/** + * Elgg text output + * Displays some text that was input using a standard text field + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['text'] The text to display + * + */ + +echo elgg_view('output/tags',$vars);
\ No newline at end of file diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php new file mode 100644 index 000000000..532790a38 --- /dev/null +++ b/views/default/output/confirmlink.php @@ -0,0 +1,47 @@ +<?php +/** + * Elgg confirmation link + * A link that displays a confirmation dialog before it executes + * + * @package Elgg + * @subpackage Core + * + * @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) + */ + +$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 +$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['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 { + $vars['class'] = 'elgg-requires-confirmation'; +} + +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 new file mode 100644 index 000000000..1644a3480 --- /dev/null +++ b/views/default/output/date.php @@ -0,0 +1,17 @@ +<?php +/** + * Date + * Displays a properly formatted date + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['value'] Date as text or a Unix timestamp in seconds + */ + +// 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 new file mode 100644 index 000000000..f5a8bc4b8 --- /dev/null +++ b/views/default/output/email.php @@ -0,0 +1,17 @@ +<?php +/** + * Elgg email output + * Displays an email address that was entered using an email input field + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['value'] The email address to display + * + */ + +$encoded_value = htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8'); + +if (!empty($vars['value'])) { + echo "<a href=\"mailto:$encoded_value\">$encoded_value</a>"; +}
\ No newline at end of file diff --git a/views/default/output/friendlytime.php b/views/default/output/friendlytime.php new file mode 100644 index 000000000..22f60d517 --- /dev/null +++ b/views/default/output/friendlytime.php @@ -0,0 +1,12 @@ +<?php +/** + * Friendly time + * Translates an epoch time into a human-readable time. + * + * @uses string $vars['time'] Unix-style epoch timestamp + */ + +$friendly_time = elgg_get_friendly_time($vars['time']); +$timestamp = htmlspecialchars(date(elgg_echo('friendlytime:date_format'), $vars['time'])); + +echo "<acronym title=\"$timestamp\">$friendly_time</acronym>"; diff --git a/views/default/output/friendlytitle.php b/views/default/output/friendlytitle.php new file mode 100644 index 000000000..fbc4f39de --- /dev/null +++ b/views/default/output/friendlytitle.php @@ -0,0 +1,19 @@ +<?php +/** + * Friendly title + * Makes a URL-friendly title. + * + * @uses string $vars['title'] Title to create from. + */ + + +$title = $vars['title']; + +//$title = iconv('UTF-8', 'ASCII//TRANSLIT', $title); +$title = preg_replace("/[^\w ]/","",$title); +$title = str_replace(" ","-",$title); +$title = str_replace("--","-",$title); +$title = trim($title); +$title = strtolower($title); + +echo $title; diff --git a/views/default/output/iframe.php b/views/default/output/iframe.php new file mode 100644 index 000000000..7df9332f1 --- /dev/null +++ b/views/default/output/iframe.php @@ -0,0 +1,13 @@ +<?php +/** + * Display a page in an embedded window + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['value'] Source of the page + * + */ +?> +<iframe src="<?php echo $vars['value']; ?>"> +</iframe>
\ 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 new file mode 100644 index 000000000..589100c4f --- /dev/null +++ b/views/default/output/longtext.php @@ -0,0 +1,38 @@ +<?php +/** + * Elgg display long text + * Displays a large amount of text, with new lines converted to line breaks + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['value'] The text to display + * @uses $vars['parse_urls'] Whether to turn urls into links. Default is true. + * @uses $vars['class'] + */ + +$class = 'elgg-output'; +$additional_class = elgg_extract('class', $vars, ''); +if ($additional_class) { + $vars['class'] = "$class $additional_class"; +} else { + $vars['class'] = $class; +} + +$parse_urls = elgg_extract('parse_urls', $vars, true); +unset($vars['parse_urls']); + +$text = $vars['value']; +unset($vars['value']); + +if ($parse_urls) { + $text = parse_urls($text); +} + +$text = filter_tags($text); + +$text = elgg_autop($text); + +$attributes = elgg_format_attributes($vars); + +echo "<div $attributes>$text</div>"; diff --git a/views/default/output/pulldown.php b/views/default/output/pulldown.php new file mode 100644 index 000000000..7097a9a8d --- /dev/null +++ b/views/default/output/pulldown.php @@ -0,0 +1,14 @@ +<?php +/** + * Elgg pulldown display + * Displays a value that was entered into the system via a pulldown + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['text'] The text to display + * + * @deprecated 1.8 Use output/dropdown + */ + +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 new file mode 100644 index 000000000..0fae9977b --- /dev/null +++ b/views/default/output/radio.php @@ -0,0 +1,13 @@ +<?php +/** + * Elgg text output + * Displays some text that was input using a standard text field + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['text'] The text to display + * + */ + +echo elgg_view('output/text', $vars);
\ 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..3c002a31b --- /dev/null +++ b/views/default/output/tag.php @@ -0,0 +1,34 @@ +<?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['subtype'])) { + $subtype = "&subtype=" . urlencode($vars['subtype']); +} else { + $subtype = ""; +} +if (!empty($vars['object'])) { + $object = "&object=" . urlencode($vars['object']); +} else { + $object = ""; +} + +if (isset($vars['value'])) { + if (!empty($vars['type'])) { + $type = "&type={$vars['type']}"; + } else { + $type = ""; + } + $url = elgg_get_site_url() . 'search?q=' . urlencode($vars['value']) . "&search_type=tags{$type}{$subtype}{$object}"; + 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 new file mode 100644 index 000000000..a212becd8 --- /dev/null +++ b/views/default/output/tagcloud.php @@ -0,0 +1,64 @@ +<?php +/** + * Elgg tagcloud + * Displays a tagcloud + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['tagcloud'] An array of stdClass objects with two elements: 'tag' (the text of the tag) and 'total' (the number of elements with this tag) + * @uses $vars['value'] Sames as tagcloud + * @uses $vars['type'] Entity type + * @uses $vars['subtype'] Entity subtype + */ + +if (!empty($vars['subtype'])) { + $subtype = "&entity_subtype=" . urlencode($vars['subtype']); +} else { + $subtype = ""; +} +if (!empty($vars['type'])) { + $type = "&entity_type=" . urlencode($vars['type']); +} else { + $type = ""; +} + +if (empty($vars['tagcloud']) && !empty($vars['value'])) { + $vars['tagcloud'] = $vars['value']; +} + +if (!empty($vars['tagcloud']) && is_array($vars['tagcloud'])) { + $counter = 0; + $max = 0; + + foreach ($vars['tagcloud'] as $tag) { + if ($tag->total > $max) { + $max = $tag->total; + } + } + + $cloud = ''; + foreach ($vars['tagcloud'] as $tag) { + if ($cloud != '') { + $cloud .= ', '; + } + // protecting against division by zero warnings + $size = round((log($tag->total) / log($max + .0001)) * 100) + 30; + if ($size < 100) { + $size = 100; + } + $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'); + + echo "<div class=\"elgg-tagcloud\">$cloud</div>"; +} diff --git a/views/default/output/tags.php b/views/default/output/tags.php new file mode 100644 index 000000000..3082dd41e --- /dev/null +++ b/views/default/output/tags.php @@ -0,0 +1,81 @@ +<?php +/** + * Elgg tags + * Tags can be a single string (for one tag) or an array of strings + * + * @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['subtype'])) { + $subtype = "&subtype=" . urlencode($vars['subtype']); +} else { + $subtype = ""; +} +if (!empty($vars['object'])) { + $object = "&object=" . urlencode($vars['object']); +} else { + $object = ""; +} + +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'])) { + 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($vars['type'])) { + $type = "&type={$vars['type']}"; + } else { + $type = ""; + } + $url = elgg_get_site_url() . 'search?q=' . urlencode($tag) . "&search_type=tags{$type}{$subtype}{$object}"; + if (is_string($tag)) { + $list_items .= "<li class=\"$item_class\">"; + $list_items .= elgg_view('output/url', array('href' => $url, 'text' => $tag, 'rel' => 'tag')); + $list_items .= '</li>'; + } + } + + $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 new file mode 100644 index 000000000..5cbfc35b0 --- /dev/null +++ b/views/default/output/text.php @@ -0,0 +1,12 @@ +<?php +/** + * Elgg text output + * Displays some text that was input using a standard text field + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['value'] The text to display + */ + +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 new file mode 100644 index 000000000..81b02087d --- /dev/null +++ b/views/default/output/url.php @@ -0,0 +1,56 @@ +<?php +/** + * Elgg URL display + * Displays a URL as a link + * + * @package Elgg + * @subpackage Core + * + * @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() (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 = elgg_extract('href', $vars, null); +if (!$url and isset($vars['value'])) { + $url = trim($vars['value']); + unset($vars['value']); +} + +if (isset($vars['text'])) { + if (elgg_extract('encode_text', $vars, false)) { + $text = htmlspecialchars($vars['text'], ENT_QUOTES, 'UTF-8', false); + } else { + $text = $vars['text']; + } + unset($vars['text']); +} else { + $text = htmlspecialchars($url, ENT_QUOTES, 'UTF-8', false); +} + +unset($vars['encode_text']); + +if ($url) { + $url = elgg_normalize_url($url); + + 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>"; 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 new file mode 100644 index 000000000..edd40d71e --- /dev/null +++ b/views/default/page/elements/messages.php @@ -0,0 +1,27 @@ +<?php +/** + * Elgg global system message list + * Lists all system messages + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['object'] The array of message registers + */ + +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-message elgg-state-$type\">"; + echo elgg_autop($message); + echo '</li>'; + } + } +} + +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 new file mode 100644 index 000000000..fe6bb450e --- /dev/null +++ b/views/default/page/elements/sidebar.php @@ -0,0 +1,32 @@ +<?php +/** + * Elgg sidebar contents + * + * @uses $vars['sidebar'] Optional content that is displayed at the bottom of sidebar + */ + +echo elgg_view_menu('extras', array( + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', +)); + +echo elgg_view('page/elements/owner_block', $vars); + +echo elgg_view_menu('page', array('sort_by' => 'name')); + +// optional 'sidebar' parameter +if (isset($vars['sidebar'])) { + echo $vars['sidebar']; +} + +// @todo deprecated so remove in Elgg 2.0 +// optional second parameter of elgg_view_layout +if (isset($vars['area2'])) { + echo $vars['area2']; +} + +// @todo deprecated so remove in Elgg 2.0 +// optional third parameter of elgg_view_layout +if (isset($vars['area3'])) { + echo $vars['area3']; +}
\ No newline at end of file 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/page/layouts/content.php b/views/default/page/layouts/content.php new file mode 100644 index 000000000..c406c9faf --- /dev/null +++ b/views/default/page/layouts/content.php @@ -0,0 +1,53 @@ +<?php +/** + * Main content area layout + * + * @uses $vars['content'] HTML of main content area + * @uses $vars['sidebar'] HTML of the sidebar + * @uses $vars['header'] HTML of the content area header (override) + * @uses $vars['nav'] HTML of the content area nav (override) + * @uses $vars['footer'] HTML of the content area footer + * @uses $vars['filter'] HTML of the content area filter (override) + * @uses $vars['title'] Title text (override) + * @uses $vars['context'] Page context (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_extract('sidebar', $vars, ''); +$params = $vars; +$params['content'] = $sidebar_content; +$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('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('page/layouts/content/filter', $vars); + +// the all important content +$content = elgg_extract('content', $vars, ''); + +// optional footer for main content area +$footer_content = elgg_extract('footer', $vars, ''); +$params = $vars; +$params['content'] = $footer_content; +$footer = elgg_view('page/layouts/content/footer', $params); + +$body = $header . $filter . $content . $footer; + +$params = array( + '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/page/layouts/content/footer.php b/views/default/page/layouts/content/footer.php new file mode 100644 index 000000000..66f5d3ff8 --- /dev/null +++ b/views/default/page/layouts/content/footer.php @@ -0,0 +1,8 @@ +<?php +/** + * Main content footer + * + * @uses $vars['content'] The content for the footer + */ + +echo $vars['content']; 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/page/layouts/content/sidebar.php b/views/default/page/layouts/content/sidebar.php new file mode 100644 index 000000000..86ca8435f --- /dev/null +++ b/views/default/page/layouts/content/sidebar.php @@ -0,0 +1,8 @@ +<?php +/** + * Main content sidebar + * + * @uses $vars['content] The content for the sidebar + */ + +echo $vars['content']; diff --git a/views/default/page/layouts/default.php b/views/default/page/layouts/default.php new file mode 100644 index 000000000..60dc90b0d --- /dev/null +++ b/views/default/page/layouts/default.php @@ -0,0 +1,18 @@ +<?php +/** + * Elgg default layout + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['content'] Content string + */ + +// @todo deprecated so remove in Elgg 2.0 +if (isset($vars['area1'])) { + echo $vars['area1']; +} + +if (isset($vars['content'])) { + echo $vars['content']; +} 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..ff8e317c7 --- /dev/null +++ b/views/default/page/walled_garden.php @@ -0,0 +1,27 @@ +<?php +/** + * Walled garden page shell + * + * Used for the walled garden index page + */ + +// 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="elgg-body-walledgarden"> + <?php echo $vars['body']; ?> + </div> +</div> +<?php echo elgg_view('page/elements/foot'); ?> +</body> +</html>
\ No newline at end of file diff --git a/views/default/plugins/event_calendar/settings.php b/views/default/plugins/event_calendar/settings.php deleted file mode 100644 index a58647828..000000000 --- a/views/default/plugins/event_calendar/settings.php +++ /dev/null @@ -1,474 +0,0 @@ -<?php -$yn_options = array(elgg_echo('event_calendar:settings:yes')=>'yes', - elgg_echo('event_calendar:settings:no')=>'no', -); - -$time_format_options = array(elgg_echo('event_calendar:time_format:12hour')=>'12',elgg_echo('event_calendar:time_format:24hour')=>'24'); - -$membership_options = array( - elgg_echo('event_calendar:personal_manage:open') => 'open' , - elgg_echo('event_calendar:personal_manage:closed') => 'closed', - elgg_echo('event_calendar:personal_manage:private') => 'private', - elgg_echo('event_calendar:personal_manage:by_event') => 'by_event', -); - -$access_options = array( ACCESS_PRIVATE => elgg_echo("PRIVATE"), - ACCESS_LOGGED_IN => elgg_echo("LOGGED_IN"), - ACCESS_PUBLIC => elgg_echo("PUBLIC")); - -$listing_options = array(elgg_echo('event_calendar:settings:paged')=>'paged', - elgg_echo('event_calendar:settings:agenda')=>'agenda', - elgg_echo('event_calendar:settings:month')=>'month', - elgg_echo('event_calendar:settings:full')=>'full', -); - -$body = ''; - -/*$event_calendar_full_calendar = elgg_get_plugin_setting('full_calendar', 'event_calendar'); -if (!$event_calendar_full_calendar) { - $event_calendar_full_calendar = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:full_calendar:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[full_calendar]','value'=>$event_calendar_full_calendar,'options'=>$yn_options)); - -$body .= '<br />';*/ - -$event_calendar_hide_access = elgg_get_plugin_setting('hide_access', 'event_calendar'); -if (!$event_calendar_hide_access) { - $event_calendar_hide_access = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:hide_access:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[hide_access]','value'=>$event_calendar_hide_access,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_default_access = elgg_get_plugin_setting('default_access', 'event_calendar'); -if (!$event_calendar_default_access) { - $event_calendar_default_access = ACCESS_LOGGED_IN; -} - -$body .= elgg_echo('event_calendar:settings:default_access:title'); -$body .= '<br />'; -$body .= elgg_view('input/dropdown',array('name'=>'params[default_access]','value'=>$event_calendar_default_access,'options_values'=>$access_options)); - -$body .= '<br /><br />'; - -$event_calendar_hide_end = elgg_get_plugin_setting('hide_end', 'event_calendar'); -if (!$event_calendar_hide_end) { - $event_calendar_hide_end = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:hide_end:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[hide_end]','value'=>$event_calendar_hide_end,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_listing_format = elgg_get_plugin_setting('listing_format', 'event_calendar'); -if (!$event_calendar_listing_format) { - $event_calendar_listing_format = 'month'; -} - -$body .= elgg_echo('event_calendar:settings:listing_format:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[listing_format]','value'=>$event_calendar_listing_format,'options'=>$listing_options)); - -$body .= '<br />'; - -$event_calendar_repeated_events = elgg_get_plugin_setting('repeated_events', 'event_calendar'); -if (!$event_calendar_repeated_events) { - $event_calendar_repeated_events = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:repeated_events:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[repeated_events]','value'=>$event_calendar_repeated_events,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_reminders = elgg_get_plugin_setting('reminders', 'event_calendar'); -if (!$event_calendar_reminders) { - $event_calendar_reminders = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:reminders:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[reminders]','value'=>$event_calendar_reminders,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar'); -if (!$event_calendar_times) { - $event_calendar_times = 'yes'; -} - -$body .= elgg_echo('event_calendar:settings:times:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[times]','value'=>$event_calendar_times,'options'=>$yn_options)); - -$body .= '<br />'; - -/*$event_calendar_restricted_times = elgg_get_plugin_setting('restricted_times', 'event_calendar'); -if (!$event_calendar_restricted_times) { - $event_calendar_restricted_times = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:restricted_times:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[restricted_times]','value'=>$event_calendar_restricted_times,'options'=>$yn_options)); - -$body .= '<br />';*/ - -$event_calendar_time_format = elgg_get_plugin_setting('timeformat', 'event_calendar'); -if (!$event_calendar_time_format) { - $event_calendar_time_format = '24'; -} - -$body .= elgg_echo('event_calendar:settings:timeformat:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[timeformat]','value'=>$event_calendar_time_format,'options'=>$time_format_options)); - -$body .= '<br />'; - -$event_calendar_autopersonal = elgg_get_plugin_setting('autopersonal', 'event_calendar'); -if (!$event_calendar_autopersonal) { - $event_calendar_autopersonal = 'yes'; -} - -$body .= elgg_echo('event_calendar:settings:autopersonal:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[autopersonal]','value'=>$event_calendar_autopersonal,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_autogroup = elgg_get_plugin_setting('autogroup', 'event_calendar'); -if (!$event_calendar_autogroup) { - $event_calendar_autogroup = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:autogroup:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[autogroup]','value'=>$event_calendar_autogroup,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_add_to_group_calendar = elgg_get_plugin_setting('add_to_group_calendar', 'event_calendar'); -if (!$event_calendar_add_to_group_calendar) { - $event_calendar_add_to_group_calendar = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:add_to_group_calendar:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[add_to_group_calendar]','value'=>$event_calendar_add_to_group_calendar,'options'=>$yn_options)); - -$body .= '<br />'; - -// agenda view is now handled in the listing area - -/*$event_calendar_agenda_view = elgg_get_plugin_setting('agenda_view', 'event_calendar'); -if (!$event_calendar_agenda_view) { - $event_calendar_agenda_view = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:agenda_view:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[agenda_view]','value'=>$event_calendar_agenda_view,'options'=>$yn_options)); - -$body .= '<br />';*/ - -$event_calendar_venue_view = elgg_get_plugin_setting('venue_view', 'event_calendar'); -if (!$event_calendar_venue_view) { - $event_calendar_venue_view = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:venue_view:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[venue_view]','value'=>$event_calendar_venue_view,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_fewer_fields = elgg_get_plugin_setting('fewer_fields', 'event_calendar'); -if (!$event_calendar_fewer_fields) { - $event_calendar_fewer_fields = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:fewer_fields:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[fewer_fields]','value'=>$event_calendar_fewer_fields,'options'=>$yn_options)); - -$body .= '<br />'; - -$options = array(elgg_echo('event_calendar:settings:no')=>'no', - elgg_echo('event_calendar:settings:site_calendar:admin')=>'admin', - elgg_echo('event_calendar:settings:site_calendar:loggedin')=>'loggedin', -); - -$event_calendar_site_calendar = elgg_get_plugin_setting('site_calendar', 'event_calendar'); -if (!$event_calendar_site_calendar) { - $event_calendar_site_calendar = 'admin'; -} - -$body .= elgg_echo('event_calendar:settings:site_calendar:title').'<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[site_calendar]','value'=>$event_calendar_site_calendar,'options'=>$options)); - -$body .= '<br />'; - -$options = array(elgg_echo('event_calendar:settings:no')=>'no', - elgg_echo('event_calendar:settings:group_calendar:admin')=>'admin', - elgg_echo('event_calendar:settings:group_calendar:members')=>'members', -); - -$event_calendar_group_calendar = elgg_get_plugin_setting('group_calendar', 'event_calendar'); -if (!$event_calendar_group_calendar) { - $event_calendar_group_calendar = 'members'; -} - -$body .= elgg_echo('event_calendar:settings:group_calendar:title').'<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[group_calendar]','value'=>$event_calendar_group_calendar,'options'=>$options)); - -$body .= '<br />'; - -$options = array(elgg_echo('event_calendar:settings:group_default:yes')=>'yes', - elgg_echo('event_calendar:settings:group_default:no')=>'no', -); - -$event_calendar_group_default = elgg_get_plugin_setting('group_default', 'event_calendar'); -if (!$event_calendar_group_default) { - $event_calendar_group_default = 'yes'; -} - -$body .= elgg_echo('event_calendar:settings:group_default:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[group_default]','value'=>$event_calendar_group_default,'options'=>$options)); - -$body .= '<br />'; - -$event_calendar_group_always_display = elgg_get_plugin_setting('group_always_display', 'event_calendar'); -if (!$event_calendar_group_always_display) { - $event_calendar_group_always_display = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:group_always_display:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[group_always_display]','value'=>$event_calendar_group_always_display,'options'=>$yn_options)); - -$body .= '<br />'; - -// There does not seem to be a way to determine where the group calendar box will appear in Elgg 1.8 - -/*$options = array(elgg_echo('event_calendar:settings:group_profile_display_option:left')=>'left', - elgg_echo('event_calendar:settings:group_profile_display_option:right')=>'right', - elgg_echo('event_calendar:settings:group_profile_display_option:none')=>'none', -); - -$event_calendar_group_profile_display = elgg_get_plugin_setting('group_profile_display', 'event_calendar'); -if (!$event_calendar_group_profile_display) { - $event_calendar_group_profile_display = 'right'; -} - -$body .= elgg_echo('event_calendar:settings:group_profile_display:title').'<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[group_profile_display]','value'=>$event_calendar_group_profile_display,'options'=>$options)); - -$body .= '<br />';*/ - -$event_calendar_add_users = elgg_get_plugin_setting('add_users', 'event_calendar'); -if (!$event_calendar_add_users) { - $event_calendar_add_users = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:add_users:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[add_users]','value'=>$event_calendar_add_users,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_add_users_notify = elgg_get_plugin_setting('add_users_notify', 'event_calendar'); -if (!$event_calendar_add_users_notify) { - $event_calendar_add_users_notify = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:add_users_notify:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[add_users_notify]','value'=>$event_calendar_add_users_notify,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_personal_manage = elgg_get_plugin_setting('personal_manage', 'event_calendar'); -if (!$event_calendar_personal_manage && $personal_manage == 'yes') { - $event_calendar_personal_manage = 'open'; -} - -$body .= elgg_echo('event_calendar:settings:personal_manage:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[personal_manage]','value'=>$event_calendar_personal_manage,'options'=>$membership_options)); -$body .= '<p>'.elgg_echo('event_calendar:settings:personal_manage:description').'</p>'; - -$event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar'); -if (!$event_calendar_spots_display) { - $event_calendar_spots_display = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:spots_display:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[spots_display]','value'=>$event_calendar_spots_display,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_no_collisions = elgg_get_plugin_setting('no_collisions', 'event_calendar'); -if (!$event_calendar_no_collisions) { - $event_calendar_no_collisions = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:no_collisions:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[no_collisions]','value'=>$event_calendar_no_collisions,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_collision_length = elgg_get_plugin_setting('collision_length', 'event_calendar'); -if (!$event_calendar_collision_length) { - $event_calendar_collision_length = '3600'; -} - -$body .= elgg_echo('event_calendar:settings:collision_length:title'); -$body .= '<br />'; -$body .= elgg_view('input/text',array('name'=>'params[collision_length]','value'=>$event_calendar_collision_length)); - -$body .= '<br /><br />'; - -$event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar'); -if (!$event_calendar_region_display) { - $event_calendar_region_display = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:region_display:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[region_display]','value'=>$event_calendar_region_display,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_region_list = elgg_get_plugin_setting('region_list', 'event_calendar'); -if (!$event_calendar_region_list) { - $event_calendar_region_list = ''; -} - -$body .= elgg_echo('event_calendar:settings:region_list:title'); -$body .= '<br />'; -$body .= elgg_view('input/plaintext',array('name'=>'params[region_list]','value'=>$event_calendar_region_list)); - -$body .= '<br />'; - -$event_calendar_region_list_handles = elgg_get_plugin_setting('region_list_handles', 'event_calendar'); -if (!$event_calendar_region_list_handles) { - $event_calendar_region_list_handles = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:region_list_handles:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[region_list_handles]','value'=>$event_calendar_region_list_handles,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_type_display = elgg_get_plugin_setting('type_display', 'event_calendar'); -if (!$event_calendar_type_display) { - $event_calendar_type_display = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:type_display:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[type_display]','value'=>$event_calendar_type_display,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_type_list = elgg_get_plugin_setting('type_list', 'event_calendar'); -if (!$event_calendar_type_list) { - $event_calendar_type_list = ''; -} - -$body .= elgg_echo('event_calendar:settings:type_list:title'); -$body .= '<br />'; -$body .= elgg_view('input/plaintext',array('name'=>'params[type_list]','value'=>$event_calendar_type_list)); - -$body .= '<br />'; - -$event_calendar_type_list_handles = elgg_get_plugin_setting('type_list_handles', 'event_calendar'); -if (!$event_calendar_type_list_handles) { - $event_calendar_type_list_handles = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:type_list_handles:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[type_list_handles]','value'=>$event_calendar_type_list_handles,'options'=>$yn_options)); - -$body .= '<br />'; - -$event_calendar_first_date = elgg_get_plugin_setting('first_date', 'event_calendar'); -if (!$event_calendar_first_date) { - $event_calendar_first_date = ''; -} - -$body .= elgg_echo('event_calendar:settings:first_date:title'); -$body .= '<br />'; -$body .= elgg_view('input/text',array('name'=>'params[first_date]','value'=>$event_calendar_first_date)); - -$body .= '<br /><br />'; - -$event_calendar_last_date = elgg_get_plugin_setting('last_date', 'event_calendar'); -if (!$event_calendar_last_date) { - $event_calendar_last_date = ''; -} - -$body .= elgg_echo('event_calendar:settings:last_date:title'); -$body .= '<br />'; -$body .= elgg_view('input/text',array('name'=>'params[last_date]','value'=>$event_calendar_last_date)); - -$body .= '<br /><br />'; - -$event_calendar_more_required = elgg_get_plugin_setting('more_required', 'event_calendar'); -if (!$event_calendar_more_required) { - $event_calendar_more_required = 'no'; -} - -$body .= elgg_echo('event_calendar:settings:more_required:title'); -$body .= '<br />'; -$body .= elgg_view('input/radio',array('name'=>'params[more_required]','value'=>$event_calendar_more_required,'options'=>$yn_options)); - -$body .= '<br />'; - -$ical_auth_file_name = elgg_get_plugin_setting('ical_auth_file_name', 'event_calendar'); - -$body .= elgg_echo('event_calendar:ical_auth_file_name:title'); -$body .= '<br />'; -$body .= elgg_view('input/text',array('name'=>'params[ical_auth_file_name]','value'=>$ical_auth_file_name, 'class'=>'event-calendar-ical-auth-setting')); - -$body .= '<br /><br />'; - -$event_calendar_bbb_server_url = elgg_get_plugin_setting('bbb_server_url', 'event_calendar'); - -$body .= elgg_echo('event_calendar:bbb_server_url'); -$body .= '<br />'; -$body .= elgg_view('input/text', array( - 'name' => 'params[bbb_server_url]', - 'value' => $event_calendar_bbb_server_url, - 'class' => 'text_input', -)); - -$body .= '<br /><br />'; - -$event_calendar_bbb_security_salt = elgg_get_plugin_setting('bbb_security_salt', 'event_calendar'); - -$body .= elgg_echo('event_calendar:bbb_security_salt'); -$body .= '<br />'; -$body .= elgg_view('input/text', array( - 'name' => 'params[bbb_security_salt]', - 'value' => $event_calendar_bbb_security_salt, - 'class' => 'text_input', -)); - -$body .= '<br /><br />'; - -echo $body; 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/object/event_calendar/create.php b/views/default/river/annotation/generic_comment/create.php index 515389411..7d586450d 100644 --- a/views/default/river/object/event_calendar/create.php +++ b/views/default/river/annotation/generic_comment/create.php @@ -1,13 +1,11 @@ <?php /** - * Event river view. + * Post comment river view */ - -elgg_load_library('elgg:event_calendar'); - $object = $vars['item']->getObjectEntity(); +$comment = $vars['item']->getAnnotation(); echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], - 'message' => event_calendar_get_formatted_time($object), + '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..416bc708b --- /dev/null +++ b/views/default/river/elements/summary.php @@ -0,0 +1,53 @@ +<?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_link = elgg_view('output/url', array( + 'href' => $object->getURL(), + 'text' => $object->title ? $object->title : $object->name, + '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/object/event_calendar/update.php b/views/default/river/object/event_calendar/update.php deleted file mode 100644 index 515389411..000000000 --- a/views/default/river/object/event_calendar/update.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Event river view. - */ - -elgg_load_library('elgg:event_calendar'); - -$object = $vars['item']->getObjectEntity(); - -echo elgg_view('river/elements/layout', array( - 'item' => $vars['item'], - 'message' => event_calendar_get_formatted_time($object), -)); 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/site/default.php b/views/default/site/default.php new file mode 100644 index 000000000..5dacb4019 --- /dev/null +++ b/views/default/site/default.php @@ -0,0 +1,17 @@ +<?php +/** + * ElggSite default view. + * + * @package Elgg + * @subpackage Core + */ + +// sites information (including plugin settings) shouldn't be shown. +// this view is required for pinging home during install. +if (!defined('INSTALLING')) { + if ($site = $vars['entity']->url) { + forward($site); + } else { + forward(); + } +} diff --git a/views/default/user/default.php b/views/default/user/default.php new file mode 100644 index 000000000..6c84e84ad --- /dev/null +++ b/views/default/user/default.php @@ -0,0 +1,57 @@ +<?php +/** + * Elgg user display + * + * @uses $vars['entity'] ElggUser entity + * @uses $vars['size'] Size of the icon + */ + +$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 ($entity->isBanned()) { + $banned = elgg_echo('banned'); + $params = array( + 'entity' => $entity, + 'title' => $title, + 'metadata' => $metadata, + ); + } else { + $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 new file mode 100644 index 000000000..a3878a803 --- /dev/null +++ b/views/default/user/search/finishblurb.php @@ -0,0 +1,18 @@ +<?php +/** + * @package Elgg + * @subpackage Core + * @deprecated 1.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(); ?>search/users?tag=<?php echo urlencode($vars['tag']); ?>"><?php + echo elgg_echo("user:search:finishblurb"); + ?></a> +<?php + +} diff --git a/views/default/user/search/startblurb.php b/views/default/user/search/startblurb.php new file mode 100644 index 000000000..806157609 --- /dev/null +++ b/views/default/user/search/startblurb.php @@ -0,0 +1,10 @@ +<?php +/** + * @package Elgg + * @subpackage Core + * @deprecated 1.7 + */ + +elgg_deprecated_notice('view user/search/startblurb was deprecated.', 1.7); + +echo elgg_echo("user:search:startblurb", array($vars['tag']));
\ No newline at end of file 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/event_calendar/content.php b/views/default/widgets/event_calendar/content.php deleted file mode 100644 index eaedb76bd..000000000 --- a/views/default/widgets/event_calendar/content.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/** - * Elgg event calendar widget - * - * @package event_calendar - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Kevin Jardine <kevin@radagast.biz> - * @copyright Radagast Solutions 2008 - * @link http://radagast.biz/ - * - */ - - // Load event calendar model - elgg_load_library('elgg:event_calendar'); - - //the number of events to display - $num = (int) $vars['entity']->num_display; - if (!$num) - $num = 5; - - // Get the events - $owner = elgg_get_page_owner_entity(); - if(elgg_instanceof($owner, 'group')) { - $events = event_calendar_get_events_for_group(elgg_get_page_owner_guid(),$num); - } else { - $events = event_calendar_get_personal_events_for_user(elgg_get_page_owner_guid(),$num); - } - - // If there are any events to view, view them - if (is_array($events) && sizeof($events) > 0) { - - echo "<div id=\"widget_calendar\">"; - - foreach($events as $event) { - echo elgg_view("object/event_calendar",array('entity' => $event)); - } - - echo "</div>"; - - } - -?>
\ No newline at end of file diff --git a/views/default/widgets/event_calendar/edit.php b/views/default/widgets/event_calendar/edit.php deleted file mode 100644 index 716920c8a..000000000 --- a/views/default/widgets/event_calendar/edit.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/** - * Elgg event_calendar group widget - * - * @package event_calendar - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Kevin Jardine <kevin@radagast.biz> - * @copyright Radagast Solutions 2008 - * @link http://radagast.biz/ - * - */ - -if (!$vars['entity']->num_display) { - $num_display = 5; -} else { - $num_display = $vars['entity']->num_display; -} -?> - -<p> - <?php echo elgg_echo("event_calendar:num_display"); ?>: - <select name="params[num_display]"> - <option value="1" <?php if($num_display == 1) echo "SELECTED"; ?>>1</option> - <option value="2" <?php if($num_display == 2) echo "SELECTED"; ?>>2</option> - <option value="3" <?php if($num_display == 3) echo "SELECTED"; ?>>3</option> - <option value="4" <?php if($num_display == 4) echo "SELECTED"; ?>>4</option> - <option value="5" <?php if($num_display == 5) echo "SELECTED"; ?>>5</option> - <option value="6" <?php if($num_display == 6) echo "SELECTED"; ?>>6</option> - <option value="7" <?php if($num_display == 7) echo "SELECTED"; ?>>7</option> - <option value="8" <?php if($num_display == 8) echo "SELECTED"; ?>>8</option> - <option value="9" <?php if($num_display == 9) echo "SELECTED"; ?>>9</option> - <option value="10" <?php if($num_display == 10) echo "SELECTED"; ?>>10</option> - </select> -</p> 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 |