aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/flickrImportPhotoset.php4
-rw-r--r--actions/flickrSetup.php10
-rw-r--r--languages/en.php21
-rw-r--r--lib/flickr.php4
-rw-r--r--pages/flickr/importPhotosets.php8
-rw-r--r--pages/flickr/setup.php4
-rw-r--r--start.php4
-rw-r--r--views/default/tidypics/forms/setupFlickr.php14
8 files changed, 44 insertions, 25 deletions
diff --git a/actions/flickrImportPhotoset.php b/actions/flickrImportPhotoset.php
index d28ea8564..ec0d65b5d 100644
--- a/actions/flickrImportPhotoset.php
+++ b/actions/flickrImportPhotoset.php
@@ -18,7 +18,7 @@ $user = get_loggedin_user();
$flickr_id = get_metadata_byname( $user->guid, "flickr_id" );
if( empty( $flickr_id )) {
- register_error( "You must enter a username" );
+ register_error( elgg_echo( 'flickr:errorusername2' ));
forward( $return_url );
die; //just in case
}
@@ -33,7 +33,7 @@ foreach( $photos["photoset"]["photo"] as $photo ) {
//check if we already have this image
$meta = get_metadata_byname( $user->guid, $photo["id"] );
if( $meta->value == 1 ) { //we've downloaded this already
- register_error( "This image has already been imported" );
+ register_error( elgg_echo( 'flickr:errorimageimport' ));
continue;
}
//store this so we don't download the same photo multiple times
diff --git a/actions/flickrSetup.php b/actions/flickrSetup.php
index 2a1f82315..fbc519b02 100644
--- a/actions/flickrSetup.php
+++ b/actions/flickrSetup.php
@@ -11,7 +11,7 @@ $return_url = get_input( "return_url" );
$user = get_loggedin_user();
if( empty( $flickr_username )) {
- register_error( "You must enter a username" );
+ register_error( elgg_echo( 'flickr:enterusername' ));
forward( $return_url );
die; //just in case
} else {
@@ -24,11 +24,11 @@ if( empty( $flickr_username )) {
$album = get_entity( $album_id );
}
- system_message( "Successfully saved Flickr username of $flickr_username" );
- system_message( "flickr user id: $flickr_user[id]" );
- system_message( "Album saved - $album->title" );
+ system_message( sprintf( elgg_echo( 'flickr:savedusername' ), $flickr_username ));
+ system_message( sprintf( elgg_echo( 'flickr:saveduserid' ), $flickr_user["id"] ));
+ system_message( sprintf( elgg_echo( 'flickr:savedalbum' ), $album->title ));
} else {
- register_error( "Username $flickr_username not found on Flickr" );
+ register_error( sprintf( elgg_echo( 'flickr:errorusername' ), $flickr_username ));
}
}
diff --git a/languages/en.php b/languages/en.php
index 4fc9bcd64..3d669fee8 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -49,7 +49,16 @@
'tidypics:viewsbyothers' => "(%s by you)",
'tidypics:administration' => 'Tidypics Administration',
'tidypics:stats' => 'Stats',
-
+ 'flickr:setup' => 'Flickr Setup',
+ 'flickr:usernamesetup' => 'Please enter your Flickr username here:',
+ 'flickr:selectalbum' => 'Select album to import photos into',
+ 'flickr:albumdesc' => 'Album to import photos to:',
+ 'flickr:importmanager' => 'Photoset Import Manager',
+ 'flickr:desc' => 'Click on the set you wish to import into this site.<br />Copies of the photos will be made and stored on this site where they can be viewed and commented on.',
+ 'flickr:intro' => 'Flickr Integration allows you to import photos from your flickr account into this Elgg site. By entering your username and choosing an album to import into, you can begin the process. <br />When you have saved your username and album selection, click on the ' . elgg_echo( 'flickr:menuimport' ) . ' link to the left to select which Flickr set you would like to import photos from.',
+ 'flickr:menusetup' => 'Flickr Setup',
+ 'flickr:menuimport' => 'Import Flickr Photos',
+
//settings
'tidypics:settings' => 'Settings',
'tidypics:admin:instructions' => 'These are the core Tidypics settings. Change them for your setup and then click save.',
@@ -171,6 +180,11 @@ The photo can be viewed here: %s",
'tidypics:settings:save:ok' => 'Successfully saved the Tidypics plugin settings',
'tidypics:upgrade:success' => 'Upgrade of Tidypics a success',
+
+ 'flickr:enterusername' => 'You must enter a username',
+ 'flickr:savedusername' => 'Successfully saved username of %s',
+ 'flickr:saveduserid' => 'Successfully saved userid of %s',
+ 'flickr:savedalbum' => 'Album saved - %s',
//Error messages
@@ -195,6 +209,11 @@ The photo can be viewed here: %s",
'album:blank' => "Please give this album a title and description.",
'tidypics:upgrade:failed' => "The upgrade of Tidypics failed",
+
+ 'flickr:errorusername' => 'Username %s not found on Flickr',
+ 'flickr:errorusername2' => 'You must enter a username',
+ 'flickr:errorimageimport' => 'This image has already been imported',
+ 'flickr:errornoalbum' => "No album selected. Please choose and save an album: %s"
);
add_translation("en",$english);
diff --git a/lib/flickr.php b/lib/flickr.php
index 48872c31f..effd186c4 100644
--- a/lib/flickr.php
+++ b/lib/flickr.php
@@ -1,8 +1,8 @@
<?php
function flickr_menu() {
- add_submenu_item( "Flickr setup", "/mod/tidypics/pages/flickr/setup.php");
- add_submenu_item( "Import Flickr photos", "/mod/tidypics/pages/flickr/importPhotosets.php" );
+ add_submenu_item( elgg_echo( 'flickr:menusetup' ), "/mod/tidypics/pages/flickr/setup.php");
+ add_submenu_item( elgg_echo( 'flickr:menuimport' ), "/mod/tidypics/pages/flickr/importPhotosets.php" );
}
?> \ No newline at end of file
diff --git a/pages/flickr/importPhotosets.php b/pages/flickr/importPhotosets.php
index fe241439e..a807a0782 100644
--- a/pages/flickr/importPhotosets.php
+++ b/pages/flickr/importPhotosets.php
@@ -6,8 +6,8 @@
// Load Elgg engine
include_once dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/engine/start.php";
- $body = elgg_view_title( "Photoset Import Manager" );
- $body .= "<h2>Click on the set you wish to import into this site. Copies of the photos will be made and stored on this site where they can be viewed and commented on.</h2>";
+ $body = elgg_view_title( elgg_echo( 'flickr:importmanager' ));
+ $body .= "<h2>" . elgg_echo( 'flickr:desc' ) . "</h2>";
$viewer = get_loggedin_user();
@@ -21,7 +21,7 @@
$album_id = get_metadata_byname( $viewer->guid, "flickr_album_id" );
if( intval( $album_id->value ) <= 0 ) {
- register_error( "No album selected. Please choose and save an album: $album_id->value" );
+ register_error( sprintf( elgg_echo( 'flickr:errornoalbum' ), $album_id->value ));
forward( "/mod/tidypics/pages/flickr/setup.php" );
}
@@ -45,6 +45,6 @@
// $body .= elgg_view("tidypics/forms/setupFlickr", array(), false, true );
flickr_menu();
- page_draw( "Photoset Import", elgg_view_layout("two_column_left_sidebar", '', $body));
+ page_draw( elgg_echo( 'flickr:importmanager' ), elgg_view_layout("two_column_left_sidebar", '', $body));
?> \ No newline at end of file
diff --git a/pages/flickr/setup.php b/pages/flickr/setup.php
index a2aa20db6..1de8c29c2 100644
--- a/pages/flickr/setup.php
+++ b/pages/flickr/setup.php
@@ -10,8 +10,8 @@
$viewer = get_loggedin_user();
- $body = elgg_view_title( "Setup Flickr" );
+ $body = elgg_view_title( elgg_echo( 'flickr:setup') );
$body .= elgg_view("tidypics/forms/setupFlickr", array(), false, true );
// echo "<pre>"; var_dump($body); echo "</pre>";
- page_draw( "Setup Flickr", elgg_view_layout("two_column_left_sidebar", '', $body));
+ page_draw( elgg_echo( 'flickr:setup'), elgg_view_layout("two_column_left_sidebar", '', $body));
?> \ No newline at end of file
diff --git a/start.php b/start.php
index 9648915bd..466c14be8 100644
--- a/start.php
+++ b/start.php
@@ -187,7 +187,7 @@
'tidypics-z');
if( get_loggedin_userid() == 9 ) {
add_submenu_item( 'Flickr Integration',
- $CONFIG->wwwroot . 'mod/tidypics/pages/setupFlickr.php',
+ $CONFIG->wwwroot . 'mod/tidypics/pages/flickr/setup.php',
'tidypics-z');
}
@@ -323,7 +323,7 @@
case "flickr":
if (isset($page[1])) set_input('username',$page[1]);
- include($CONFIG->pluginspath . "tidypics/pages/lists/flickr.php");
+ include($CONFIG->pluginspath . "tidypics/pages/flickr/setup.php");
break;
}
}
diff --git a/views/default/tidypics/forms/setupFlickr.php b/views/default/tidypics/forms/setupFlickr.php
index 8ae7c27bb..8c31d0883 100644
--- a/views/default/tidypics/forms/setupFlickr.php
+++ b/views/default/tidypics/forms/setupFlickr.php
@@ -7,29 +7,29 @@ $flickr_album_id = get_metadata_byname( $user->guid, "flickr_album_id" );
$action = $vars['url'] . 'action/tidypics/flickrSetup';
-$form_body = "<p>";
-$form_body .= "Please enter your Flickr username here: <input style='width: 20%;' type='text' name='flickr_username' value='$flickr_username->value' ' class='input-text' /> <br />";
+$form_body = "<p>". elgg_echo( 'flickr:intro' ) . "</p><p>";
+$form_body .= elgg_echo( 'flickr:usernamesetup') . " <input style='width: 20%;' type='text' name='flickr_username' value='$flickr_username->value' ' class='input-text' /> <br />";
$form_body .= "<input type='hidden' name='return_url' value='$_SERVER[REQUEST_URI]' />";
$albums = get_entities( "object", "album", $user->guid );
-$options = array( 0 => "Select album" );
+$options = array( 0 => elgg_echo( 'flickr:selectalbum' ));
foreach( $albums as $album ) {
$title = $album->title;
switch( $album->access_id ) {
case ACCESS_PRIVATE:
- $title .= " (private)";
+ $title .= " (" . elgg_echo( 'private' ) . ")";
break;
case ACCESS_PUBLIC:
- $title .= " (public)";
+ $title .= " (" . elgg_echo( 'public' ) . ")";
break;
default:
- $title .= " (not sure)";
+ $title .= " (no known permission set)";
break;
}
$options[$album->guid] = $title;
}
-$form_body .= "<br />Album to import photos to: ";
+$form_body .= "<br />" . elgg_echo( 'flickr:albumdesc' );
$form_body .= elgg_view('input/pulldown', array('internalname' => 'album_id',
'options_values' => $options,
'value' => $flickr_album_id->value ));