Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Kill some deprecated global functions/helpers.

  • Loading branch information...
commit b0bdc7e9460ef24ecd09e99e8e1423ca94c1bc72 1 parent 237615d
@zerocrates zerocrates authored
View
2  admin/themes/default/collections/browse.php
@@ -8,7 +8,7 @@
<div id="primary">
<?php echo flash(); ?>
- <?php if (has_collections()): ?>
+ <?php if (total_collections() > 0): ?>
<div class="pagination"><?php echo pagination_links(); ?></div>
<?php if (has_collections_for_loop()): ?>
<table id="collections" class="simple" cellspacing="0" cellpadding="0">
View
2  admin/themes/default/index.php
@@ -93,7 +93,7 @@
<ul>
<?php $key = 0; ?>
<?php while(loop_items()): ?>
- <li class="<?php echo is_odd($key++) ? 'even' : 'odd'; ?>">
+ <li class="<?php echo $key++ & 1 ? 'even' : 'odd'; ?>">
<?php echo link_to_item();?>
</li>
<?php endwhile; ?>
View
12 application/helpers/CollectionFunctions.php
@@ -194,18 +194,6 @@ function get_current_collection()
}
/**
- * Determine whether or not there are any collections in the database.
- *
- * @deprecated since 1.5
- * @since 0.10
- * @return boolean
- */
-function has_collections()
-{
- return (total_collections() > 0);
-}
-
-/**
* Determine whether there are any collections to loop through.
*
* @since 1.0
View
12 application/helpers/FileFunctions.php
@@ -155,18 +155,6 @@ function loop_files()
}
/**
- * Determine whether or not there are any files in the database.
- *
- * @deprecated since 1.5
- * @since 1.1
- * @return boolean
- */
-function has_files()
-{
- return (total_files() > 0);
-}
-
-/**
* @since 1.1
* @return boolean
*/
View
23 application/helpers/Functions.php
@@ -20,29 +20,6 @@ function __v()
}
/**
- * Simple math for determining whether a number is odd or even
- *
- * @deprecated since 1.5
- * @return bool
- */
-function is_odd($num)
-{
- return $num & 1;
-}
-
-/**
- * Wrapper for the auto_discovery_link_tags() helper.
- *
- * @since 0.9
- * @uses auto_discovery_link_tags()
- * @return string HTML
- * @deprecated since 1.4
- */
-function auto_discovery_link_tag(){
- return auto_discovery_link_tags();
-}
-
-/**
* Output a <link> tag for the RSS feed so the browser can auto-discover the field.
*
* @since 1.4
View
12 application/helpers/ItemFunctions.php
@@ -139,18 +139,6 @@ function get_previous_item($item=null)
}
/**
- * Determine whether or not there are any items in the database.
- *
- * @deprecated since 1.5
- * @since 0.10
- * @return boolean
- */
-function has_items()
-{
- return (total_items() > 0);
-}
-
-/**
* @since 0.10
* @return boolean
*/
View
20 application/helpers/LinkFunctions.php
@@ -507,23 +507,3 @@ function public_nav_items(array $navArray, $maxDepth = 0)
{
return public_nav($navArray, 'items', $maxDepth);
}
-
-/**
- * Creates a link to the Items Atom view.
- *
- * @deprecated since 1.5
- * @param string $text The text of the link.
- * @param array $params A set of query string parameters to merge in to the href
- * of the link. E.g., if this link was clicked on the items/browse?collection=1
- * page, and array('foo'=>'bar') was passed as this argument, the new URI would be
- * items/browse?collection=1&foo=bar.
- * @param array $tagAttributes An array of tag attributes for the link.
- */
-function link_to_items_atom($text = null, $params=array(), $tagAttributes=array('class' => 'atom'))
-{
- if (!$text) {
- $text = __('Atom');
- }
- $tagAttributes['href'] = html_escape(items_output_uri('atom', $params));
- return '<a ' . _tag_attributes($tagAttributes) . '>' . $text . '</a>';
-}
View
9 application/helpers/UrlFunctions.php
@@ -104,15 +104,6 @@ function is_current_uri($link, $req = null) {
return ($link == $current) or (strpos($current, $link) === 0);
}
-/**
- * @deprecated Since 1.3
- * @return string
- */
-function file_download_uri(File $file, $format='archive')
-{
- return file_display_uri($file, $format);
-}
-
function file_display_uri(File $file, $format='fullsize')
{
if (!$file->exists()) {
View
21 application/libraries/globals.php
@@ -324,14 +324,6 @@ function add_file_display_callback($fileIdentifiers, $callback, array $options=a
}
/**
- * @deprecated Deprecated since version 1.5.
- */
-function add_mime_display_type($fileIdentifiers, $callback, array $options=array())
-{
- add_file_display_callback($fileIdentifiers, $callback, $options);
-}
-
-/**
* Apply a set of plugin filters to a given value.
*
* The first two arguments represent the name of the filter and the value to
@@ -652,19 +644,6 @@ function release_object(&$var)
}
/**
- * Return either the value passed or, if it's empty, return a default value.
- *
- * @deprecated since 1.5
- * @param mixed $value
- * @param mixed $default
- * @return mixed
- */
-function not_empty_or($value, $default)
-{
- return !empty($value) ? $value : $default;
-}
-
-/**
* Returns whether a value is true or not.
* If the value is a string and its lowercased value is 'true' or '1', it returns true.
* If the value is an integer and equal to 1, then it returns true.
View
38 application/tests/integration/Helpers/LinkFunctions/LinkToItemsAtomTest.php
@@ -1,38 +0,0 @@
-<?php
-/**
- * @copyright Roy Rosenzweig Center for History and New Media, 2007-2010
- * @license http://www.gnu.org/licenses/gpl-3.0.txt
- * @package Omeka
- */
-
-/**
- * Require view helper functions.
- */
-
-/**
- * Tests link_to_item()
- * in helpers/LinkFunctions.php
- *
- * @package Omeka
- * @copyright Roy Rosenzweig Center for History and New Media, 2007-2010
- */
-class Omeka_Helper_LinkFunctions_LinkToItemsAtomTest extends Omeka_Test_AppTestCase
-{
- public function tearDown()
- {
- parent::tearDown();
- self::dbChanged(false);
- }
-
- public function testLinkToItemsAtomDefault()
- {
- $linkHtml = '<a class="atom" href="/items/browse?output=atom">Atom</a>';
- $this->assertEquals($linkHtml, link_to_items_atom());
- }
-
- public function testLinkToItemsAtomWithParameters()
- {
- $linkHtml = '<a class="atom" href="/items/browse?collection=1&featured=1&type=3&output=atom">Atom</a>';
- $this->assertEquals($linkHtml, link_to_items_atom('Atom', array('collection' => '1', 'featured' => 1, 'type' => '3')));
- }
-}
View
2  application/tests/integration/Helpers/MediaTest.php
@@ -26,7 +26,7 @@ public function setUp()
public function testAddMimeTypes()
{
- add_mime_display_type(array('image/jpeg'),
+ add_file_display_callback(array('image/jpeg'),
array($this, 'mimeTypeCallback'),
array('foo' => 'bar'));
View
2  application/views/helpers/Media.php
@@ -389,7 +389,7 @@ protected function _linkToFile($html = null, $file, $options)
// Wrap in a link that will download the file directly.
$defaultLinkAttributes = array(
'class'=>'download-file',
- 'href'=>file_download_uri($file)
+ 'href'=>$file->getWebPath('archive')
);
$linkAttributes = array_key_exists('linkAttributes', $options)
? $options['linkAttributes'] : array();
Please sign in to comment.
Something went wrong with that request. Please try again.