From cc23bbddb8f2367f33e6291b13354c4cd98cd97b Mon Sep 17 00:00:00 2001
From: cash
Date: Thu, 22 Sep 2011 21:55:25 -0400
Subject: Fixes #3795 not inserting the file title when embeding a file and
tweaked css - thanks to slyhne
---
mod/file/views/default/embed/file/content.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'mod/file')
diff --git a/mod/file/views/default/embed/file/content.php b/mod/file/views/default/embed/file/content.php
index 865a158a7..eadcd1a6d 100644
--- a/mod/file/views/default/embed/file/content.php
+++ b/mod/file/views/default/embed/file/content.php
@@ -31,7 +31,7 @@ if ($count) {
$subtitle = "$author_text $date";
- $icon = " getIconURL($icon_size)}\" />" . htmlentities($title, ENT_QUOTES, 'UTF-8');
+ $icon = " getIconURL($icon_size)}\" />";
$embed_code = elgg_view('output/url', array(
'href' => $item->getURL(),
--
cgit v1.2.3
From ef52dd9cfec3c415cd00714223ea7ce31cb07b3d Mon Sep 17 00:00:00 2001
From: cash
Date: Sat, 24 Sep 2011 19:00:10 -0400
Subject: Fixes #3858 added file notification string translation - thanks to
slyhne
---
mod/file/languages/en.php | 2 ++
1 file changed, 2 insertions(+)
(limited to 'mod/file')
diff --git a/mod/file/languages/en.php b/mod/file/languages/en.php
index 72b198d54..aa30084a9 100644
--- a/mod/file/languages/en.php
+++ b/mod/file/languages/en.php
@@ -75,6 +75,8 @@ $english = array(
'item:object:file' => 'Files',
+ 'file:newupload' => 'A new file has been uploaded',
+
/**
* Embed media
**/
--
cgit v1.2.3
From 672bca794418ffa5544319de1a8ecfed3f088bd0 Mon Sep 17 00:00:00 2001
From: Brett Profitt
Date: Wed, 28 Sep 2011 22:13:22 -0700
Subject: Fixes #3823. More carefully casting to int for file's search.
---
mod/file/pages/file/search.php | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
(limited to 'mod/file')
diff --git a/mod/file/pages/file/search.php b/mod/file/pages/file/search.php
index 569657fd4..402a28933 100644
--- a/mod/file/pages/file/search.php
+++ b/mod/file/pages/file/search.php
@@ -5,7 +5,12 @@
* @package ElggFile
*/
-$page_owner_guid = (int)get_input('page_owner', null);
+$page_owner_guid = get_input('page_owner', null);
+
+if ($page_owner_guid !== null) {
+ $page_owner_guid = sanitise_int($page_owner_guid);
+}
+
if ($page_owner_guid) {
elgg_set_page_owner_guid($page_owner_guid);
}
--
cgit v1.2.3
From c7b0817dabd1ea596086b03569d4480355e5f721 Mon Sep 17 00:00:00 2001
From: cash
Date: Sat, 1 Oct 2011 12:42:00 -0400
Subject: using the menu system for the embed tabs and adding a reusable select
list view
---
mod/embed/languages/en.php | 1 -
mod/embed/start.php | 132 ++++++++++++----------
mod/embed/views/default/embed/item.php | 31 +++++
mod/embed/views/default/embed/layout.php | 33 ++++++
mod/embed/views/default/embed/list.php | 61 ++++++++++
mod/embed/views/default/js/embed/embed.php | 10 +-
mod/embed/views/default/navigation/menu/embed.php | 21 ++++
mod/file/start.php | 21 +++-
8 files changed, 239 insertions(+), 71 deletions(-)
create mode 100644 mod/embed/views/default/embed/item.php
create mode 100644 mod/embed/views/default/embed/layout.php
create mode 100644 mod/embed/views/default/embed/list.php
create mode 100644 mod/embed/views/default/navigation/menu/embed.php
(limited to 'mod/file')
diff --git a/mod/embed/languages/en.php b/mod/embed/languages/en.php
index 287d34ca1..6ae99a56f 100644
--- a/mod/embed/languages/en.php
+++ b/mod/embed/languages/en.php
@@ -5,7 +5,6 @@
*/
$english = array(
- 'media:insert' => 'Embed content',
'embed:embed' => 'Embed',
'embed:media' => 'Embed content',
'embed:instructions' => 'Click on any file to embed it into your content.',
diff --git a/mod/embed/start.php b/mod/embed/start.php
index 6c26163e9..a87776c7e 100644
--- a/mod/embed/start.php
+++ b/mod/embed/start.php
@@ -15,6 +15,7 @@ function embed_init() {
elgg_extend_view('css/elgg', 'embed/css');
elgg_register_plugin_hook_handler('register', 'menu:longtext', 'embed_longtext_menu');
+ elgg_register_plugin_hook_handler('register', 'menu:embed', 'embed_select_tab', 1000);
// Page handler for the modal media embed
elgg_register_page_handler('embed', 'embed_page_handler');
@@ -40,7 +41,7 @@ function embed_longtext_menu($hook, $type, $items, $vars) {
$items[] = ElggMenuItem::factory(array(
'name' => 'embed',
'href' => "embed",
- 'text' => elgg_echo('media:insert'),
+ 'text' => elgg_echo('embed:media'),
'rel' => 'lightbox',
'link_class' => "elgg-longtext-control elgg-lightbox embed-control embed-control-{$vars['id']}",
'priority' => 10,
@@ -54,68 +55,83 @@ function embed_longtext_menu($hook, $type, $items, $vars) {
}
/**
- * Serves pages for upload and embed.
+ * Select the correct embed tab for display
*
- * @param $page
+ * @param string $hook
+ * @param string $type
+ * @param array $items
+ * @param array $vars
*/
-function embed_page_handler($page) {
- if (!isset($page[0])) {
- $page[0] = 'embed';
+function embed_select_tab($hook, $type, $items, $vars) {
+
+ $tab_name = array_pop(explode('/', full_url()));
+ foreach ($items as $item) {
+ if ($item->getName() == $tab_name) {
+ $item->setSelected();
+ elgg_set_config('embed_tab', $item);
+ }
}
- switch ($page[0]) {
- case 'upload':
- echo elgg_view('embed/upload');
- break;
- case 'embed':
- default:
- // trigger hook to get section tabs
- // use views for embed/section/
- // listing
- // item
- // default to embed/listing | item if not found.
-
- // @todo the menu system is good for registering and sorting, but not great for
- // displaying tabs.
- // Pulling in the menu manually and passing it through the embed/tabs view.
- // We should work on making it easier to use tabs through the menu system, then fix
- // this mess.
- $menus = get_config('menus');
- $menu = $menus['embed:sections'];
-
- $sections = array();
- $upload_sections = array();
-
- foreach ($menu as $item) {
- switch ($item->section) {
- case 'upload':
- $upload_sections[$item->getName()] = array(
- 'name' => $item->getText(),
- );
- break;
-
- default:
- $sections[$item->getName()] = array(
- 'name' => $item->getText(),
- );
- break;
- }
- }
-
- $active_section = get_input('active_section', '');
- $active_section = preg_replace('[\W]', '', $active_section);
- $internal_id = get_input('internal_id', '');
- $internal_id = preg_replace('[\W]', '', $internal_id);
-
- echo elgg_view('embed/embed', array(
- 'sections' => $sections,
- 'active_section' => $active_section,
- 'upload_sections' => $upload_sections,
- 'internal_id' => $internal_id
- ));
- break;
+ if (!elgg_get_config('embed_tab') && count($items) > 0) {
+ $items[0]->setSelected();
+ elgg_set_config('embed_tab', $items[0]);
}
+}
+
+/**
+ * Serves the content for the embed lightbox
+ *
+ * @param array $page URL segments
+ */
+function embed_page_handler($page) {
+
+ echo elgg_view('embed/layout');
// exit because this is in a modal display.
exit;
-}
\ No newline at end of file
+}
+
+/**
+ * A special listing function for selectable content
+ *
+ * This calls a custom list view for entities.
+ *
+ * @param array $entities Array of ElggEntity objects
+ * @param array $vars Display parameters
+ * @return string
+ */
+function embed_list_items($entities, $vars = array()) {
+
+ $defaults = array(
+ 'items' => $entities,
+ 'list_class' => 'elgg-list-entity',
+ );
+
+ $vars = array_merge($defaults, $vars);
+
+ return elgg_view('embed/list', $vars);
+}
+
+/**
+ * Set the options for the list of embedable content
+ *
+ * @param array $options
+ * @return array
+ */
+function embed_get_list_options($options = array()) {
+
+ if (elgg_get_page_owner_guid()) {
+ $container_guid = elgg_get_page_owner_guid();
+ } else {
+ $container_guid = elgg_get_logged_in_user_guid();
+ }
+
+ $defaults = array(
+ 'limit' => 6,
+ 'container_guid' => $container_guid,
+ );
+
+ $options = array_merge($defaults, $options);
+
+ return $options;
+}
diff --git a/mod/embed/views/default/embed/item.php b/mod/embed/views/default/embed/item.php
new file mode 100644
index 000000000..a64a67d8b
--- /dev/null
+++ b/mod/embed/views/default/embed/item.php
@@ -0,0 +1,31 @@
+" . $entity->title . "";
+
+$icon = " getIconURL('small')}\" />";
+
+$embed_code = elgg_view('output/url', array(
+ 'href' => $entity->getURL(),
+ 'title' => $title,
+ 'text' => $icon,
+ 'encode_text' => FALSE
+));
+
+
+echo "getGUID()}\">";
+echo elgg_view_image_block($image, $body);
+echo '
';
+
+// @todo JS 1.8: is this approach better than inline js?
+echo "";
diff --git a/mod/embed/views/default/embed/layout.php b/mod/embed/views/default/embed/layout.php
new file mode 100644
index 000000000..73c26810d
--- /dev/null
+++ b/mod/embed/views/default/embed/layout.php
@@ -0,0 +1,33 @@
+getData('tab_type')) {
+ case 'select':
+ $tab = elgg_list_entities(
+ embed_get_list_options($selected->getData('options')),
+ 'elgg_get_entities',
+ 'embed_list_items'
+ );
+ if (!$tab) {
+ $tab = elgg_echo('embed:no_section_content');
+ }
+ break;
+ case 'upload':
+ $tab = elgg_view($selected->getData('view'), $vars);
+ break;
+}
+
+echo <<
+ $title
+ $menu
+ $tab
+
+HTML;
diff --git a/mod/embed/views/default/embed/list.php b/mod/embed/views/default/embed/list.php
new file mode 100644
index 000000000..e36280e88
--- /dev/null
+++ b/mod/embed/views/default/embed/list.php
@@ -0,0 +1,61 @@
+ element
+ * @uses $vars['item_class'] Additional CSS class for the elements
+ */
+
+$items = $vars['items'];
+$offset = $vars['offset'];
+$limit = $vars['limit'];
+$count = $vars['count'];
+
+$offset_key = elgg_extract('offset_key', $vars, 'offset');
+
+$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 ($count) {
+ $nav .= elgg_view('navigation/pagination', array(
+ 'offset' => $offset,
+ 'count' => $count,
+ 'limit' => $limit,
+ 'offset_key' => $offset_key,
+ ));
+}
+
+if (is_array($items) && count($items) > 0) {
+ $html .= "";
+ foreach ($items as $item) {
+ $id = "elgg-{$item->getType()}-{$item->getGUID()}";
+ $html .= "";
+ $html .= elgg_view('embed/item', array('entity' => $item));
+ $html .= ' ';
+ }
+ $html .= ' ';
+}
+
+$html .= $nav;
+
+echo $html;
diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php
index e9e08f9a0..49c277b69 100644
--- a/mod/embed/views/default/js/embed/embed.php
+++ b/mod/embed/views/default/js/embed/embed.php
@@ -15,9 +15,9 @@ elgg.embed.init = function() {
});
// special pagination helper for lightbox
- $('.embed-wrapper .elgg-pagination a').live('click', elgg.embed.pagination);
+ $('.embed-wrapper .elgg-pagination a').live('click', elgg.embed.loadContent);
- $('.embed-section').live('click', elgg.embed.loadTab);
+ $('.embed-section').live('click', elgg.embed.loadContent);
$('.embed-upload .elgg-form').live('submit', elgg.embed.submit);
}
@@ -87,7 +87,7 @@ elgg.embed.submit = function(event) {
* @param {Object} event
* @return void
*/
-elgg.embed.pagination = function(event) {
+elgg.embed.loadContent = function(event) {
$('.embed-wrapper').parent().load($(this).attr('href'));
event.preventDefault();
}
@@ -99,9 +99,7 @@ elgg.embed.pagination = function(event) {
* @return void
*/
elgg.embed.loadTab = function(event) {
- var section = $(this).attr('id');
- var url = elgg.config.wwwroot + 'embed/embed?active_section=' + section;
- $('.embed-wrapper').parent().load(url);
+ $('.embed-wrapper').parent().load($(this).attr('href'));
event.preventDefault();
}
diff --git a/mod/embed/views/default/navigation/menu/embed.php b/mod/embed/views/default/navigation/menu/embed.php
new file mode 100644
index 000000000..36cedc47e
--- /dev/null
+++ b/mod/embed/views/default/navigation/menu/embed.php
@@ -0,0 +1,21 @@
+ $menu_item->getText(),
+ 'url' => 'embed/tab/' . $menu_item->getName(),
+ 'url_class' => 'embed-section',
+ 'selected' => $menu_item->getSelected(),
+ );
+ }
+}
+
+echo elgg_view('navigation/tabs', array('tabs' => $tabs));
diff --git a/mod/file/start.php b/mod/file/start.php
index 749d7a519..16ce0e233 100644
--- a/mod/file/start.php
+++ b/mod/file/start.php
@@ -61,19 +61,28 @@ function file_init() {
$item = ElggMenuItem::factory(array(
'name' => 'file',
'text' => elgg_echo('file'),
- 'href' => '#',
- 'section' => 'select'
+ 'section' => 'select',
+ 'data' => array(
+ 'tab_type' => 'select',
+ 'options' => array(
+ 'type' => 'object',
+ 'subtype' => 'file',
+ ),
+ ),
));
- elgg_register_menu_item('embed:sections', $item);
+ elgg_register_menu_item('embed', $item);
$item = ElggMenuItem::factory(array(
'name' => 'file_upload',
'text' => elgg_echo('file:upload'),
- 'href' => '#',
- 'section' => 'upload'
+ 'section' => 'upload',
+ 'data' => array(
+ 'tab_type' => 'upload',
+ 'view' => 'embed/file_upload/content',
+ ),
));
- elgg_register_menu_item('embed:sections', $item);
+ elgg_register_menu_item('embed', $item);
}
/**
--
cgit v1.2.3
From bc292c96ac6b118bd7a99509fce1c11bb232aeb2 Mon Sep 17 00:00:00 2001
From: cash
Date: Sat, 1 Oct 2011 16:54:24 -0400
Subject: fixed the forwarding of an embed upload form
---
mod/embed/views/default/js/embed/embed.php | 5 +-
mod/file/views/default/embed/file/content.php | 61 ----------------------
.../views/default/embed/file_upload/content.php | 9 +++-
3 files changed, 9 insertions(+), 66 deletions(-)
delete mode 100644 mod/file/views/default/embed/file/content.php
(limited to 'mod/file')
diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php
index 37246ee8a..6d4e2e4ea 100644
--- a/mod/embed/views/default/js/embed/embed.php
+++ b/mod/embed/views/default/js/embed/embed.php
@@ -79,9 +79,8 @@ elgg.embed.submit = function(event) {
elgg.system_message(response.system_messages.success);
}
if (response.status >= 0) {
- // @todo - really this should forward to what the registered defined
- // For example, forward to images tab if an image was uploaded
- var url = elgg.config.wwwroot + 'embed/embed';
+ var forward = $('input[name=embed_forward]').val();
+ var url = elgg.normalize_url('embed/tab/' + forward);
$('.embed-wrapper').parent().load(url);
}
}
diff --git a/mod/file/views/default/embed/file/content.php b/mod/file/views/default/embed/file/content.php
deleted file mode 100644
index eadcd1a6d..000000000
--- a/mod/file/views/default/embed/file/content.php
+++ /dev/null
@@ -1,61 +0,0 @@
- elgg_get_logged_in_user_guid(),
- 'type_subtype_pair' => array('object' => 'file'),
- 'count' => true
-);
-
-$count = elgg_get_entities($options);
-
-if ($count) {
- echo "";
-
- unset($options['count']);
- $items = elgg_get_entities($options);
-
- foreach ($items as $item) {
-
- // different entity types have different title attribute names.
- $title = isset($item->name) ? $item->name : $item->title;
- // don't let it be too long
- $title = elgg_get_excerpt($title);
-
- $author_text = elgg_echo('byline', array($owner->name));
- $date = elgg_view_friendly_time($item->time_created);
-
- $subtitle = "$author_text $date";
-
- $icon = "
getIconURL($icon_size)}\" />";
-
- $embed_code = elgg_view('output/url', array(
- 'href' => $item->getURL(),
- 'title' => $title,
- 'text' => $icon,
- 'encode_text' => FALSE
- ));
-
- $item_icon = elgg_view_entity_icon($item, $icon_size);
-
- $params = array(
- 'title' => $title,
- 'entity' => $item,
- 'subtitle' => $subtitle,
- 'tags' => FALSE,
- );
- $list_body = elgg_view('object/elements/summary', $params);
-
- // @todo JS 1.8: is this approach better than inline js?
- echo "
getGUID()}\">" . elgg_view_image_block($item_icon, $list_body) . '
';
- echo "";
- }
-
- echo '
';
-}
\ No newline at end of file
diff --git a/mod/file/views/default/embed/file_upload/content.php b/mod/file/views/default/embed/file_upload/content.php
index 13c18f745..a530b3194 100644
--- a/mod/file/views/default/embed/file_upload/content.php
+++ b/mod/file/views/default/embed/file_upload/content.php
@@ -9,7 +9,12 @@ $form_vars = array(
);
$upload_content = elgg_view_form('file/upload', $form_vars);
-echo "" . elgg_echo('embed:upload_type') . "$input
";
echo "";
echo $upload_content;
-echo "
";
\ No newline at end of file
+echo "";
+
+// the tab we want to be forwarded to after upload is complete
+echo elgg_view('input/hidden', array(
+ 'name' => 'embed_forward',
+ 'value' => 'file',
+));
\ No newline at end of file
--
cgit v1.2.3
From f423684b5303b4196c8c728eb06cbd6eb9aad8b1 Mon Sep 17 00:00:00 2001
From: Brett Profitt
Date: Sun, 2 Oct 2011 19:30:37 -0700
Subject: Merged file mime type detection from 1.7.
---
engine/classes/ElggFile.php | 41 ++++++++++++++++++++++++++++++++++++++++
mod/file/actions/file/upload.php | 7 ++++---
2 files changed, 45 insertions(+), 3 deletions(-)
(limited to 'mod/file')
diff --git a/engine/classes/ElggFile.php b/engine/classes/ElggFile.php
index fe25491a8..f21621ffd 100644
--- a/engine/classes/ElggFile.php
+++ b/engine/classes/ElggFile.php
@@ -120,6 +120,47 @@ class ElggFile extends ElggObject {
return $this->mimetype = $mimetype;
}
+ /**
+ * Detects mime types based on filename or actual file.
+ *
+ * @param mixed $file The full path of the file to check. For uploaded files, use tmp_name.
+ * @param mixed $default A default. Useful to pass what the browser thinks it is.
+ * @since 1.7.12
+ *
+ * @return mixed Detected type on success, false on failure.
+ */
+ static function detectMimeType($file = null, $default = null) {
+ if (!$file) {
+ if (isset($this) && $this->filename) {
+ $file = $this->filename;
+ } else {
+ return false;
+ }
+ }
+
+ $mime = false;
+
+ // for PHP5 folks.
+ if (function_exists('finfo_file') && defined('FILEINFO_MIME_TYPE')) {
+ $resource = finfo_open(FILEINFO_MIME_TYPE);
+ if ($resource) {
+ $mime = finfo_file($resource, $file);
+ }
+ }
+
+ // for everyone else.
+ if (!$mime && function_exists('mime_content_type')) {
+ $mime = mime_content_type($file);
+ }
+
+ // default
+ if (!$mime) {
+ return $default;
+ }
+
+ return $mime;
+ }
+
/**
* Set the optional file description.
*
diff --git a/mod/file/actions/file/upload.php b/mod/file/actions/file/upload.php
index 88a01745d..ee2889b4c 100644
--- a/mod/file/actions/file/upload.php
+++ b/mod/file/actions/file/upload.php
@@ -90,10 +90,11 @@ if (isset($_FILES['upload']['name']) && !empty($_FILES['upload']['name'])) {
$filestorename = elgg_strtolower(time().$_FILES['upload']['name']);
}
- $file->setFilename($prefix.$filestorename);
- $file->setMimeType($_FILES['upload']['type']);
+ $mime_type = $file->detectMimeType($_FILES['upload']['tmp_name'], $_FILES['upload']['type']);
+ $file->setFilename($prefix . $filestorename);
+ $file->setMimeType($mime_type);
$file->originalfilename = $_FILES['upload']['name'];
- $file->simpletype = file_get_simple_type($_FILES['upload']['type']);
+ $file->simpletype = file_get_simple_type($mime_type);
// Open the file to guarantee the directory exists
$file->open("write");
--
cgit v1.2.3
From fa04d6615760a014f7557f2d28ff864eebce8551 Mon Sep 17 00:00:00 2001
From: cash
Date: Mon, 3 Oct 2011 21:30:30 -0400
Subject: removed the sections from the menu to provide more flexibility in tab
ordering
---
mod/embed/README.txt | 36 ++++++++++++----------
mod/embed/views/default/embed/css.php | 2 +-
mod/embed/views/default/embed/layout.php | 25 +++++++--------
mod/embed/views/default/js/embed/embed.php | 2 +-
mod/embed/views/default/navigation/menu/embed.php | 19 +++++-------
mod/file/start.php | 6 ++--
.../views/default/embed/file_upload/content.php | 8 ++---
7 files changed, 44 insertions(+), 54 deletions(-)
(limited to 'mod/file')
diff --git a/mod/embed/README.txt b/mod/embed/README.txt
index c7ce2e528..cecee08c0 100644
--- a/mod/embed/README.txt
+++ b/mod/embed/README.txt
@@ -13,8 +13,9 @@ CONTENTS:
their personal network content or third party resources in any text area.
The Embed plugin adds a menu item to the longtext menu. Clicking on this
- link pops up a lightbox. The lightbox has two types of tabs: one for
- selecting content to embed and one for uploading new content.
+ link pops up a lightbox. The lightbox supports lists of content for insertion
+ and uploading new content.
+
2. Adding a Tab
The Embed plugin uses the menu system to manage its tabs. Use
@@ -23,7 +24,7 @@ CONTENTS:
$item = ElggMenuItem::factory(array(
'name' => 'file',
'text' => elgg_echo('file'),
- 'section' => 'select',
+ 'priority' => 10,
'data' => array(
'options' => array(
'type' => 'object',
@@ -36,32 +37,33 @@ CONTENTS:
Parameters:
name: The unique name of the tab.
text: The text shown on the tab
- section: 'select' for embed selection or 'upload' for uploading new content
- data: an array of parameters for creating the tab and its content. See
- the two sections below for data key values for the two tab types.
-
- Select tab data parameters:
- options: array of options passed to elgg_list_entities()
-
- Upload tab data parameters:
- view: the view used to render the tab content
+ priority: Placement of the tab.
+ data: An array of parameters for creating the tab and its content.
+ When listing content using the embed list view, pass the options for the
+ elgg_list_entities() function as 'options'.
+ When using a custom view for listing content or for uploading new
+ content, pass the view name as 'view'.
See the file plugin for examples of registering both tab types.
-3. Populating a Select Tab
+3. Populating a Content Select Tab
Nothing should be required other than setting the options parameter array
when registering the tab. See the view embed/item to see how an entity is
rendered.
+ If creating a custom list, the elements must have a class of .embed-item.
+ The HTML content that is inserted must use the class .elgg-image.
+
+
4. Populating an Upload Tab
The view that is registered must be defined. It must include a form for
- uploading the content. The form must be wrapped in a div with the class
- .embed-upload. Somewhere in the view must be a hidden input field with the
- name embed_hidden with its value be the name of the tab to forward the user
- to when uploading is complete.
+ uploading the content. The form must .elgg-form-embed. Somewhere in the view
+ must be a hidden input field with the name embed_hidden with its value be
+ the name of the tab to forward the user to when uploading is complete.
See the view embed/file_upload/content for an example
+
5. Other WYSIWYG Editors and Embed
Embed ships with support for the default input/longtext textarea.
diff --git a/mod/embed/views/default/embed/css.php b/mod/embed/views/default/embed/css.php
index 324ed1038..034c0fcfe 100644
--- a/mod/embed/views/default/embed/css.php
+++ b/mod/embed/views/default/embed/css.php
@@ -8,7 +8,7 @@
.embed-wrapper {
width: 730px;
min-height: 400px;
- margin: 15px;
+ margin: 20px 15px;
}
.embed-wrapper h2 {
color: #333333;
diff --git a/mod/embed/views/default/embed/layout.php b/mod/embed/views/default/embed/layout.php
index 73c26810d..c1e43f13c 100644
--- a/mod/embed/views/default/embed/layout.php
+++ b/mod/embed/views/default/embed/layout.php
@@ -8,20 +8,17 @@ $title = elgg_view_title(elgg_echo('embed:media'));
$menu = elgg_view_menu('embed');
$selected = elgg_get_config('embed_tab');
-switch ($selected->getData('tab_type')) {
- case 'select':
- $tab = elgg_list_entities(
- embed_get_list_options($selected->getData('options')),
- 'elgg_get_entities',
- 'embed_list_items'
- );
- if (!$tab) {
- $tab = elgg_echo('embed:no_section_content');
- }
- break;
- case 'upload':
- $tab = elgg_view($selected->getData('view'), $vars);
- break;
+if ($selected->getData('view')) {
+ $tab = elgg_view($selected->getData('view'), $vars);
+} else {
+ $tab = elgg_list_entities(
+ embed_get_list_options($selected->getData('options')),
+ 'elgg_get_entities',
+ 'embed_list_items'
+ );
+ if (!$tab) {
+ $tab = elgg_echo('embed:no_section_content');
+ }
}
echo << $menu_item->getText(),
- 'url' => 'embed/tab/' . $menu_item->getName(),
- 'url_class' => 'embed-section',
- 'selected' => $menu_item->getSelected(),
- );
- }
+foreach ($vars['menu']['default'] as $menu_item) {
+ $tabs[] = array(
+ 'title' => $menu_item->getText(),
+ 'url' => 'embed/tab/' . $menu_item->getName(),
+ 'url_class' => 'embed-section',
+ 'selected' => $menu_item->getSelected(),
+ );
}
echo elgg_view('navigation/tabs', array('tabs' => $tabs));
diff --git a/mod/file/start.php b/mod/file/start.php
index 16ce0e233..843ae0794 100644
--- a/mod/file/start.php
+++ b/mod/file/start.php
@@ -61,9 +61,8 @@ function file_init() {
$item = ElggMenuItem::factory(array(
'name' => 'file',
'text' => elgg_echo('file'),
- 'section' => 'select',
+ 'priority' => 10,
'data' => array(
- 'tab_type' => 'select',
'options' => array(
'type' => 'object',
'subtype' => 'file',
@@ -75,9 +74,8 @@ function file_init() {
$item = ElggMenuItem::factory(array(
'name' => 'file_upload',
'text' => elgg_echo('file:upload'),
- 'section' => 'upload',
+ 'priority' => 100,
'data' => array(
- 'tab_type' => 'upload',
'view' => 'embed/file_upload/content',
),
));
diff --git a/mod/file/views/default/embed/file_upload/content.php b/mod/file/views/default/embed/file_upload/content.php
index a530b3194..4d3db0d97 100644
--- a/mod/file/views/default/embed/file_upload/content.php
+++ b/mod/file/views/default/embed/file_upload/content.php
@@ -5,13 +5,9 @@
$form_vars = array(
'enctype' => 'multipart/form-data',
- 'class' => 'elgg-form',
+ 'class' => 'elgg-form-embed',
);
-$upload_content = elgg_view_form('file/upload', $form_vars);
-
-echo "";
-echo $upload_content;
-echo "
";
+echo elgg_view_form('file/upload', $form_vars);
// the tab we want to be forwarded to after upload is complete
echo elgg_view('input/hidden', array(
--
cgit v1.2.3
From 9d5c00c78c0666a31485d870a1e657d4557b23c4 Mon Sep 17 00:00:00 2001
From: cash
Date: Mon, 3 Oct 2011 21:56:14 -0400
Subject: using better insert class
---
mod/embed/README.txt | 2 +-
mod/embed/views/default/embed/item.php | 2 +-
mod/embed/views/default/js/embed/embed.php | 2 +-
mod/file/views/default/icon/object/file.php | 15 ++++++++++-----
views/default/icon/default.php | 5 ++++-
5 files changed, 17 insertions(+), 9 deletions(-)
(limited to 'mod/file')
diff --git a/mod/embed/README.txt b/mod/embed/README.txt
index cecee08c0..51b120d96 100644
--- a/mod/embed/README.txt
+++ b/mod/embed/README.txt
@@ -53,7 +53,7 @@ CONTENTS:
rendered.
If creating a custom list, the elements must have a class of .embed-item.
- The HTML content that is inserted must use the class .elgg-image.
+ The HTML content that is inserted must use the class .embed-insert.
4. Populating an Upload Tab
diff --git a/mod/embed/views/default/embed/item.php b/mod/embed/views/default/embed/item.php
index 4087b7408..3060de879 100644
--- a/mod/embed/views/default/embed/item.php
+++ b/mod/embed/views/default/embed/item.php
@@ -34,6 +34,6 @@ $params = array(
);
$body = elgg_view('object/elements/summary', $params);
-$image = elgg_view_entity_icon($entity, 'small');
+$image = elgg_view_entity_icon($entity, 'small', array('link_class' => 'embed-insert'));
echo elgg_view_image_block($image, $body);
diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php
index bb80919a9..3126e12f7 100644
--- a/mod/embed/views/default/js/embed/embed.php
+++ b/mod/embed/views/default/js/embed/embed.php
@@ -34,7 +34,7 @@ elgg.embed.insert = function(event) {
var textArea = $('#' + textAreaId);
// generalize this based on a css class attached to what should be inserted
- var content = ' ' + $(this).find(".elgg-image").html() + ' ';
+ var content = ' ' + $(this).find(".embed-insert").parent().html() + ' ';
textArea.val(textArea.val() + content);
textArea.focus();
diff --git a/mod/file/views/default/icon/object/file.php b/mod/file/views/default/icon/object/file.php
index 6357d418f..7feba7af3 100644
--- a/mod/file/views/default/icon/object/file.php
+++ b/mod/file/views/default/icon/object/file.php
@@ -2,9 +2,10 @@
/**
* File icon view
*
- * @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['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['link_class'] Optional CSS class added to img
*/
$entity = $vars['entity'];
@@ -32,10 +33,14 @@ $img_src = elgg_format_url($img_src);
$img = " ";
if ($url) {
- echo elgg_view('output/url', array(
+ $params = array(
'href' => $url,
'text' => $img,
- ));
+ );
+ if (isset($vars['link_class'])) {
+ $params['class'] = $vars['link_class'];
+ }
+ echo elgg_view('output/url', $params);
} else {
echo $img;
}
diff --git a/views/default/icon/default.php b/views/default/icon/default.php
index c5749ba04..3abd96b96 100644
--- a/views/default/icon/default.php
+++ b/views/default/icon/default.php
@@ -8,6 +8,7 @@
* @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
*/
$entity = $vars['entity'];
@@ -18,6 +19,8 @@ if (!in_array($vars['size'], $sizes)) {
$vars['size'] = "medium";
}
+$class = elgg_extract('img_class', $vars, '');
+
if (isset($entity->name)) {
$title = $entity->name;
} else {
@@ -30,7 +33,7 @@ if (isset($vars['href'])) {
}
$img_src = $entity->getIconURL($vars['size']);
-$img = " ";
+$img = " ";
if ($url) {
echo elgg_view('output/url', array(
--
cgit v1.2.3
From d5f0d44d4ddf33db2248ef0bdd44633d57c31683 Mon Sep 17 00:00:00 2001
From: Cash Costello
Date: Sat, 8 Oct 2011 08:22:08 -0400
Subject: Fixes #3411 output/url now has a is_trusted parameter - defaults to
false
---
engine/classes/ElggMenuItem.php | 4 +++
mod/blog/views/default/blog/group_module.php | 2 ++
mod/blog/views/default/blog/sidebar/revisions.php | 6 ++--
mod/blog/views/default/object/blog.php | 2 ++
mod/blog/views/default/widgets/blog/content.php | 1 +
.../views/default/bookmarks/group_module.php | 2 ++
mod/bookmarks/views/default/object/bookmarks.php | 9 +++---
.../views/default/widgets/bookmarks/content.php | 1 +
.../views/default/theme_preview/general.php | 1 +
.../admin/develop_utilities/diagnostics.php | 1 +
mod/file/views/default/file/group_module.php | 2 ++
mod/file/views/default/icon/object/file.php | 1 +
mod/file/views/default/object/file.php | 2 ++
.../views/default/widgets/filerepo/content.php | 1 +
.../views/default/discussion/group_module.php | 2 ++
.../views/default/groups/invitationrequests.php | 2 ++
.../views/default/groups/membershiprequests.php | 2 ++
.../default/groups/profile/activity_module.php | 1 +
.../views/default/groups/profile/summary.php | 1 +
.../views/default/groups/sidebar/members.php | 1 +
.../views/default/object/groupforumtopic.php | 2 ++
.../default/widgets/a_users_groups/content.php | 1 +
mod/likes/views/default/annotation/likes.php | 1 +
mod/likes/views/default/likes/button.php | 2 ++
mod/logbrowser/views/default/logbrowser/table.php | 9 ++++--
.../views/default/widgets/messageboard/content.php | 1 +
mod/messages/views/default/object/messages.php | 3 ++
mod/pages/views/default/annotation/page.php | 2 ++
mod/pages/views/default/object/page_top.php | 2 ++
mod/pages/views/default/pages/group_module.php | 2 ++
mod/pages/views/default/widgets/pages/content.php | 1 +
.../views/default/object/reported_content.php | 8 ++++--
mod/thewire/views/default/object/thewire.php | 1 +
.../views/default/river/object/thewire/create.php | 2 ++
.../views/default/thewire/profile_status.php | 1 +
.../views/default/widgets/thewire/content.php | 1 +
.../forms/twitter_api/interstitial_settings.php | 1 +
.../forms/uservalidationbyemail/bulk_action.php | 21 ++++++++------
views/default/admin/appearance/default_widgets.php | 1 +
.../admin/appearance/profile_fields/list.php | 3 +-
views/default/admin/header.php | 2 ++
views/default/icon/default.php | 1 +
views/default/icon/user/default.php | 1 +
views/default/navigation/breadcrumbs.php | 1 +
views/default/navigation/menu/user_hover.php | 1 +
views/default/navigation/pagination.php | 2 ++
views/default/navigation/tabs.php | 6 +++-
views/default/object/admin_notice.php | 3 +-
views/default/object/default.php | 1 +
views/default/object/elements/summary.php | 1 +
views/default/object/plugin/advanced.php | 33 +++++++++++++---------
views/default/object/plugin/simple.php | 3 +-
views/default/object/widget/elements/controls.php | 1 +
views/default/output/tag.php | 6 +++-
views/default/output/url.php | 15 ++++++++--
views/default/page/elements/footer.php | 1 +
views/default/page/elements/tagcloud_block.php | 1 +
views/default/page/layouts/widgets/add_button.php | 1 +
views/default/river/elements/body.php | 2 ++
views/default/river/elements/responses.php | 1 +
views/default/river/elements/summary.php | 3 ++
.../river/user/default/profileiconupdate.php | 1 +
views/default/river/user/default/profileupdate.php | 1 +
views/default/widgets/content_stats/content.php | 1 +
64 files changed, 157 insertions(+), 41 deletions(-)
(limited to 'mod/file')
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php
index b9c81fd78..8ddb1ecd8 100644
--- a/engine/classes/ElggMenuItem.php
+++ b/engine/classes/ElggMenuItem.php
@@ -549,6 +549,10 @@ class ElggMenuItem {
}
}
+ if (!isset($vars['rel']) && !isset($vars['is_trusted'])) {
+ $vars['is_trusted'] = true;
+ }
+
if ($this->confirm) {
$vars['confirm'] = $this->confirm;
return elgg_view('output/confirmlink', $vars);
diff --git a/mod/blog/views/default/blog/group_module.php b/mod/blog/views/default/blog/group_module.php
index d769fbd59..028827178 100644
--- a/mod/blog/views/default/blog/group_module.php
+++ b/mod/blog/views/default/blog/group_module.php
@@ -12,6 +12,7 @@ if ($group->blog_enable == "no") {
$all_link = elgg_view('output/url', array(
'href' => "blog/group/$group->guid/all",
'text' => elgg_echo('link:view:all'),
+ 'is_trusted' => true,
));
elgg_push_context('widgets');
@@ -33,6 +34,7 @@ if (!$content) {
$new_link = elgg_view('output/url', array(
'href' => "blog/add/$group->guid",
'text' => elgg_echo('blog:write'),
+ 'is_trusted' => true,
));
echo elgg_view('groups/profile/module', array(
diff --git a/mod/blog/views/default/blog/sidebar/revisions.php b/mod/blog/views/default/blog/sidebar/revisions.php
index c23b3b052..cd2e7f3d8 100644
--- a/mod/blog/views/default/blog/sidebar/revisions.php
+++ b/mod/blog/views/default/blog/sidebar/revisions.php
@@ -39,7 +39,8 @@ if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) {
if ($blog->status == 'published') {
$load = elgg_view('output/url', array(
'href' => $load_base_url,
- 'text' => elgg_echo('blog:status:published')
+ 'text' => elgg_echo('blog:status:published'),
+ 'is_trusted' => true,
));
$time = ""
@@ -59,7 +60,8 @@ if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) {
}
$load = elgg_view('output/url', array(
'href' => "$load_base_url/$revision->id",
- 'text' => $revision_lang
+ 'text' => $revision_lang,
+ 'is_trusted' => true,
));
$text = "$load: $time";
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php
index ba08180b1..ab75bd09b 100644
--- a/mod/blog/views/default/object/blog.php
+++ b/mod/blog/views/default/object/blog.php
@@ -21,6 +21,7 @@ $owner_icon = elgg_view_entity_icon($owner, 'tiny');
$owner_link = elgg_view('output/url', array(
'href' => "blog/owner/$owner->username",
'text' => $owner->name,
+ 'is_trusted' => true,
));
$author_text = elgg_echo('byline', array($owner_link));
$tags = elgg_view('output/tags', array('tags' => $blog->tags));
@@ -35,6 +36,7 @@ if ($blog->comments_on != 'Off') {
$comments_link = elgg_view('output/url', array(
'href' => $blog->getURL() . '#blog-comments',
'text' => $text,
+ 'is_trusted' => true,
));
} else {
$comments_link = '';
diff --git a/mod/blog/views/default/widgets/blog/content.php b/mod/blog/views/default/widgets/blog/content.php
index 7bbfc3c74..330171662 100644
--- a/mod/blog/views/default/widgets/blog/content.php
+++ b/mod/blog/views/default/widgets/blog/content.php
@@ -22,6 +22,7 @@ if ($content) {
$more_link = elgg_view('output/url', array(
'href' => $blog_url,
'text' => elgg_echo('blog:moreblogs'),
+ 'is_trusted' => true,
));
echo "$more_link ";
} else {
diff --git a/mod/bookmarks/views/default/bookmarks/group_module.php b/mod/bookmarks/views/default/bookmarks/group_module.php
index 3797de010..60a727819 100644
--- a/mod/bookmarks/views/default/bookmarks/group_module.php
+++ b/mod/bookmarks/views/default/bookmarks/group_module.php
@@ -14,6 +14,7 @@ if ($group->bookmarks_enable == "no") {
$all_link = elgg_view('output/url', array(
'href' => "bookmarks/group/$group->guid/all",
'text' => elgg_echo('link:view:all'),
+ 'is_trusted' => true,
));
elgg_push_context('widgets');
@@ -35,6 +36,7 @@ if (!$content) {
$new_link = elgg_view('output/url', array(
'href' => "bookmarks/add/$group->guid",
'text' => elgg_echo('bookmarks:add'),
+ 'is_trusted' => true,
));
echo elgg_view('groups/profile/module', array(
diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php
index ca1f5d312..784263232 100644
--- a/mod/bookmarks/views/default/object/bookmarks.php
+++ b/mod/bookmarks/views/default/object/bookmarks.php
@@ -17,12 +17,13 @@ $owner_icon = elgg_view_entity_icon($owner, 'tiny');
$container = $bookmark->getContainerEntity();
$categories = elgg_view('output/categories', $vars);
-$link = filter_tags(elgg_view('output/url', array('href' => $bookmark->address, 'rel' => 'nofollow')));
+$link = elgg_view('output/url', array('href' => $bookmark->address));
$description = elgg_view('output/longtext', array('value' => $bookmark->description, 'class' => 'pbl'));
$owner_link = elgg_view('output/url', array(
'href' => "bookmarks/owner/$owner->username",
'text' => $owner->name,
+ 'is_trusted' => true,
));
$author_text = elgg_echo('byline', array($owner_link));
@@ -36,6 +37,7 @@ if ($comments_count != 0) {
$comments_link = elgg_view('output/url', array(
'href' => $bookmark->getURL() . '#comments',
'text' => $text,
+ 'is_trusted' => true,
));
} else {
$comments_link = '';
@@ -104,11 +106,10 @@ HTML;
}
}
- $link = filter_tags(elgg_view('output/url', array(
+ $link = elgg_view('output/url', array(
'href' => $bookmark->address,
'text' => $display_text,
- 'rel' => 'nofollow',
- )));
+ ));
$content = elgg_view_icon('push-pin-alt') . "$link{$excerpt}";
diff --git a/mod/bookmarks/views/default/widgets/bookmarks/content.php b/mod/bookmarks/views/default/widgets/bookmarks/content.php
index ea7816345..0b85017fc 100644
--- a/mod/bookmarks/views/default/widgets/bookmarks/content.php
+++ b/mod/bookmarks/views/default/widgets/bookmarks/content.php
@@ -24,6 +24,7 @@ if ($content) {
$more_link = elgg_view('output/url', array(
'href' => $url,
'text' => elgg_echo('bookmarks:more'),
+ 'is_trusted' => true,
));
echo "$more_link ";
} else {
diff --git a/mod/developers/views/default/theme_preview/general.php b/mod/developers/views/default/theme_preview/general.php
index 1a0b54c88..35d8ccbfd 100644
--- a/mod/developers/views/default/theme_preview/general.php
+++ b/mod/developers/views/default/theme_preview/general.php
@@ -17,6 +17,7 @@
'text' => elgg_echo('theme_preview:breakout'),
'href' => current_page_url(),
'target' => '_parent',
+ 'is_trusted' => true,
));
?>
diff --git a/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php b/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php
index 76f12b0ae..b41907da2 100644
--- a/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php
+++ b/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php
@@ -18,6 +18,7 @@ if (elgg_get_config('debug')) {
'text' => elgg_echo('diagnostics:test:executeall'),
'href' => 'engine/tests/suite.php',
'class' => 'elgg-button elgg-button-submit',
+ 'is_trusted' => true,
);
$unit_tests .= '' . elgg_view('output/url', $params) . '
';
} else {
diff --git a/mod/file/views/default/file/group_module.php b/mod/file/views/default/file/group_module.php
index c37b13927..ad6c58dbb 100644
--- a/mod/file/views/default/file/group_module.php
+++ b/mod/file/views/default/file/group_module.php
@@ -12,6 +12,7 @@ if ($group->file_enable == "no") {
$all_link = elgg_view('output/url', array(
'href' => "file/group/$group->guid/all",
'text' => elgg_echo('link:view:all'),
+ 'is_trusted' => true,
));
elgg_push_context('widgets');
@@ -33,6 +34,7 @@ if (!$content) {
$new_link = elgg_view('output/url', array(
'href' => "file/add/$group->guid",
'text' => elgg_echo('file:add'),
+ 'is_trusted' => true,
));
echo elgg_view('groups/profile/module', array(
diff --git a/mod/file/views/default/icon/object/file.php b/mod/file/views/default/icon/object/file.php
index 7feba7af3..ff729da94 100644
--- a/mod/file/views/default/icon/object/file.php
+++ b/mod/file/views/default/icon/object/file.php
@@ -36,6 +36,7 @@ if ($url) {
$params = array(
'href' => $url,
'text' => $img,
+ 'is_trusted' => true,
);
if (isset($vars['link_class'])) {
$params['class'] = $vars['link_class'];
diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php
index 95e190d35..fbd585b8a 100644
--- a/mod/file/views/default/object/file.php
+++ b/mod/file/views/default/object/file.php
@@ -24,6 +24,7 @@ $body = elgg_view('output/longtext', array('value' => $file->description));
$owner_link = elgg_view('output/url', array(
'href' => "file/owner/$owner->username",
'text' => $owner->name,
+ 'is_trusted' => true,
));
$author_text = elgg_echo('byline', array($owner_link));
@@ -39,6 +40,7 @@ if ($comments_count != 0) {
$comments_link = elgg_view('output/url', array(
'href' => $file->getURL() . '#file-comments',
'text' => $text,
+ 'is_trusted' => true,
));
} else {
$comments_link = '';
diff --git a/mod/file/views/default/widgets/filerepo/content.php b/mod/file/views/default/widgets/filerepo/content.php
index 4288b9e56..f3e152de3 100644
--- a/mod/file/views/default/widgets/filerepo/content.php
+++ b/mod/file/views/default/widgets/filerepo/content.php
@@ -25,6 +25,7 @@ if ($content) {
$more_link = elgg_view('output/url', array(
'href' => $url,
'text' => elgg_echo('file:more'),
+ 'is_trusted' => true,
));
echo "$more_link ";
} else {
diff --git a/mod/groups/views/default/discussion/group_module.php b/mod/groups/views/default/discussion/group_module.php
index 3a46e336e..3c9961f82 100644
--- a/mod/groups/views/default/discussion/group_module.php
+++ b/mod/groups/views/default/discussion/group_module.php
@@ -15,6 +15,7 @@ $group = $vars['entity'];
$all_link = elgg_view('output/url', array(
'href' => "discussion/owner/$group->guid",
'text' => elgg_echo('link:view:all'),
+ 'is_trusted' => true,
));
elgg_push_context('widgets');
@@ -36,6 +37,7 @@ if (!$content) {
$new_link = elgg_view('output/url', array(
'href' => "discussion/add/" . $group->getGUID(),
'text' => elgg_echo('groups:addtopic'),
+ 'is_trusted' => true,
));
echo elgg_view('groups/profile/module', array(
diff --git a/mod/groups/views/default/groups/invitationrequests.php b/mod/groups/views/default/groups/invitationrequests.php
index 9c2df8b9c..e644b6bdc 100644
--- a/mod/groups/views/default/groups/invitationrequests.php
+++ b/mod/groups/views/default/groups/invitationrequests.php
@@ -15,6 +15,7 @@ if (!empty($vars['invitations']) && is_array($vars['invitations'])) {
$group_title = elgg_view('output/url', array(
'href' => $group->getURL(),
'text' => $group->name,
+ 'is_trusted' => true,
));
$url = elgg_add_action_tokens_to_url(elgg_get_site_url()."action/groups/join?user_guid={$user->guid}&group_guid={$group->guid}");
@@ -22,6 +23,7 @@ if (!empty($vars['invitations']) && is_array($vars['invitations'])) {
'href' => $url,
'text' => elgg_echo('accept'),
'class' => 'elgg-button elgg-button-submit',
+ 'is_trusted' => true,
));
$url = "action/groups/killinvitation?user_guid={$user->getGUID()}&group_guid={$group->getGUID()}";
diff --git a/mod/groups/views/default/groups/membershiprequests.php b/mod/groups/views/default/groups/membershiprequests.php
index 7f33b83e0..489d6f5e3 100644
--- a/mod/groups/views/default/groups/membershiprequests.php
+++ b/mod/groups/views/default/groups/membershiprequests.php
@@ -16,6 +16,7 @@ if (!empty($vars['requests']) && is_array($vars['requests'])) {
$user_title = elgg_view('output/url', array(
'href' => $user->getURL(),
'text' => $user->name,
+ 'is_trusted' => true,
));
$url = "action/groups/addtogroup?user_guid={$user->guid}&group_guid={$vars['entity']->guid}";
@@ -24,6 +25,7 @@ if (!empty($vars['requests']) && is_array($vars['requests'])) {
'href' => $url,
'text' => elgg_echo('accept'),
'class' => 'elgg-button elgg-button-submit',
+ 'is_trusted' => true,
));
$url = 'action/groups/killrequest?user_guid=' . $user->guid . '&group_guid=' . $vars['entity']->guid;
diff --git a/mod/groups/views/default/groups/profile/activity_module.php b/mod/groups/views/default/groups/profile/activity_module.php
index 5e557b443..832ff4a4b 100644
--- a/mod/groups/views/default/groups/profile/activity_module.php
+++ b/mod/groups/views/default/groups/profile/activity_module.php
@@ -19,6 +19,7 @@ if (!$group) {
$all_link = elgg_view('output/url', array(
'href' => "groups/activity/$group->guid",
'text' => elgg_echo('link:view:all'),
+ 'is_trusted' => true,
));
diff --git a/mod/groups/views/default/groups/profile/summary.php b/mod/groups/views/default/groups/profile/summary.php
index b7ae51070..54abcb1e5 100644
--- a/mod/groups/views/default/groups/profile/summary.php
+++ b/mod/groups/views/default/groups/profile/summary.php
@@ -28,6 +28,7 @@ $owner = $group->getOwnerEntity();
echo elgg_view('output/url', array(
'text' => $owner->name,
'value' => $owner->getURL(),
+ 'is_trusted' => true,
));
?>
diff --git a/mod/groups/views/default/groups/sidebar/members.php b/mod/groups/views/default/groups/sidebar/members.php
index 7249ffbf4..49f14697c 100644
--- a/mod/groups/views/default/groups/sidebar/members.php
+++ b/mod/groups/views/default/groups/sidebar/members.php
@@ -13,6 +13,7 @@ $limit = elgg_extract('limit', $vars, 10);
$all_link = elgg_view('output/url', array(
'href' => 'groups/members/' . $vars['entity']->guid,
'text' => elgg_echo('groups:members:more'),
+ 'is_trusted' => true,
));
$body = elgg_list_entities_from_relationship(array(
diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php
index 22589b84d..f3d5f96d5 100644
--- a/mod/groups/views/default/object/groupforumtopic.php
+++ b/mod/groups/views/default/object/groupforumtopic.php
@@ -20,6 +20,7 @@ $poster_icon = elgg_view_entity_icon($poster, 'tiny');
$poster_link = elgg_view('output/url', array(
'href' => $poster->getURL(),
'text' => $poster->name,
+ 'is_trusted' => true,
));
$poster_text = elgg_echo('groups:started', array($poster->name));
@@ -42,6 +43,7 @@ if ($num_replies != 0) {
$replies_link = elgg_view('output/url', array(
'href' => $topic->getURL() . '#group-replies',
'text' => elgg_echo('group:replies') . " ($num_replies)",
+ 'is_trusted' => true,
));
}
diff --git a/mod/groups/views/default/widgets/a_users_groups/content.php b/mod/groups/views/default/widgets/a_users_groups/content.php
index 114fd7565..fe1a46e39 100644
--- a/mod/groups/views/default/widgets/a_users_groups/content.php
+++ b/mod/groups/views/default/widgets/a_users_groups/content.php
@@ -25,6 +25,7 @@ if ($content) {
$more_link = elgg_view('output/url', array(
'href' => $url,
'text' => elgg_echo('groups:more'),
+ 'is_trusted' => true,
));
echo "$more_link ";
} else {
diff --git a/mod/likes/views/default/annotation/likes.php b/mod/likes/views/default/annotation/likes.php
index 2dd01b6cd..314d0790d 100644
--- a/mod/likes/views/default/annotation/likes.php
+++ b/mod/likes/views/default/annotation/likes.php
@@ -20,6 +20,7 @@ $user_icon = elgg_view_entity_icon($user, 'tiny');
$user_link = elgg_view('output/url', array(
'href' => $user->getURL(),
'text' => $user->name,
+ 'is_trusted' => true,
));
$likes_string = elgg_echo('likes:this');
diff --git a/mod/likes/views/default/likes/button.php b/mod/likes/views/default/likes/button.php
index 383e1bb63..3f2f073cc 100644
--- a/mod/likes/views/default/likes/button.php
+++ b/mod/likes/views/default/likes/button.php
@@ -20,6 +20,7 @@ if (elgg_is_logged_in() && $vars['entity']->canAnnotate(0, 'likes')) {
'text' => elgg_view_icon('thumbs-up'),
'title' => elgg_echo('likes:likethis'),
'is_action' => true,
+ 'is_trusted' => true,
);
$likes_button = elgg_view('output/url', $params);
} else {
@@ -34,6 +35,7 @@ if (elgg_is_logged_in() && $vars['entity']->canAnnotate(0, 'likes')) {
'text' => elgg_view_icon('thumbs-up-alt'),
'title' => elgg_echo('likes:remove'),
'is_action' => true,
+ 'is_trusted' => true,
);
$likes_button = elgg_view('output/url', $params);
}
diff --git a/mod/logbrowser/views/default/logbrowser/table.php b/mod/logbrowser/views/default/logbrowser/table.php
index 86c8a1423..b7f6a1f20 100644
--- a/mod/logbrowser/views/default/logbrowser/table.php
+++ b/mod/logbrowser/views/default/logbrowser/table.php
@@ -24,11 +24,13 @@ $log_entries = $vars['log_entries'];
if ($user) {
$user_link = elgg_view('output/url', array(
'href' => $user->getURL(),
- 'text' => $user->name
+ 'text' => $user->name,
+ 'is_trusted' => true,
));
$user_guid_link = elgg_view('output/url', array(
'href' => "admin/overview/logbrowser?user_guid=$user->guid",
- 'text' => $user->getGUID()
+ 'text' => $user->getGUID(),
+ 'is_trusted' => true,
));
} else {
$user_guid_link = $user_link = ' ';
@@ -38,7 +40,8 @@ $log_entries = $vars['log_entries'];
if (is_callable(array($object, 'getURL'))) {
$object_link = elgg_view('output/url', array(
'href' => $object->getURL(),
- 'text' => $entry->object_class
+ 'text' => $entry->object_class,
+ 'is_trusted' => true,
));
} else {
$object_link = $entry->object_class;
diff --git a/mod/messageboard/views/default/widgets/messageboard/content.php b/mod/messageboard/views/default/widgets/messageboard/content.php
index 63f389e6a..35954e7a3 100644
--- a/mod/messageboard/views/default/widgets/messageboard/content.php
+++ b/mod/messageboard/views/default/widgets/messageboard/content.php
@@ -31,4 +31,5 @@ if ($owner instanceof ElggGroup) {
echo elgg_view('output/url', array(
'href' => $url,
'text' => elgg_echo('messageboard:viewall'),
+ 'is_trusted' => true,
));
\ No newline at end of file
diff --git a/mod/messages/views/default/object/messages.php b/mod/messages/views/default/object/messages.php
index b6f9ed6d5..8c840dd57 100644
--- a/mod/messages/views/default/object/messages.php
+++ b/mod/messages/views/default/object/messages.php
@@ -24,6 +24,7 @@ if ($message->toId == elgg_get_page_owner_guid()) {
$user_link = elgg_view('output/url', array(
'href' => "messages/compose?send_to=$user->guid",
'text' => $user->name,
+ 'is_trusted' => true,
));
} else {
$icon = '';
@@ -45,6 +46,7 @@ if ($message->toId == elgg_get_page_owner_guid()) {
$user_link = elgg_view('output/url', array(
'href' => "messages/compose?send_to=$user->guid",
'text' => elgg_echo('messages:to_user', array($user->name)),
+ 'is_trusted' => true,
));
} else {
$icon = '';
@@ -63,6 +65,7 @@ if (!$full) {
$subject_info .= elgg_view('output/url', array(
'href' => $message->getURL(),
'text' => $message->title,
+ 'is_trusted' => true,
));
$delete_link = elgg_view("output/confirmlink", array(
diff --git a/mod/pages/views/default/annotation/page.php b/mod/pages/views/default/annotation/page.php
index f7a7a78a1..a621b9281 100644
--- a/mod/pages/views/default/annotation/page.php
+++ b/mod/pages/views/default/annotation/page.php
@@ -21,6 +21,7 @@ if (!$owner) {
$owner_link = elgg_view('output/url', array(
'href' => $owner->getURL(),
'text' => $owner->name,
+ 'is_trusted' => true,
));
$date = elgg_view_friendly_time($annotation->time_created);
@@ -28,6 +29,7 @@ $date = elgg_view_friendly_time($annotation->time_created);
$title_link = elgg_view('output/url', array(
'href' => $annotation->getURL(),
'text' => $page->title,
+ 'is_trusted' => true,
));
$subtitle = elgg_echo('pages:revision:subtitle', array($date, $owner_link));
diff --git a/mod/pages/views/default/object/page_top.php b/mod/pages/views/default/object/page_top.php
index 8ba9fc298..0f7b51a0e 100644
--- a/mod/pages/views/default/object/page_top.php
+++ b/mod/pages/views/default/object/page_top.php
@@ -40,6 +40,7 @@ $editor = get_entity($annotation->owner_guid);
$editor_link = elgg_view('output/url', array(
'href' => "pages/owner/$editor->username",
'text' => $editor->name,
+ 'is_trusted' => true,
));
$date = elgg_view_friendly_time($annotation->time_created);
@@ -53,6 +54,7 @@ if ($comments_count != 0 && !$revision) {
$comments_link = elgg_view('output/url', array(
'href' => $page->getURL() . '#page-comments',
'text' => $text,
+ 'is_trusted' => true,
));
} else {
$comments_link = '';
diff --git a/mod/pages/views/default/pages/group_module.php b/mod/pages/views/default/pages/group_module.php
index 7e2656ca3..0d7df96ac 100644
--- a/mod/pages/views/default/pages/group_module.php
+++ b/mod/pages/views/default/pages/group_module.php
@@ -15,6 +15,7 @@ if ($group->pages_enable == "no") {
$all_link = elgg_view('output/url', array(
'href' => "pages/group/$group->guid/all",
'text' => elgg_echo('link:view:all'),
+ 'is_trusted' => true,
));
@@ -37,6 +38,7 @@ if (!$content) {
$new_link = elgg_view('output/url', array(
'href' => "pages/add/$group->guid",
'text' => elgg_echo('pages:add'),
+ 'is_trusted' => true,
));
echo elgg_view('groups/profile/module', array(
diff --git a/mod/pages/views/default/widgets/pages/content.php b/mod/pages/views/default/widgets/pages/content.php
index 3ae0b8454..f63777c09 100644
--- a/mod/pages/views/default/widgets/pages/content.php
+++ b/mod/pages/views/default/widgets/pages/content.php
@@ -24,6 +24,7 @@ if ($content) {
$more_link = elgg_view('output/url', array(
'href' => $url,
'text' => elgg_echo('pages:more'),
+ 'is_trusted' => true,
));
echo "$more_link ";
} else {
diff --git a/mod/reportedcontent/views/default/object/reported_content.php b/mod/reportedcontent/views/default/object/reported_content.php
index 6bcbf6e5d..0e733e154 100644
--- a/mod/reportedcontent/views/default/object/reported_content.php
+++ b/mod/reportedcontent/views/default/object/reported_content.php
@@ -29,6 +29,7 @@ if ($report->state == 'archived') {
'href' => $archive_url,
'text' => elgg_echo('reportedcontent:archive'),
'is_action' => true,
+ 'is_trusted' => true,
'class' => 'elgg-button elgg-button-action',
);
echo elgg_view('output/url', $params);
@@ -37,6 +38,7 @@ if ($report->state == 'archived') {
'href' => $delete_url,
'text' => elgg_echo('reportedcontent:delete'),
'is_action' => true,
+ 'is_trusted' => true,
'class' => 'elgg-button elgg-button-action',
);
echo elgg_view('output/url', $params);
@@ -46,7 +48,8 @@ if ($report->state == 'archived') {
:
$reporter->getURL(),
- 'text' => $reporter->name
+ 'text' => $reporter->name,
+ 'is_trusted' => true,
));
?>,
time_created); ?>
@@ -68,7 +71,8 @@ if ($report->state == 'archived') {
:
$report->address,
- 'text' => elgg_echo('reportedcontent:visit')
+ 'text' => elgg_echo('reportedcontent:visit'),
+ 'is_trusted' => true,
));
?>
diff --git a/mod/thewire/views/default/object/thewire.php b/mod/thewire/views/default/object/thewire.php
index 2727df60d..134c87243 100644
--- a/mod/thewire/views/default/object/thewire.php
+++ b/mod/thewire/views/default/object/thewire.php
@@ -26,6 +26,7 @@ $owner_icon = elgg_view_entity_icon($owner, 'tiny');
$owner_link = elgg_view('output/url', array(
'href' => "thewire/owner/$owner->username",
'text' => $owner->name,
+ 'is_trusted' => true,
));
$author_text = elgg_echo('byline', array($owner_link));
$date = elgg_view_friendly_time($post->time_created);
diff --git a/mod/thewire/views/default/river/object/thewire/create.php b/mod/thewire/views/default/river/object/thewire/create.php
index c3c434858..fbf592664 100644
--- a/mod/thewire/views/default/river/object/thewire/create.php
+++ b/mod/thewire/views/default/river/object/thewire/create.php
@@ -12,12 +12,14 @@ $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' => "thewire/owner/$subject->username",
'text' => elgg_echo('thewire:wire'),
'class' => 'elgg-river-object',
+ 'is_trusted' => true,
));
$summary = elgg_echo("river:create:object:thewire", array($subject_link, $object_link));
diff --git a/mod/thewire/views/default/thewire/profile_status.php b/mod/thewire/views/default/thewire/profile_status.php
index 6ab47bccb..ab20b5341 100644
--- a/mod/thewire/views/default/thewire/profile_status.php
+++ b/mod/thewire/views/default/thewire/profile_status.php
@@ -28,6 +28,7 @@ if ($latest_wire && count($latest_wire) > 0) {
'text' => elgg_echo('thewire:update'),
'href' => $url_to_wire,
'class' => 'elgg-button elgg-button-action right',
+ 'is_trusted' => true,
));
}
diff --git a/mod/thewire/views/default/widgets/thewire/content.php b/mod/thewire/views/default/widgets/thewire/content.php
index 835a328b0..7212d4397 100644
--- a/mod/thewire/views/default/widgets/thewire/content.php
+++ b/mod/thewire/views/default/widgets/thewire/content.php
@@ -22,6 +22,7 @@ if ($content) {
$more_link = elgg_view('output/url', array(
'href' => $owner_url,
'text' => elgg_echo('thewire:moreposts'),
+ 'is_trusted' => true,
));
echo "$more_link ";
} else {
diff --git a/mod/twitter_api/views/default/forms/twitter_api/interstitial_settings.php b/mod/twitter_api/views/default/forms/twitter_api/interstitial_settings.php
index fdeafd46d..2592013c6 100644
--- a/mod/twitter_api/views/default/forms/twitter_api/interstitial_settings.php
+++ b/mod/twitter_api/views/default/forms/twitter_api/interstitial_settings.php
@@ -58,4 +58,5 @@ echo elgg_view('output/url', array(
'class' => 'right',
'text' => elgg_echo('twitter_api:interstitial:no_thanks'),
'href' => '/',
+ 'is_trusted' => true,
));
\ No newline at end of file
diff --git a/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php b/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php
index 2872b7a0c..0e1461058 100644
--- a/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php
+++ b/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php
@@ -52,27 +52,30 @@ $bulk_actions_checkbox = ' $vars['url'] . "action/uservalidationbyemail/validate/",
+ 'href' => 'action/uservalidationbyemail/validate/',
'text' => elgg_echo('uservalidationbyemail:admin:validate'),
+ 'title' => elgg_echo('uservalidationbyemail:confirm_validate_checked'),
'class' => 'unvalidated-users-bulk-post',
+ 'is_action' => true,
+ 'is_trusted' => true,
));
$resend_email = elgg_view('output/url', array(
- 'is_action' => TRUE,
- 'js' => 'title="' . elgg_echo('uservalidationbyemail:confirm_resend_validation_checked') . '"',
- 'href' => $vars['url'] . "action/uservalidationbyemail/resend_validation/",
+ 'href' => 'action/uservalidationbyemail/resend_validation/',
'text' => elgg_echo('uservalidationbyemail:admin:resend_validation'),
+ 'title' => elgg_echo('uservalidationbyemail:confirm_resend_validation_checked'),
'class' => 'unvalidated-users-bulk-post',
+ 'is_action' => true,
+ 'is_trusted' => true,
));
$delete = elgg_view('output/url', array(
- 'is_action' => TRUE,
- 'js' => 'title="' . elgg_echo('uservalidationbyemail:confirm_delete_checked') . '"',
- 'href' => $vars['url'] . "action/uservalidationbyemail/delete/",
+ 'href' => 'action/uservalidationbyemail/delete/',
'text' => elgg_echo('uservalidationbyemail:admin:delete'),
+ 'title' => elgg_echo('uservalidationbyemail:confirm_delete_checked'),
'class' => 'unvalidated-users-bulk-post',
+ 'is_action' => true,
+ 'is_trusted' => true,
));
$bulk_actions = <<<___END
diff --git a/views/default/admin/appearance/default_widgets.php b/views/default/admin/appearance/default_widgets.php
index 4416dc8f6..1bf5791ac 100644
--- a/views/default/admin/appearance/default_widgets.php
+++ b/views/default/admin/appearance/default_widgets.php
@@ -17,6 +17,7 @@ if ($object) {
'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',
));
diff --git a/views/default/admin/appearance/profile_fields/list.php b/views/default/admin/appearance/profile_fields/list.php
index 6e79838ea..f4ff1e986 100644
--- a/views/default/admin/appearance/profile_fields/list.php
+++ b/views/default/admin/appearance/profile_fields/list.php
@@ -39,8 +39,9 @@ foreach ($items as $item) {
//$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
$url = elgg_view('output/url', array(
'href' => "action/profile/fields/delete?id={$item->shortname}",
- 'is_action' => TRUE,
'text' => elgg_view_icon('delete-alt'),
+ 'is_action' => true,
+ 'is_trusted' => true,
));
$type = elgg_echo($item->type);
echo <<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,
));
?>
diff --git a/views/default/icon/default.php b/views/default/icon/default.php
index 3abd96b96..533b92c43 100644
--- a/views/default/icon/default.php
+++ b/views/default/icon/default.php
@@ -39,6 +39,7 @@ if ($url) {
echo elgg_view('output/url', array(
'href' => $url,
'text' => $img,
+ 'is_trusted' => true,
));
} else {
echo $img;
diff --git a/views/default/icon/user/default.php b/views/default/icon/user/default.php
index aca03521f..0eb3691bd 100644
--- a/views/default/icon/user/default.php
+++ b/views/default/icon/user/default.php
@@ -66,6 +66,7 @@ if ($show_menu) {
echo elgg_view('output/url', array(
'href' => $user->getURL(),
'text' => $icon,
+ 'is_trusted' => true,
));
?>
diff --git a/views/default/navigation/breadcrumbs.php b/views/default/navigation/breadcrumbs.php
index bad73c4b3..88577a8ff 100644
--- a/views/default/navigation/breadcrumbs.php
+++ b/views/default/navigation/breadcrumbs.php
@@ -30,6 +30,7 @@ if (is_array($breadcrumbs) && count($breadcrumbs) > 0) {
$crumb = elgg_view('output/url', array(
'href' => $breadcrumb['link'],
'text' => $breadcrumb['title'],
+ 'is_trusted' => true,
));
} else {
$crumb = $breadcrumb['title'];
diff --git a/views/default/navigation/menu/user_hover.php b/views/default/navigation/menu/user_hover.php
index e32e5ab57..5c89e585c 100644
--- a/views/default/navigation/menu/user_hover.php
+++ b/views/default/navigation/menu/user_hover.php
@@ -19,6 +19,7 @@ echo '