]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
removed uses of $vars[config] in views
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 3 Feb 2011 12:35:58 +0000 (12:35 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 3 Feb 2011 12:35:58 +0000 (12:35 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8004 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/views.php
mod/categories/views/default/categories.php
mod/categories/views/default/categories/list.php
mod/sitepages/views/default/sitepages/keywords/userlist.php

index 0a9669d2fa5cb0bd0b70409b973e69c375351b99..4f608885905e8d586c506fc81c24aebfcba3cbc8 100644 (file)
@@ -318,11 +318,12 @@ function elgg_view_exists($view, $viewtype = '', $recurse = true) {
  * Views are rendered by a template handler and returned as strings.
  *
  * Views are called with a special $vars variable set,
- * which includes any variables passed as the second parameter,
- * as well as some defaults:
- *  - All $_SESSION vars merged to $vars array.
- *  - $vars['config'] The $CONFIG global. (Use {@link get_config()} instead).
- *  - $vars['url'] The site URL.
+ * which includes any variables passed as the second parameter.
+ * For backward compatbility, the following variables are also set but we
+ * recommend that you do not use them:
+ *  - $vars['config'] The $CONFIG global. (Use {@link elgg_get_config()} instead).
+ *  - $vars['url'] The site URL. (use {@link elgg_get_site_url()} instead).
+ *  - $vars['user'] The logged in user. (use {@link get_loggedin_user()} instead).
  *
  * Custom template handlers can be set with {@link set_template_handler()}.
  *
index eb81a7311e7baea0cd097aa7e79cc63cc3aba363..f69283e9ffe4baebae6ae1e404819f2e864fe47f 100644 (file)
@@ -9,7 +9,7 @@
 if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) {
        $selected_categories = $vars['entity']->universal_categories;
 }
-$categories = $vars['config']->site->categories;
+$categories = elgg_get_site_entity()->categories;
 if (empty($categories)) {
        $categories = array();
 }
index 9b62eff515a14b7aece2e7daf971a31934b77477..7a6dadff48f53da1d130333d8bea4759b514775d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-$categories = $vars['config']->site->categories;
+$categories = elgg_get_site_entity()->categories;
 
 if ($categories) {
        if (!is_array($categories)) {
index 231fc7b1c8ed50dba25052628e94e245689a9dec..64c3d82acd6da4498c2dcbe3c3b4155bf3b2d8e7 100644 (file)
@@ -5,6 +5,8 @@
  * @package SitePages
  */
 
+$db_prefix = elgg_get_config('dbprefix');
+
 $only_with_avatars = (isset($vars['only_with_avatars'])) ? $vars['only_with_avatars'] : TRUE;
 $list_type = (isset($vars['list_type'])) ? $vars['list_type'] : 'new';
 $limit = (isset($vars['limit'])) ? $vars['limit'] : 10;
@@ -26,7 +28,7 @@ switch ($list_type) {
        case 'online':
                // show people with a last action of < 10 minutes.
                $last_action = time() - 10 * 60;
-               $options['joins'] = array("JOIN {$vars['config']->dbprefix}users_entity ue on ue.guid = e.guid");
+               $options['joins'] = array("JOIN {$db_prefix}users_entity ue on ue.guid = e.guid");
                $options['wheres'] = array("ue.last_action > $last_action");
                break;