aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-12 19:29:27 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-12 19:29:27 +0000
commita80942bbf880a6e1ed4b34dbc4650db40aebf1a1 (patch)
treeea0f7c7c475ee4b77492d0f2fa7c6046cff568d9
parentff9156b46da3b09ef6046833fb66ed52ebde970c (diff)
downloadelgg-a80942bbf880a6e1ed4b34dbc4650db40aebf1a1.tar.gz
elgg-a80942bbf880a6e1ed4b34dbc4650db40aebf1a1.tar.bz2
Checking if we need to pull in a view before calling it.
git-svn-id: http://code.elgg.org/elgg/trunk@5708 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--mod/sitepages/start.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/mod/sitepages/start.php b/mod/sitepages/start.php
index c7baa1314..8450eb872 100644
--- a/mod/sitepages/start.php
+++ b/mod/sitepages/start.php
@@ -77,7 +77,7 @@ function sitepages_init() {
/**
* Registers the sitepages subtype to the right class.
*
- * @return unknown_type
+ * @return bool
*/
function sitepages_runonce() {
return add_subtype('object', 'sitepages_page', 'ElggSitePage');
@@ -195,7 +195,8 @@ function sitepages_parse_view($hook, $entity_type, $return_value, $params) {
);
foreach ($keywords as $keyword => $info) {
- if ($content = elgg_view($info['view'], $view_options)) {
+ if (strpos($return_value, "[[$keyword]]") !== FALSE
+ && ($content = elgg_view($info['view'], $view_options))) {
$return_value = str_replace("[[$keyword]]", $content, $return_value);
}
}