* @deprecated 1.8 Use elgg_list_entities_from_access_id()
*/
function list_entities_from_access_id($access_id, $entity_type = "", $entity_subtype = "",
- $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = true, $pagination = true) {
+ $owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true) {
elgg_deprecated_notice("All list_entities* functions were deprecated in 1.8. Use elgg_list_entities* instead.", 1.8);
'owner_guids' => $owner_guid,
'limit' => $limit,
'full_view' => $fullview,
- 'view_type_toggle' => $viewtypetoggle,
+ 'list_type_toggle' => $listtypetoggle,
'pagination' => $pagination,
));
}
* @param int $group_guid Group container. Currently only supported if entity_type is object
* @param boolean $asc Whether to list in ascending or descending order (default: desc)
* @param boolean $fullview Whether to display the entities in full
- * @param boolean $viewtypetoggle Can 'gallery' view can be displayed (default: no)
+ * @param boolean $listtypetoggle Can 'gallery' view can be displayed (default: no)
*
* @deprecated 1.7 Use elgg_list_entities_from_annotations()
* @return string Formatted entity list
*/
function list_entities_from_annotations($entity_type = "", $entity_subtype = "", $name = "",
$value = "", $limit = 10, $owner_guid = 0, $group_guid = 0, $asc = false, $fullview = true,
-$viewtypetoggle = false) {
+$listtypetoggle = false) {
$msg = 'list_entities_from_annotations is deprecated by elgg_list_entities_from_annotations';
elgg_deprecated_notice($msg, 1.8);
}
$options['full_view'] = $fullview;
- $options['view_type_toggle'] = $viewtypetoggle;
+ $options['list_type_toggle'] = $listtypetoggle;
$options['pagination'] = $pagination;
return elgg_list_entities_from_annotations($options);
* @param int $group_guid Group container. Currently only supported if entity_type is object
* @param boolean $asc Whether to list in ascending or descending order (default: desc)
* @param boolean $fullview Whether to display the entities in full
- * @param boolean $viewtypetoggle Can the 'gallery' view can be displayed (default: no)
+ * @param boolean $listtypetoggle Can the 'gallery' view can be displayed (default: no)
* @param boolean $pagination Add pagination
* @param string $orderdir Order desc or asc
*
*/
function list_entities_from_annotation_count($entity_type = "", $entity_subtype = "", $name = "",
$limit = 10, $owner_guid = 0, $group_guid = 0, $asc = false, $fullview = true,
-$viewtypetoggle = false, $pagination = true, $orderdir = 'desc') {
+$listtypetoggle = false, $pagination = true, $orderdir = 'desc') {
if ($asc) {
$asc = "asc";
} else {
'', '', $owner_guid, $limit, $offset, $orderdir, false);
return elgg_view_entity_list($entities, $count, $offset, $limit,
- $fullview, $viewtypetoggle, $pagination);
+ $fullview, $listtypetoggle, $pagination);
}
/**
* @param int $group_guid Group container. Currently only supported if entity_type is object
* @param boolean $asc Whether to list in ascending or descending order (default: desc)
* @param boolean $fullview Whether to display the entities in full
- * @param boolean $viewtypetoggle Can the 'gallery' view can be displayed (default: no)
+ * @param boolean $listtypetoggle Can the 'gallery' view can be displayed (default: no)
* @param boolean $pagination Display pagination
* @param string $orderdir 'desc' or 'asc'
*
*/
function list_entities_from_annotation_count_by_metadata($entity_type = "", $entity_subtype = "",
$name = "", $mdname = '', $mdvalue = '', $limit = 10, $owner_guid = 0, $group_guid = 0,
-$asc = false, $fullview = true, $viewtypetoggle = false, $pagination = true, $orderdir = 'desc') {
+$asc = false, $fullview = true, $listtypetoggle = false, $pagination = true, $orderdir = 'desc') {
if ($asc) {
$asc = "asc";
$mdvalue, $owner_guid, $limit, $offset, $orderdir, false);
return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview,
- $viewtypetoggle, $pagination);
+ $listtypetoggle, $pagination);
}
/**
* @param int $owner_guid The GUID of the owning user
* @param int $limit The number of entities to return; 10 by default
* @param boolean $fullview Whether or not to display the full view (default: true)
- * @param boolean $viewtypetoggle Whether or not to allow gallery view
+ * @param boolean $listtypetoggle Whether or not to allow gallery view
* @param boolean $navigation Display pagination? Default: true
*
* @return string A viewable list of entities
*/
function list_notable_entities($start_time, $end_time, $type= "", $subtype = "", $owner_guid = 0,
-$limit = 10, $fullview = true, $viewtypetoggle = false, $navigation = true) {
+$limit = 10, $fullview = true, $listtypetoggle = false, $navigation = true) {
$offset = (int) get_input('offset');
$count = get_notable_entities($start_time, $end_time, $type, $subtype,
$owner_guid, "", $limit, $offset);
return elgg_view_entity_list($entities, $count, $offset, $limit,
- $fullview, $viewtypetoggle, $navigation);
+ $fullview, $listtypetoggle, $navigation);
}
/**
* @param int $owner_guid The GUID of the owning user
* @param int $limit The number of entities to return; 10 by default
* @param boolean $fullview Whether or not to display the full view (default: true)
- * @param boolean $viewtypetoggle Whether or not to allow gallery view
+ * @param boolean $listtypetoggle Whether or not to allow gallery view
* @param boolean $navigation Display pagination? Default: true
*
* @return string A viewable list of entities
*/
function list_todays_entities($type= "", $subtype = "", $owner_guid = 0, $limit = 10,
-$fullview = true, $viewtypetoggle = false, $navigation = true) {
+$fullview = true, $listtypetoggle = false, $navigation = true) {
$day_start = get_day_start();
$day_end = get_day_end();
return list_notable_entities($day_start, $day_end, $type, $subtype, $owner_guid, $limit,
- $fullview, $viewtypetoggle, $navigation);
+ $fullview, $listtypetoggle, $navigation);
}
\ No newline at end of file
*
* @param array $options Any options from $getter options plus:
* full_view => BOOL Display full view entities
- * view_type_toggle => BOOL Display gallery / list switch
+ * list_type_toggle => BOOL Display gallery / list switch
* pagination => BOOL Display pagination links
*
* @param mixed $getter The entity getter function to use to fetch the entities
'offset' => (int) max(get_input('offset', 0), 0),
'limit' => (int) max(get_input('limit', 10), 0),
'full_view' => TRUE,
- 'view_type_toggle' => FALSE,
+ 'list_type_toggle' => FALSE,
'pagination' => TRUE,
);
$options = array_merge($defaults, $options);
+ //backwards compatibility
+ if (isset($options['view_type_toggle'])) {
+ $options['list_type_toggle'] = $options['view_type_toggle'];
+ }
+
$options['count'] = TRUE;
$count = $getter($options);
$entities = $getter($options);
return elgg_view_entity_list($entities, $count, $options['offset'], $options['limit'],
- $options['full_view'], $options['view_type_toggle'], $options['pagination']);
+ $options['full_view'], $options['list_type_toggle'], $options['pagination']);
}
/**
* @param int $owner_guid Owner GUID
* @param int $limit Limit
* @param bool $fullview Display entity full views?
- * @param bool $viewtypetoggle Allow switching to gallery mode?
+ * @param bool $listtypetoggle Allow switching to gallery mode?
* @param bool $pagination Show pagination?
*
* @return string
*/
function list_entities($type= "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true,
-$viewtypetoggle = false, $pagination = true) {
+$listtypetoggle = false, $pagination = true) {
elgg_deprecated_notice('list_entities() was deprecated by elgg_list_entities()!', 1.7);
}
$options['full_view'] = $fullview;
- $options['view_type_toggle'] = $viewtypetoggle;
+ $options['list_type_toggle'] = $listtypetoggle;
$options['pagination'] = $pagination;
return elgg_list_entities($options);
* @param int $owner_guid Owner GUID
* @param int $limit Limit
* @param bool $fullview Show entity full views
- * @param bool $viewtypetoggle Show list type toggle
+ * @param bool $listtypetoggle Show list type toggle
* @param bool $allowedtypes A string of the allowed types
*
* @return string
* @deprecated 1.7. Use elgg_list_registered_entities().
*/
function list_registered_entities($owner_guid = 0, $limit = 10, $fullview = true,
-$viewtypetoggle = false, $allowedtypes = true) {
+$listtypetoggle = false, $allowedtypes = true) {
elgg_deprecated_notice('list_registered_entities() was deprecated by elgg_list_registered_entities().', 1.7);
// need to send because might be BOOL
$options['full_view'] = $fullview;
- $options['view_type_toggle'] = $viewtypetoggle;
+ $options['list_type_toggle'] = $listtypetoggle;
$options['offset'] = get_input('offset', 0);
*
* full_view => BOOL Display full view entities
*
- * view_type_toggle => BOOL Display gallery / list switch
+ * list_type_toggle => BOOL Display gallery / list switch
*
* allowed_types => TRUE|ARRAY True to show all types or an array of valid types.
*
$defaults = array(
'full_view' => TRUE,
'allowed_types' => TRUE,
- 'view_type_toggle' => FALSE,
+ 'list_type_toggle' => FALSE,
'pagination' => TRUE,
'offset' => 0
);
$options = array_merge($defaults, $options);
+ //backwards compatibility
+ if (isset($options['view_type_toggle'])) {
+ $options['list_type_toggle'] = $options['view_type_toggle'];
+ }
+
$typearray = array();
if ($object_types = get_registered_entity_types()) {
$entities = elgg_get_entities($options);
return elgg_view_entity_list($entities, $count, $options['offset'],
- $options['limit'], $options['full_view'], $options['view_type_toggle'], $options['pagination']);
+ $options['limit'], $options['full_view'], $options['list_type_toggle'], $options['pagination']);
}
/**
* @param int $container_guid The GUID of the containing group
* @param int $limit The number of entities to display per page (default: 10)
* @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $viewtypetoggle Whether or not to allow gallery view (default: true)
+ * @param bool $listtypetoggle Whether or not to allow gallery view (default: true)
* @param bool $pagination Whether to display pagination (default: true)
*
* @return string List of parsed entities
* @deprecated 1.8 Use elgg_list_entities() instead
*/
function list_entities_groups($subtype = "", $owner_guid = 0, $container_guid = 0,
-$limit = 10, $fullview = true, $viewtypetoggle = true, $pagination = true) {
+$limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true) {
elgg_deprecated_notice("list_entities_groups was deprecated in 1.8. Use elgg_list_entities() instead.", 1.8);
$offset = (int) get_input('offset');
$count = get_objects_in_group($container_guid, $subtype, $owner_guid,
0, "", $limit, $offset);
return elgg_view_entity_list($entities, $count, $offset, $limit,
- $fullview, $viewtypetoggle, $pagination);
+ $fullview, $listtypetoggle, $pagination);
}
/**
* @param int $owner_guid The GUID of the owning user
* @param int $limit The number of entities to display per page (default: 10)
* @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $viewtypetoggle Whether or not to allow gallery view
+ * @param bool $listtypetoggle Whether or not to allow gallery view
* @param bool $navigation Display pagination? Default: true
*
* @return string A viewable list of entities
*/
function list_entities_location($location, $type= "", $subtype = "", $owner_guid = 0, $limit = 10,
-$fullview = true, $viewtypetoggle = false, $navigation = true) {
+$fullview = true, $listtypetoggle = false, $navigation = true) {
return list_entities_from_metadata('location', $location, $type, $subtype, $owner_guid, $limit,
- $fullview, $viewtypetoggle, $navigation);
+ $fullview, $listtypetoggle, $navigation);
}
/**
* @param int $owner_guid The GUID of the owning user
* @param int $limit The number of entities to display per page (default: 10)
* @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $viewtypetoggle Whether or not to allow gallery view
+ * @param bool $listtypetoggle Whether or not to allow gallery view
* @param bool $navigation Display pagination? Default: true
*
* @return string A viewable list of entities
*/
function list_entities_in_area($lat, $long, $radius, $type= "", $subtype = "", $owner_guid = 0,
-$limit = 10, $fullview = true, $viewtypetoggle = false, $navigation = true) {
+$limit = 10, $fullview = true, $listtypetoggle = false, $navigation = true) {
$offset = (int) get_input('offset');
$count = get_entities_in_area($lat, $long, $radius, $type, $subtype, $owner_guid,
"", $limit, $offset);
return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview,
- $viewtypetoggle, $navigation);
+ $listtypetoggle, $navigation);
}
// Some distances in degrees (approximate)
* @param int $owner_guid Owner GUID
* @param int $limit Number of entities to display per page
* @param bool $fullview WDisplay the full view (default: true)
- * @param bool $viewtypetoggle Allow users to toggle to the gallery view. Default: true
+ * @param bool $listtypetoggle Allow users to toggle to the gallery view. Default: true
* @param bool $pagination Display pagination? Default: true
* @param bool $case_sensitive Case sensitive metadata names?
*
*/
function list_entities_from_metadata($meta_name, $meta_value = "",
$entity_type = ELGG_ENTITIES_ANY_VALUE, $entity_subtype = ELGG_ENTITIES_ANY_VALUE,
-$owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = true,
+$owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = true,
$pagination = true, $case_sensitive = true) {
elgg_deprecated_notice('list_entities_from_metadata() was deprecated by elgg_list_entities_from_metadata()!', 1.8);
$entities = elgg_get_entities_from_metadata($options);
return elgg_view_entity_list($entities, $count, $offset, $limit,
- $fullview, $viewtypetoggle, $pagination);
+ $fullview, $listtypetoggle, $pagination);
}
/**
* @param int $owner_guid Owner GUID
* @param int $limit Limit
* @param bool $fullview WDisplay the full view (default: true)
- * @param bool $viewtypetoggle Allow users to toggle to the gallery view. Default: true
+ * @param bool $listtypetoggle Allow users to toggle to the gallery view. Default: true
* @param bool $pagination Display pagination? Default: true
*
* @return string List of ElggEntities suitable for display
*/
function list_entities_from_metadata_multi($meta_array, $entity_type = "", $entity_subtype = "",
-$owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = true, $pagination = true) {
+$owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true) {
$offset = (int) get_input('offset');
$limit = (int) $limit;
$owner_guid, $limit, $offset, "", $site_guid, false);
return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview,
- $viewtypetoggle, $pagination);
+ $listtypetoggle, $pagination);
}
/**
function list_entities_from_relationship($relationship, $relationship_guid,
$inverse_relationship = false, $type = ELGG_ENTITIES_ANY_VALUE,
$subtype = ELGG_ENTITIES_ANY_VALUE, $owner_guid = 0, $limit = 10,
-$fullview = true, $viewtypetoggle = false, $pagination = true) {
+$fullview = true, $listtypetoggle = false, $pagination = true) {
elgg_deprecated_notice("list_entities_from_relationship was deprecated by elgg_list_entities_from_relationship()!", 1.8);
return elgg_list_entities_from_relationship(array(
'owner_guid' => $owner_guid,
'limit' => $limit,
'full_view' => $fullview,
- 'view_type_toggle' => $viewtypetoggle,
+ 'list_type_toggle' => $listtypetoggle,
'pagination' => $pagination,
));
}
* @param int $owner_guid The owner (default: all)
* @param int $limit The number of entities to display on a page
* @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $viewtypetoggle Whether or not to allow gallery view
+ * @param bool $listtypetoggle Whether or not to allow gallery view
* @param bool $pagination Whether to display pagination (default: true)
*
* @return string The viewable list of entities
function list_entities_by_relationship_count($relationship, $inverse_relationship = true,
$type = "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true,
-$viewtypetoggle = false, $pagination = true) {
+$listtypetoggle = false, $pagination = true) {
$limit = (int) $limit;
$offset = (int) get_input('offset');
$entities = get_entities_by_relationship_count($relationship, $inverse_relationship,
$type, $subtype, $owner_guid, $limit, $offset);
- return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle, $pagination);
+ return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $listtypetoggle, $pagination);
}
/**
* @param string $subtype The object subtype
* @param int $limit The number of entities to display on a page
* @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $viewtypetoggle Whether or not to allow gallery view (default: true)
+ * @param bool $listtypetoggle Whether or not to allow gallery view (default: true)
* @param bool $pagination Whether to display pagination (default: true)
* @param int $timelower The earliest time the entity can have been created. Default: all
* @param int $timeupper The latest time the entity can have been created. Default: all
* @deprecated 1.8 Use elgg_list_entities() instead
*/
function list_user_objects($user_guid, $subtype = ELGG_ENTITIES_ANY_VALUE, $limit = 10,
-$fullview = true, $viewtypetoggle = true, $pagination = true, $timelower = 0, $timeupper = 0) {
+$fullview = true, $listtypetoggle = true, $pagination = true, $timelower = 0, $timeupper = 0) {
elgg_deprecated_notice("list_user_objects() was deprecated in favor of elgg_list_entities()", 1.8);
$offset = (int) get_input('offset');
$count = (int) count_user_objects($user_guid, $subtype, $timelower, $timeupper);
$entities = get_user_objects($user_guid, $subtype, $limit, $offset, $timelower, $timeupper);
- return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle,
+ return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $listtypetoggle,
$pagination);
}
* @param string $subtype The object subtype
* @param int $limit The number of entities to display on a page
* @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $viewtypetoggle Whether or not to allow you to flip to gallery mode (default: true)
+ * @param bool $listtypetoggle Whether or not to allow you to flip to gallery mode (default: true)
* @param bool $pagination Whether to display pagination (default: true)
* @param int $timelower The earliest time the entity can have been created. Default: all
* @param int $timeupper The latest time the entity can have been created. Default: all
* @return string The list in a form suitable to display
*/
function list_user_friends_objects($user_guid, $subtype = "", $limit = 10, $fullview = true,
-$viewtypetoggle = true, $pagination = true, $timelower = 0, $timeupper = 0) {
+$listtypetoggle = true, $pagination = true, $timelower = 0, $timeupper = 0) {
$offset = (int) get_input('offset');
$limit = (int) $limit;
$timelower, $timeupper);
return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview,
- $viewtypetoggle, $pagination);
+ $listtypetoggle, $pagination);
}
/**
* @param int $offset The current indexing offset
* @param int $limit The number of entities to display per page
* @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $viewtypetoggle Whether or not to allow users to toggle to gallery view
+ * @param bool $listtypetoggle Whether or not to allow users to toggle to gallery view
* @param bool $pagination Whether pagination is offered.
*
* @return string The list of entities
* @access private
*/
function elgg_view_entity_list($entities, $count, $offset, $limit, $fullview = true,
-$viewtypetoggle = true, $pagination = true) {
+$listtypetoggle = true, $pagination = true) {
$count = (int) $count;
$limit = (int) $limit;
'baseurl' => $_SERVER['REQUEST_URI'],
'fullview' => $fullview,
'context' => $context,
- 'viewtypetoggle' => $viewtypetoggle,
- 'viewtype' => get_input('search_viewtype', 'list'),
+ 'listtypetoggle' => $listtypetoggle,
+ 'listtype' => get_input('listtype', 'list'),
'pagination' => $pagination
));
// possible options for elgg_get_entities*() functions...)
$entities = elgg_get_entities_from_relationship($options);
$content = elgg_view_entity_list($entities, count($entities), $options['offset'],
- $options['limit'], $options['full_view'], $options['view_type_toggle'], $options['pagination']);
+ $options['limit'], $options['full_view'], $options['list_type_toggle'], $options['pagination']);
break;
case 'view':
// Get input
$md_type = 'simpletype';
$tag = get_input('tag');
- $search_viewtype = get_input('search_viewtype');
+ $listtype = get_input('listtype');
$friends = (int) get_input('friends_guid',0);
if ($friends) {
$offset = (int)get_input('offset', 0);
$limit = 10;
- if ($search_viewtype == "gallery") $limit = 12;
+ if ($listtype == "gallery") $limit = 12;
if (!empty($tag)) {
$params = array(
'metadata_name' => $md_type,
<?php
$types = $vars['types'];
-
+
if (is_array($vars['types']) && sizeof($vars['types'])) {
-
-?>
+
+?>
<ul>
<?php
} else {
$label = elgg_echo('all');
}
-
+
$url = elgg_get_site_url() . "mod/file/search.php?subtype=file";
if ($tag != "all")
$url .= "&md_type=simpletype&tag=" . urlencode($tag);
$url .= "&owner_guid={$owner_guid}";
}
if ($tag == "image")
- $url .= "&search_viewtype=gallery";
-
+ $url .= "&listtype=gallery";
+
$url .= "&page_owner=" . elgg_get_page_owner_guid();
-
+
$inputtag = get_input('tag');
if ($inputtag == $tag || (empty($inputtag) && $tag == "all")) {
$class = " class=\"selected\" ";
} else {
$class = "";
}
-
- add_submenu_item($label, $url, 'filetypes');
+
+ add_submenu_item($label, $url, 'filetypes');
}
-
+
?>
</ul>
<?php
-
+
}
?>
\ No newline at end of file
if (elgg_get_context() == "search") { // Start search listing version
- if (get_input('search_viewtype') == "gallery") {
+ if (get_input('listtype') == "gallery") {
echo "<div class='filerepo_gallery_item'>";
if ($vars['entity']->smallthumb) {
echo "<p class='filerepo_title'>" . $file->title . "</p>";
<div class="filerepo_title_owner_wrapper">
<?php
//get the user and a link to their gallery
- $user_gallery = elgg_get_site_url() . "mod/file/search.php?md_type=simpletype&subtype=file&tag=image&owner_guid=" . $owner->guid . "&search_viewtype=gallery";
+ $user_gallery = elgg_get_site_url() . "mod/file/search.php?md_type=simpletype&subtype=file&tag=image&owner_guid=" . $owner->guid . "&listtype=gallery";
?>
<div class="filerepo_user_gallery_link"><a href="<?php echo $user_gallery; ?>"><?php echo elgg_echo("file:user:gallery",array('')); ?></a></div>
<div class="filerepo_title"><h2><a href="<?php echo elgg_get_site_url(); ?>mod/file/download.php?file_guid=<?php echo $file_guid; ?>"><?php echo $title; ?></a></h2></div>
if ($vars['full']) {
echo elgg_view("pages/pageprofile", $vars);
} else {
- if (get_input('search_viewtype') == "gallery") {
+ if (get_input('listtype') == "gallery") {
echo elgg_view('pages/pagegallery', $vars);
} else {
echo elgg_view("pages/pagelisting", $vars);
if ($vars['full']) {
echo elgg_view("pages/pageprofile", $vars);
} else {
- if (get_input('search_viewtype') == "gallery") {
+ if (get_input('listtype') == "gallery") {
echo elgg_view('pages/pagegallery', $vars);
} else {
echo elgg_view("pages/pagelisting", $vars);
$count = $vars['count'];
$baseurl = $vars['baseurl'];
$context = $vars['context'];
-$viewtype = $vars['viewtype'];
+$listtype = $vars['listtype'];
$pagination = $vars['pagination'];
-$fullview = $vars['fullview'];
-
+$fullview = $vars['fullview'];
+
$html = "";
$nav = "";
-if (isset($vars['viewtypetoggle'])) {
- $viewtypetoggle = $vars['viewtypetoggle'];
+if (isset($vars['listtypetoggle'])) {
+ $listtypetoggle = $vars['listtypetoggle'];
} else {
- $viewtypetoggle = true;
+ $listtypetoggle = true;
}
-if ($context == "search" && $count > 0 && $viewtypetoggle) {
- $nav .= elgg_view("navigation/viewtype",array(
-
+if ($context == "search" && $count > 0 && $listtypetoggle) {
+ $nav .= elgg_view("navigation/listtype",array(
+
'baseurl' => $baseurl,
'offset' => $offset,
'count' => $count,
- 'viewtype' => $viewtype,
-
+ 'listtype' => $listtype,
+
));
}
if ($pagination)
$nav .= elgg_view('navigation/pagination',array(
-
+
'baseurl' => $baseurl,
'offset' => $offset,
'count' => $count,
'limit' => $limit,
-
+
));
-if ($viewtype == "list") {
+if ($listtype == "list") {
if (is_array($entities) && sizeof($entities) > 0) {
foreach($entities as $entity) {
// print out the entity
}
}
-} else if ($viewtype == "gallery") {
+} else if ($listtype == "gallery") {
if (is_array($entities) && sizeof($entities) > 0) {
$html .= elgg_view("search/gallery",array('entities' => $entities));
}
$count = $vars['count'];
$baseurl = $vars['baseurl'];
$context = $vars['context'];
-$viewtype = $vars['viewtype'];
+$listtype = $vars['listtype'];
$pagination = $vars['pagination'];
$fullview = $vars['fullview'];
$html = "";
$nav = "";
-if (isset($vars['viewtypetoggle'])) {
- $viewtypetoggle = $vars['viewtypetoggle'];
+if (isset($vars['listtypetoggle'])) {
+ $listtypetoggle = $vars['listtypetoggle'];
} else {
- $viewtypetoggle = true;
+ $listtypetoggle = true;
}
-if ($context == "search" && $count > 0 && $viewtypetoggle) {
- $nav .= elgg_view('navigation/viewtype', array(
+if ($context == "search" && $count > 0 && $listtypetoggle) {
+ $nav .= elgg_view('navigation/listtype', array(
'baseurl' => $baseurl,
'offset' => $offset,
'count' => $count,
- 'viewtype' => $viewtype,
+ 'listtype' => $listtype,
));
}
));
}
-if ($viewtype == 'list') {
+if ($listtype == 'list') {
if (is_array($entities) && sizeof($entities) > 0) {
foreach($entities as $entity) {
$html .= elgg_view_entity($entity, $fullview);
--- /dev/null
+<?php
+/**
+ * Elgg list view switcher
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+$baseurl = elgg_http_remove_url_query_element($vars['baseurl'], 'search_listtype');
+
+if ($vars['listtype'] == "list") {
+ $listtype = "gallery";
+} else {
+ $listtype = "list";
+}
+
+if (substr_count($baseurl,'?')) {
+ $baseurl .= "&search_listtype=" . $listtype;
+} else {
+ $baseurl .= "?search_listtype=" . $listtype;
+}
+
+?>
+
+<p class="margin_top">
+ <?php echo elgg_echo("listtype:change") ?>:
+ <a href="<?php echo $baseurl; ?>"><?php echo elgg_echo("listtype:{$listtype}"); ?></a>
+</p>
\ No newline at end of file
* @subpackage Core
*/
-$baseurl = elgg_http_remove_url_query_element($vars['baseurl'], 'search_viewtype');
+elgg_deprecated_notice('navigation/viewtype was deprecated by navigation/listtype', 1.8);
-if ($vars['viewtype'] == "list") {
- $viewtype = "gallery";
-} else {
- $viewtype = "list";
-}
-
-if (substr_count($baseurl,'?')) {
- $baseurl .= "&search_viewtype=" . $viewtype;
-} else {
- $baseurl .= "?search_viewtype=" . $viewtype;
-}
-
-?>
-
-<p class="margin_top">
- <?php echo elgg_echo("viewtype:change") ?>:
- <a href="<?php echo $baseurl; ?>"><?php echo elgg_echo("viewtype:{$viewtype}"); ?></a>
-</p>
\ No newline at end of file
+echo elgg_view('navigation/listtype', $vars);
\ No newline at end of file
$info = "<div><p><b><a href=\"" . $vars['entity']->getUrl() . "\">" . $title . "</a></b> $controls </p></div>";
- if (get_input('search_viewtype') == "gallery") {
+ if (get_input('listtype') == "gallery") {
$icon = "";
}
if ($vars['full']) {
echo elgg_view("profile/userdetails",$vars);
} else {
- if (get_input('search_viewtype') == "gallery") {
+ if (get_input('listtype') == "gallery") {
echo elgg_view('profile/gallery',$vars);
} else {
echo elgg_view("profile/listing",$vars);