Permalink
Browse files

More refactoring of photo object

changed methods into new naming convention, added documentation and
optimized.
  • Loading branch information...
jeroenrnl committed Jan 3, 2013
1 parent 7a89589 commit ba8ab2dc20473df91bbae79515b598955aa6bc20
@@ -65,7 +65,7 @@ public function testAddToAlbum($photo, array $newalbums) {
foreach($newalbums as $alb) {
$photo->addTo(new album($alb));
}
- $albums=$photo->lookup_albums();
+ $albums=$photo->getAlbums();
foreach($albums as $album) {
$ids[]=$album->getId();
$this->assertInstanceOf("album", $album);
@@ -85,7 +85,7 @@ public function testAddToCategories($photo, array $newcats) {
foreach($newcats as $cat) {
$photo->addTo(new category($cat));
}
- $cats=$photo->lookup_categories();
+ $cats=$photo->getCategories();
foreach($cats as $cat) {
$ids[]=$cat->getId();
$this->assertInstanceOf("category", $cat);
@@ -105,7 +105,7 @@ public function testAddPerson($photo, array $newpers) {
foreach($newpers as $pers) {
$photo->addTo(new person($pers));
}
- $peo=$photo->lookup_people();
+ $peo=$photo->getPeople();
foreach($peo as $per) {
$ids[]=$per->getId();
$this->assertInstanceOf("person", $per);
View
@@ -448,7 +448,7 @@ function getCoverphoto($autothumb=null,$children=null) {
if ($coverphoto instanceof photo) {
$coverphoto->lookup();
- return $coverphoto->get_image_tag(THUMB_PREFIX);
+ return $coverphoto->getImageTag(THUMB_PREFIX);
} else if (!$children) {
// No photos found in this album... let's look again, but now
// also in sub-albums...
View
@@ -296,7 +296,7 @@ function getCoverphoto($autothumb=null,$children=null) {
if (isset($coverphoto) && $coverphoto instanceof photo) {
$coverphoto->lookup();
- return $coverphoto->get_image_tag(THUMB_PREFIX);
+ return $coverphoto->getImageTag(THUMB_PREFIX);
} else if (!$children) {
// No photos found in this cat... let's look again, but now
// also in subcat...
View
@@ -151,7 +151,7 @@ function to_html($user, $thumbnail=null) {
if ($thumbnail) {
$html .= "<div class=\"thumbnail\">\n";
- $html .= $photo->get_thumbnail_link();
+ $html .= $photo->getThumbnailLink();
$html .= "</div>\n";
}
View
@@ -104,7 +104,7 @@
<div class="main">
<br>
<?php
- echo $photo->get_midsize_img();
+ echo $photo->getMidsizeImg();
?>
<br>
<dl class "comment">
@@ -122,7 +122,7 @@
<div class="main">
<br>
<?php
- echo $photo->get_midsize_img();
+ echo $photo->getMidsizeImg();
?>
<br>
@@ -115,7 +115,7 @@
<?php
//}
$people_string = "";
- $people = $photo->lookup_people();
+ $people = $photo->getPeople();
if ($people) {
$count = 0;
foreach ($people as $person) {
View
@@ -80,7 +80,7 @@
<div class="prev"><?php echo $prev_link ? "[ $prev_link ]" : "&nbsp;" ?></div>
<div class="photohdr">
- <?php echo $photo->get_fullsize_link($photo->get("name")) ?> :
+ <?php echo $photo->getFullsizeLink($photo->get("name")) ?> :
<?php echo $photo->get("width") ?> x <?php echo $photo->get("height") ?>,
<?php echo $photo->get("size") ?> <?php echo translate("bytes") ?>
</div>
@@ -105,7 +105,7 @@
?>
</ul>
- <?php echo $photo->get_fullsize_link($photo->get_midsize_img()) ?>
+ <?php echo $photo->getFullsizeLink($photo->getMidsizeImg()) ?>
<?php
}
?>
@@ -163,7 +163,7 @@
</label>
<fieldset class="multiple">
<?php
- $people = $photo->lookup_people();
+ $people = $photo->getPeople();
if ($people) {
foreach ($people as $person) {
?>
@@ -183,7 +183,7 @@
<label for="albums"><?php echo translate("albums") ?></label>
<fieldset class="albums multiple">
<?php
- $albums = $photo->lookup_albums($user);
+ $albums = $photo->getAlbums($user);
if ($albums) {
foreach ($albums as $album) {
?>
@@ -202,7 +202,7 @@
<label for="categories"><?php echo translate("categories") ?></label>
<fieldset class="categories multiple">
<?php
- $categories = $photo->lookup_categories($user);
+ $categories = $photo->getCategories($user);
if ($categories) {
foreach ($categories as $category) {
?>
View
@@ -280,7 +280,7 @@
?>
</div>
<div class="thumbnail">
- <?php echo $photo->get_thumbnail_link("photo.php?photo_id=$photo_id") . "\n" ?><br>
+ <?php echo $photo->getThumbnailLink("photo.php?photo_id=$photo_id") . "\n" ?><br>
<?php
if ($can_edit && conf::get("rotate.enable") &&
($user->is_admin() || $permissions->get("writable"))) {
@@ -334,7 +334,7 @@
<label for="album__<?php echo $photo_id?>"><?php echo translate("albums") ?></label>
<fieldset class="checkboxlist">
<?php
- $albums = $photo->lookup_albums($user);
+ $albums = $photo->getAlbums($user);
if ($albums) {
$append = "";
foreach ($albums as $album) {
@@ -355,7 +355,7 @@
<label for="category__<?php echo $photo_id?>"><?php echo translate("categories") ?></label>
<fieldset class="checkboxlist">
<?php
- $categories = $photo->lookup_categories($user);
+ $categories = $photo->getCategories($user);
if ($categories) {
$append = "";
foreach ($categories as $category) {
@@ -376,7 +376,7 @@
<label for="person_0__<?php echo $photo_id ?>"><?php echo translate("people") ?></label>
<fieldset class="checkboxlist multiple">
<?php
- $people = $photo->lookup_people();
+ $people = $photo->getPeople();
if ($people) {
$append = "";
foreach ($people as $person) {
View
@@ -206,7 +206,7 @@
<?php
} else {
?>
- <?php echo $photo->get_midsize_img() ?>
+ <?php echo $photo->getMidsizeImg() ?>
<?php
}
?>
View
@@ -323,7 +323,7 @@ function getCoverphoto($autothumb=null) {
if (isset($coverphoto)) {
$coverphoto->lookup();
- return $coverphoto->get_image_tag(THUMB_PREFIX);
+ return $coverphoto->getImageTag(THUMB_PREFIX);
}
}
@@ -660,7 +660,7 @@ function get_photo_person_links($photo) {
$links = "";
if (!$photo) { return $links; }
- $people = $photo->lookup_people();
+ $people = $photo->getPeople();
if ($people) {
foreach ($people as $person) {
if ($links) { $links .= ", "; }
Oops, something went wrong.

0 comments on commit ba8ab2d

Please sign in to comment.