From 6913e7153000ff39f491accf06cf5817f7e6bfd3 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Wed, 19 Aug 2009 12:04:17 +0000 Subject: added a latest photos widget --- languages/de.php | 10 +++++--- languages/en.php | 10 +++++--- languages/es.php | 10 +++++--- languages/he.php | 10 +++++--- start.php | 5 ++-- views/default/tidypics/css.php | 5 ++++ views/default/widgets/album_view/edit.php | 41 +++++++++++++++++-------------- views/default/widgets/latest/edit.php | 15 +++++++++++ views/default/widgets/latest/view.php | 15 +++++++++++ 9 files changed, 84 insertions(+), 37 deletions(-) create mode 100644 views/default/widgets/latest/edit.php create mode 100644 views/default/widgets/latest/view.php diff --git a/languages/de.php b/languages/de.php index 3c6d3d101..bca483af1 100644 --- a/languages/de.php +++ b/languages/de.php @@ -123,11 +123,13 @@ //widgets - 'album:widget' => "Fotoalben", + 'tidypics:widget:albums' => "Fotoalben", + 'tidypics:widget:album_descr' => "Zeige Deine neuesten Fotoalben", + 'tidypics:widget:num_albums' => "Anzahl der anzuzeigenden Alben", + 'tidypics:widget:latest' => "Latest Photos", + 'tidypics:widget:latest_descr' => "Display your latest photos", + 'tidypics:widget:num_latest' => "Number of images to display", 'album:more' => "Alle Alben ansehen", - 'album:widget:description' => "Zeige Deine neuesten Fotoalben", - 'album:display:number' => "Anzahl der Alben, die angezeigt werden sollen", - 'album:num_albums' => "Anzahl der anzuzeigenden Alben", //river diff --git a/languages/en.php b/languages/en.php index 7aef34094..c6d9bd61b 100644 --- a/languages/en.php +++ b/languages/en.php @@ -119,11 +119,13 @@ //widgets - 'album:widget' => "Photo Albums", + 'tidypics:widget:albums' => "Photo Albums", + 'tidypics:widget:album_descr' => "Showcase your photo albums", + 'tidypics:widget:num_albums' => "Number of albums to display", + 'tidypics:widget:latest' => "Latest Photos", + 'tidypics:widget:latest_descr' => "Display your latest photos", + 'tidypics:widget:num_latest' => "Number of images to display", 'album:more' => "View all albums", - 'album:widget:description' => "Showcase your latest photo albums", - 'album:display:number' => "Number of albums to display", - 'album:num_albums' => "Number of albums to display", // river diff --git a/languages/es.php b/languages/es.php index 2e0d1cf81..1c9b580ef 100644 --- a/languages/es.php +++ b/languages/es.php @@ -118,11 +118,13 @@ //widgets - 'album:widget' => "Álbumnes de fotos", + 'tidypics:widget:albums' => "Álbumnes de fotos", + 'tidypics:widget:album_descr' => "Mosrar tu último álbum de fotos", + 'tidypics:widget:num_albums' => "Número de álbumnes a mostrar", + 'tidypics:widget:latest' => "Latest Photos", + 'tidypics:widget:latest_descr' => "Display your latest photos", + 'tidypics:widget:num_latest' => "Number of images to display", 'album:more' => "Ver todos los álbumnes", - 'album:widget:description' => "Mosrar tu último álbum de fotos", - 'album:display:number' => "Número de álbumnes a mostrar", - 'album:num_albums' => "Número de álbumnes a mostrar", // river diff --git a/languages/he.php b/languages/he.php index 801d8a96f..8edee9c0c 100644 --- a/languages/he.php +++ b/languages/he.php @@ -95,11 +95,13 @@ $hebrew = array( 'tidypics:phototagging:error' => "אירע שגיאה בתהליך התיוג" , 'tidypics:deletetag:success' => "התגים נמחקו בהצלחה" , 'tidypics:posted' => "הוסיף/ה תמונה" , - 'album:widget' => "אלבומי תמונות" , + 'tidypics:widget:albums' => "אלבומי תמונות" , + 'tidypics:widget:album_descr' => "הצג את האלבומים החדשים שלך" , + 'tidypics:widget:num_albums' => "מספר האלבומים לתצוגה" , + 'tidypics:widget:latest' => "Latest Photos", + 'tidypics:widget:latest_descr' => "Display your latest photos", + 'tidypics:widget:num_latest' => "Number of images to display", 'album:more' => "צפיה בכל האלבומים" , - 'album:widget:description' => "הצג את האלבומים החדשים שלך" , - 'album:display:number' => "מספר האלבומים לתצוגה" , - 'album:num_albums' => "מספר האלבומים לתצוגה" , 'image:river:created' => "%s הוסיף/ה את התמונה %s לאלבום %s" , 'image:river:item' => "תמונה" , 'image:river:annotate' => "תגובה לתמונה" , diff --git a/start.php b/start.php index 9e061ad90..d88f7497a 100644 --- a/start.php +++ b/start.php @@ -41,9 +41,10 @@ // Register a page handler, so we can have nice URLs register_page_handler('photos','tidypics_page_handler'); - + // Add a new tidypics widget - add_widget_type('album_view', elgg_echo("album:widget"), elgg_echo("album:widget:description"), 'profile'); + add_widget_type('album_view', elgg_echo("tidypics:widget:albums"), elgg_echo("tidypics:widget:album_descr"), 'profile'); + add_widget_type('latest', elgg_echo("tidypics:widget:latest"), elgg_echo("tidypics:widget:latest_descr"), 'profile'); // Register a URL handler for files register_entity_url_handler('tidypics_image_url', 'object', 'image'); diff --git a/views/default/tidypics/css.php b/views/default/tidypics/css.php index 84f6ee2d5..c3c202caf 100644 --- a/views/default/tidypics/css.php +++ b/views/default/tidypics/css.php @@ -113,6 +113,11 @@ text-align:center; color:#333333; } +.tidypics_widget_latest { +margin: 0 auto; +width: 208px; +} + /* --------- image upload/edit forms ------------ */ #tidpics_image_upload_list li { diff --git a/views/default/widgets/album_view/edit.php b/views/default/widgets/album_view/edit.php index 2d7c7708f..1fea6764a 100644 --- a/views/default/widgets/album_view/edit.php +++ b/views/default/widgets/album_view/edit.php @@ -1,21 +1,24 @@

- : - - num_display == '') $vars['entity']->num_display = 5; - ?> - +num_display == '') $vars['entity']->num_display = 5; + +?> +

\ No newline at end of file diff --git a/views/default/widgets/latest/edit.php b/views/default/widgets/latest/edit.php new file mode 100644 index 000000000..15a56af82 --- /dev/null +++ b/views/default/widgets/latest/edit.php @@ -0,0 +1,15 @@ +

+num_display == '') $vars['entity']->num_display = 6; + +?> + +

\ No newline at end of file diff --git a/views/default/widgets/latest/view.php b/views/default/widgets/latest/view.php new file mode 100644 index 000000000..6d65e9dc1 --- /dev/null +++ b/views/default/widgets/latest/view.php @@ -0,0 +1,15 @@ +
+num_display; + //if no number has been set, default to 6 + if (!$number) + $number = 6; + + echo '
'; + echo tp_get_latest_photos($number); + echo '
'; + +?> +
\ No newline at end of file -- cgit v1.2.3