diff options
-rw-r--r-- | pages/flickr/importPhotosets.php | 50 | ||||
-rw-r--r-- | pages/flickr/setup.php | 17 | ||||
-rw-r--r-- | pages/upload.php | 13 | ||||
-rw-r--r-- | views/default/forms/tidypics/ajax_upload.php (renamed from views/default/tidypics/forms/ajax_upload.php) | 6 | ||||
-rw-r--r-- | views/default/forms/tidypics/basic_upload.php (renamed from views/default/tidypics/forms/upload.php) | 19 | ||||
-rw-r--r-- | views/default/tidypics/forms/setupFlickr.php | 45 |
6 files changed, 26 insertions, 124 deletions
diff --git a/pages/flickr/importPhotosets.php b/pages/flickr/importPhotosets.php deleted file mode 100644 index a807a0782..000000000 --- a/pages/flickr/importPhotosets.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - - /** - * Import a set of photos from Flickr - */ - - // Load Elgg engine - include_once dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/engine/start.php"; - $body = elgg_view_title( elgg_echo( 'flickr:importmanager' )); - $body .= "<h2>" . elgg_echo( 'flickr:desc' ) . "</h2>"; - - $viewer = get_loggedin_user(); - - require_once dirname(dirname(dirname(__FILE__))) . "/lib/phpFlickr/phpFlickr.php"; - require_once( dirname(dirname(dirname(__FILE__)))) . "/lib/flickr.php"; - $f = new phpFlickr("26b2abba37182aca62fe0eb2c7782050"); - - $viewer = get_loggedin_user(); - $flickr_username = get_metadata_byname( $viewer->guid, "flickr_username" ); - $flickr_id = get_metadata_byname( $viewer->guid, "flickr_id" ); - $album_id = get_metadata_byname( $viewer->guid, "flickr_album_id" ); - - if( intval( $album_id->value ) <= 0 ) { - register_error( sprintf( elgg_echo( 'flickr:errornoalbum' ), $album_id->value )); - forward( "/mod/tidypics/pages/flickr/setup.php" ); - } - - $photosets = $f->photosets_getList( $flickr_id->value ); - foreach( $photosets["photoset"] as $photoset ) { - $body .= "<div class='tidypics_album_images'>"; - $body .= "$photoset[title]<br />"; - - $count = 0; - $looper = 0; - //create links to import photos 10 at a time - while( $photoset["photos"] > $count ) { - $looper++; - $body .= " <a href='/mod/tidypics/actions/flickrImportPhotoset.php?set_id=$photoset[id]&page=$looper&album_id=$album_id->value'>$looper</a>"; - $count = $count + 10; - } - $body .= "<br />$photoset[photos] images"; - $body .= "</div>"; -// echo "<pre>"; var_dump( $photoset ); echo "</pre>"; die; - } - -// $body .= elgg_view("tidypics/forms/setupFlickr", array(), false, true ); - flickr_menu(); - 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 deleted file mode 100644 index 1de8c29c2..000000000 --- a/pages/flickr/setup.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - - /** - * Setup a users Flickr username - * - */ - - // Load Elgg engine - include_once dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/engine/start.php"; - - $viewer = get_loggedin_user(); - - $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( elgg_echo( 'flickr:setup'), elgg_view_layout("two_column_left_sidebar", '', $body)); -?>
\ No newline at end of file diff --git a/pages/upload.php b/pages/upload.php index 7ac4930b5..6580c6f52 100644 --- a/pages/upload.php +++ b/pages/upload.php @@ -6,6 +6,8 @@ include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php"; +global $CONFIG; + // must be logged in to upload images gatekeeper(); @@ -43,9 +45,16 @@ $title = elgg_echo('album:addpix') . ': ' . $album->title; $area2 .= elgg_view_title($title); if ($uploader == 'basic') { - $area2 .= elgg_view("tidypics/forms/upload", array('album' => $album)); + $area2 .= elgg_view('input/form', array( + 'action' => "{$CONFIG->wwwroot}action/tidypics/upload", + 'body' => elgg_view('forms/tidypics/basic_upload', array('album' => $album)), + 'internalid' => 'tidypicsUpload', + 'enctype' => 'multipart/form-data', + 'method' => 'post', + )); + } else { - $area2 .= elgg_view("tidypics/forms/ajax_upload", array('album' => $album)); + $area2 .= elgg_view("forms/tidypics/ajax_upload", array('album' => $album)); } $body = elgg_view_layout('two_column_left_sidebar', '', $area2); diff --git a/views/default/tidypics/forms/ajax_upload.php b/views/default/forms/tidypics/ajax_upload.php index 4a7a05c0c..a1d13e80b 100644 --- a/views/default/tidypics/forms/ajax_upload.php +++ b/views/default/forms/tidypics/ajax_upload.php @@ -1,4 +1,9 @@ <?php +/** + * Tidypics ajax upload form body + * + * @uses $vars['album'] + */ elgg_extend_view('metatags', 'tidypics/js/uploader'); @@ -134,4 +139,3 @@ $("#uploadify").uploadify({ }); </script> - diff --git a/views/default/tidypics/forms/upload.php b/views/default/forms/tidypics/basic_upload.php index 8bbda08b3..55ab854a4 100644 --- a/views/default/tidypics/forms/upload.php +++ b/views/default/forms/tidypics/basic_upload.php @@ -1,7 +1,14 @@ <?php -global $CONFIG; +/** + * Tidypics basic uploader form + * + * This only handled uploading the images. Editing the titles and descriptions + * are handled with the edit forms. + * + * @uses $vars['album'] + */ -//this is for image uploads only. Image edits are handled by edit.php form +global $CONFIG; $album = $vars['album']; $access_id = $album->access_id; @@ -69,14 +76,8 @@ if ($quota) { </p> <?php $form_body = ob_get_clean(); +echo $form_body; -echo elgg_view('input/form', array( - 'action' => "{$vars['url']}action/tidypics/upload", - 'body' => $form_body, - 'internalid' => 'tidypicsUpload', - 'enctype' => 'multipart/form-data', - 'method' => 'post',) -); ?> </div> <script type="text/javascript"> diff --git a/views/default/tidypics/forms/setupFlickr.php b/views/default/tidypics/forms/setupFlickr.php deleted file mode 100644 index 6c461176d..000000000 --- a/views/default/tidypics/forms/setupFlickr.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -require_once( dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . "/lib/flickr.php"; - -$user = get_loggedin_user(); -$flickr_username = get_metadata_byname( $user->guid, "flickr_username" ); -$flickr_album_id = get_metadata_byname( $user->guid, "flickr_album_id" ); - -$action = $vars['url'] . 'admin/action/tidypics/flickrSetup'; - -$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 = elgg_get_entities(array( - "type=" => "object", - "subtype" => "album", - "owner_guid" => $user->guid, -)); -$options = array( 0 => elgg_echo( 'flickr:selectalbum' )); -foreach( $albums as $album ) { - $title = $album->title; - switch( $album->access_id ) { - case ACCESS_PRIVATE: - $title .= " (" . elgg_echo( 'private' ) . ")"; - break; - case ACCESS_PUBLIC: - $title .= " (" . elgg_echo( 'public' ) . ")"; - break; - default: - $title .= " (no known permission set)"; - break; - } - $options[$album->guid] = $title; -} - -$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 )); -$form_body .= "<br />"; -$form_body .= elgg_view('input/submit', array('value' => elgg_echo("save"))); - -flickr_menu(); - -echo elgg_view('input/form', array('action' => $action, 'body' => $form_body)); |