[Jaws-commits] r12427 - in trunk/jaws/html/gadgets/Phoo: . languages resources templates

afz at jaws-project.com afz at jaws-project.com
Mon Jan 16 11:11:57 UTC 2012


Author: afz
Date: 2012-01-16 11:11:57 +0000 (Mon, 16 Jan 2012)
New Revision: 12427

Modified:
   trunk/jaws/html/gadgets/Phoo/AdminHTML.php
   trunk/jaws/html/gadgets/Phoo/AdminModel.php
   trunk/jaws/html/gadgets/Phoo/Info.php
   trunk/jaws/html/gadgets/Phoo/Model.php
   trunk/jaws/html/gadgets/Phoo/languages/en.php
   trunk/jaws/html/gadgets/Phoo/resources/style.css
   trunk/jaws/html/gadgets/Phoo/templates/PhooBrowse.html
   trunk/jaws/html/gadgets/Phoo/templates/SelectImage.html
Log:
[Phoo]: BrowsePhoo action now can be tinyMCE image browser

Modified: trunk/jaws/html/gadgets/Phoo/AdminHTML.php
===================================================================
--- trunk/jaws/html/gadgets/Phoo/AdminHTML.php	2012-01-16 11:10:48 UTC (rev 12426)
+++ trunk/jaws/html/gadgets/Phoo/AdminHTML.php	2012-01-16 11:11:57 UTC (rev 12427)
@@ -1529,6 +1529,7 @@
         $t = new Jaws_Template('gadgets/Phoo/templates/');
         $t->Load('PhooBrowse.html');
         $t->SetBlock('phoo_browse');
+
         $dir = _t('GLOBAL_LANG_DIRECTION');
         $t->SetVariable('.dir', ($dir == 'rtl')? '.' . $dir : '');
 
@@ -1536,7 +1537,7 @@
         $album   = $request->get('album', 'get');
         $post    = $request->get(array('date', 'album'), 'post');
         $albums  = $model->GetAlbums('createtime','ASC');
-        if (!Jaws_Error::IsError ($albums)) {
+        if (!Jaws_Error::IsError($albums) && !empty($albums)) {
             $date =& $GLOBALS['app']->loadDate();
             $t->SetBlock ("phoo_browse/photos");
             $datecombo =& Piwi::CreateWidget('Combo', 'date');
@@ -1653,21 +1654,20 @@
                                     $t->SetVariable('notpublished', _t('PHOO_NOT_PUBLISHED'));
                                     $t->ParseBlock('phoo_browse/photos/albums/item/notpublished');
                                 }
-                                $t->ParseBlock ('phoo_browse/photos/albums/item');
+                                $t->ParseBlock('phoo_browse/photos/albums/item');
                             }
                         } else {
                             $t->SetBlock('phoo_browse/photos/albums/nophotos');
                             $t->SetVariable('message', _t('PHOO_ALBUM_EMPTY'));
                             $t->ParseBlock('phoo_browse/photos/albums/nophotos');
                         }
-                        $t->ParseBlock ('phoo_browse/photos/albums');
+                        $t->ParseBlock('phoo_browse/photos/albums');
                     }
                 }
             }
 
-            //Get failures
+            // Get failures
             $failures = $GLOBALS['app']->Session->GetAttribute('failures');
-            // Failures
             if (is_array($failures) && count($failures) > 0) {
                 foreach ($failures as $f) {
                     $t->SetBlock('phoo_browse/photos/failures');
@@ -1676,19 +1676,19 @@
                 }
             }
 
-            //Delete key
+            // Delete key
             $GLOBALS['app']->Session->DeleteAttribute('failures');
             $t->ParseBlock('phoo_browse/photos');
         } else {
-                $t->SetBlock ('phoo_browse/noalbums');
-                $t->SetVariable ('message', _t('PHOO_EMPTY_ALBUMSET'));
-                $t->ParseBlock ('phoo_browse/noalbums');
+            $t->SetBlock('phoo_browse/noalbums');
+            $t->SetVariable('message', _t('PHOO_EMPTY_ALBUMSET'));
+            $t->ParseBlock('phoo_browse/noalbums');
         }
 
         $t->ParseBlock('phoo_browse');
         return $t->Get();
     }
-    
+
     /**
      * Show the image selected from BrowsePhoo with some options to insert.
      *
@@ -1700,7 +1700,12 @@
         if (isset($_GET["image"]) && isset($_GET["album"])){
             $model =& $GLOBALS['app']->LoadGadget('Phoo', 'AdminModel');
             $t = new Jaws_Template('gadgets/Phoo/templates/');
-            $t->Load ('SelectImage.html');
+            $t->Load('SelectImage.html');
+            $t->SetBlock('ImageSelect');
+
+            $dir = _t('GLOBAL_LANG_DIRECTION');
+            $t->SetVariable('.dir', ($dir == 'rtl')? '.' . $dir : '');
+
             $image =  $model->GetImage($_GET["image"], $_GET["album"]);
             if (Jaws_Error::IsError ($image)) {
                 $GLOBALS['app']->Session->PushLastResponse($image->GetMessage(), RESPONSE_ERROR);
@@ -1718,19 +1723,19 @@
             $submit =& Piwi::CreateWidget('Button', 'other_pic_button', _t('PHOO_SELECT_OTHER_IMAGE'), STOCK_LEFT);
             $submit->SetSubmit();
             if (empty($image)) {
-                $t->SetBlock('not_published');
+                $t->SetBlock('ImageSelect/not_published');
                 $t->SetVariable('not_published_label', _t('PHOO_NOT_PUBLISHED'));
                 if (isset($r_album)){
                     $t->SetVariable('album',$r_album);
                 }
                 $buttonbox->Add($submit);
                 $t->SetVariable('button_bar',$buttonbox->Get());
-                $t->ParseBlock('not_published');
+                $t->ParseBlock('ImageSelect/not_published');
             } else {
-                $t->SetBlock('selected');
+                $t->SetBlock('ImageSelect/selected');
                 $id = $image['id'];
                 $filename = $GLOBALS['app']->getDataURL('phoo/' . $image['image']);
-                $title = $image['title'];
+                $title = (empty($image['name']))? '' : $image['name'];
                 $desc = $image['description'];
                 $published = $image['published'];
                 if (isset($r_album)){
@@ -1742,7 +1747,6 @@
                 $t->SetVariable('t_thumb',_t('PHOO_THUMB'));
                 $t->SetVariable('t_medium',_t('PHOO_MEDIUM'));
                 $t->SetVariable('insert_image_title', _t('PHOO_INSERTIMAGE'));
-                $t->SetVariable('image_label',_t('PHOO_IMAGE_LABEL'));
                 $t->SetVariable('include_link',_t('PHOO_INCLUDE_LINK_TO_ALBUM'));
                 $t->SetVariable('s_image', $GLOBALS['app']->getDataURL('phoo/' . $image['medium']));
                 $t->SetVariable('s_name', $title);
@@ -1750,17 +1754,20 @@
                 $t->SetVariable('s_album',$r_album);
 
                 $insert_pic =& Piwi::CreateWidget('Button', 'insert_pic__button', _t('PHOO_INSERTIMAGE'), STOCK_SAVE);
-                $insert_pic->AddEvent(ON_CLICK, "parent.parent.go_select($r_album, $id, this.form.s_title.value, this.form.s_class.value, this.form.s_size.value, this.form.linked.value,'$filename',true);");
+                //$insert_pic->AddEvent(ON_CLICK, "parent.parent.go_select($r_album, $id, this.form.s_title.value, this.form.s_class.value, this.form.s_size.value, this.form.linked.value,'$filename',true);");
+                $insert_pic->AddEvent(ON_CLICK, "goSelect($r_album, $id, this.form.s_title.value, this.form.s_class.value, this.form.s_size.value, this.form.linked.value,'$filename', 'tinymce');");
                 $buttonbox->Add($submit);
                 $buttonbox->Add($insert_pic);
                 $t->SetVariable('button_bar',$buttonbox->Get());
                 if ($GLOBALS['app']->Registry->Get('/gadgets/Phoo/keep_original') == 'true') {
-                    $t->SetBlock('selected/original');
+                    $t->SetBlock('ImageSelect/selected/original');
                     $t->SetVariable('t_original',_t('PHOO_ORIGINAL'));
-                    $t->ParseBlock('selected/original');
+                    $t->ParseBlock('ImageSelect/selected/original');
                 }
-                $t->ParseBlock('selected');
+                $t->ParseBlock('ImageSelect/selected');
             }
+
+            $t->ParseBlock('ImageSelect');
             return $t->Get();
         }
     }

Modified: trunk/jaws/html/gadgets/Phoo/AdminModel.php
===================================================================
--- trunk/jaws/html/gadgets/Phoo/AdminModel.php	2012-01-16 11:10:48 UTC (rev 12426)
+++ trunk/jaws/html/gadgets/Phoo/AdminModel.php	2012-01-16 11:11:57 UTC (rev 12427)
@@ -38,8 +38,8 @@
 
         // Registry keys
         $GLOBALS['app']->Registry->NewKey('/gadgets/Phoo/default_action',    'AlbumList');
-        $GLOBALS['app']->Registry->NewKey('/gadgets/Phoo/thumbsize',         '128x128');
-        $GLOBALS['app']->Registry->NewKey('/gadgets/Phoo/mediumsize',        '320x320');
+        $GLOBALS['app']->Registry->NewKey('/gadgets/Phoo/thumbsize',         '133x100');
+        $GLOBALS['app']->Registry->NewKey('/gadgets/Phoo/mediumsize',        '400x300');
         $GLOBALS['app']->Registry->NewKey('/gadgets/Phoo/moblog_album',      '');
         $GLOBALS['app']->Registry->NewKey('/gadgets/Phoo/moblog_limit',      '10');
         $GLOBALS['app']->Registry->NewKey('/gadgets/Phoo/photoblog_album',   '');
@@ -817,4 +817,5 @@
         }
         return $cleanFiles;
     }
+
 }

Modified: trunk/jaws/html/gadgets/Phoo/Info.php
===================================================================
--- trunk/jaws/html/gadgets/Phoo/Info.php	2012-01-16 11:10:48 UTC (rev 12426)
+++ trunk/jaws/html/gadgets/Phoo/Info.php	2012-01-16 11:11:57 UTC (rev 12427)
@@ -17,7 +17,7 @@
         parent::Init('Phoo');
         $this->GadgetName(_t('PHOO_NAME'));
         $this->GadgetDescription(_t('PHOO_DESC'));
-        $this->GadgetVersion('0.8.4');
+        $this->GadgetVersion('0.8.3');
         $this->Doc('gadget/Phoo');
         $this->ListURL(true);
 

Modified: trunk/jaws/html/gadgets/Phoo/Model.php
===================================================================
--- trunk/jaws/html/gadgets/Phoo/Model.php	2012-01-16 11:10:48 UTC (rev 12426)
+++ trunk/jaws/html/gadgets/Phoo/Model.php	2012-01-16 11:11:57 UTC (rev 12427)
@@ -1384,6 +1384,7 @@
     {
         $ret = array();
         $ret['default_action']    = $GLOBALS['app']->Registry->Get('/gadgets/Phoo/default_action');
+        $ret['resize_method']     = $GLOBALS['app']->Registry->Get('/gadgets/Phoo/resize_method');
         $ret['moblog_album']      = $GLOBALS['app']->Registry->Get('/gadgets/Phoo/moblog_album');
         $ret['moblog_limit']      = $GLOBALS['app']->Registry->Get('/gadgets/Phoo/moblog_limit');
         $ret['photoblog_album']   = $GLOBALS['app']->Registry->Get('/gadgets/Phoo/photoblog_album');
@@ -1457,4 +1458,5 @@
         }   
         return $res;
     }
-}
+
+}
\ No newline at end of file

Modified: trunk/jaws/html/gadgets/Phoo/languages/en.php
===================================================================
--- trunk/jaws/html/gadgets/Phoo/languages/en.php	2012-01-16 11:10:48 UTC (rev 12426)
+++ trunk/jaws/html/gadgets/Phoo/languages/en.php	2012-01-16 11:11:57 UTC (rev 12427)
@@ -130,7 +130,7 @@
 define('_EN_PHOO_INSERTIMAGE', "Insert image");
 define('_EN_PHOO_IMAGE_LABEL', "Image");
 define('_EN_PHOO_SELECT_OTHER_IMAGE', "Select a different image");
-define('_EN_PHOO_INCLUDE_LINK_TO_ALBUM', "Include link to album");
+define('_EN_PHOO_INCLUDE_LINK_TO_ALBUM', "Include link to the album");
 
 /* ACL's */
 define('_EN_PHOO_ACL_DEFAULT', "Administer Phoo");

Modified: trunk/jaws/html/gadgets/Phoo/resources/style.css
===================================================================
--- trunk/jaws/html/gadgets/Phoo/resources/style.css	2012-01-16 11:10:48 UTC (rev 12426)
+++ trunk/jaws/html/gadgets/Phoo/resources/style.css	2012-01-16 11:11:57 UTC (rev 12427)
@@ -100,7 +100,6 @@
     display: table-cell;
     vertical-align: top;
     width: 200px;
-    padding-right: 1em;
 }
 
 #albums-combo-cell table {
@@ -121,7 +120,6 @@
     border: 1px solid #d3d7cf;
     background: #fafafa;
     padding:10px;
-    width: 95%;
     margin-bottom: 10px;
 }
 
@@ -229,4 +227,22 @@
 
 #photo-edit {
     width: 170px;
-}
\ No newline at end of file
+}
+
+/* Phoo Browse */
+#phoo_browse {min-height:100px; font-size:12px; padding:10px; background-color:white;}
+#phoo_browse .no-album {padding-top:40px;}
+#phoo_browse #albums-area {padding:0 10px;}
+#phoo_browse .phoo-album h2 {font-size:14px;}
+#phoo_browse .phoo-album-description {margin:5px 0 10px 0;}
+#phoo_browse .phoo-album-items {margin-left:-2px;}
+#phoo_browse .phoo-album-item a {display:block; position:relative;}
+#phoo_browse .phoo-album-item span {position:absolute; left:4px; top:54px;}
+
+/* Image Select */
+#image_select_container {font-size:12px; padding:10px; background-color:white;}
+#image_select {display:inline-block;}
+#image_select .image-box {border:solid 1px #999; background-color:#f5f5f5; margin:10px auto; padding:10px;}
+#image_select .phoo-image {border:solid 1px #999; padding:3px;}
+#image_select .image-porperties tr {height:30px;}
+

Modified: trunk/jaws/html/gadgets/Phoo/templates/PhooBrowse.html
===================================================================
--- trunk/jaws/html/gadgets/Phoo/templates/PhooBrowse.html	2012-01-16 11:10:48 UTC (rev 12426)
+++ trunk/jaws/html/gadgets/Phoo/templates/PhooBrowse.html	2012-01-16 11:11:57 UTC (rev 12427)
@@ -2,91 +2,77 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html>
-
 <head>
   <title>Phoo Browse</title>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <link rel="stylesheet" type="text/css" href="gadgets/ControlPanel/resources/public{.dir}.css" />
   <link rel="stylesheet" type="text/css" href="gadgets/Phoo/resources/style{.dir}.css" />
 </head>
-
-<body style="background: #fff;">
-<!-- BEGIN message -->
-    <div align="center" style="padding:20px;">
-        <span class="{class}">{message}</span>
+<body>
+  <div id="phoo_browse">
+    <!-- BEGIN noalbums -->
+    <div class="no-album">
+      <div class="notice-message">{message}</div>
     </div>
-<!-- END message -->
+    <!-- END noalbums -->
 
-<!-- BEGIN noalbums -->
-    <div style="border: 1px solid #ddd; background: #fafafa; padding: 20px; margin: 20px;" align="center">
-        {message}<br /><br />
-    </div>
-<!-- END noalbums -->
-
-<!-- BEGIN photos -->
+    <!-- BEGIN photos -->
     <script language="JavaScript">
-        function selectAllAlbums()
-        {
-            c = document.getElementById ("albums");
-            for (i=c.options.length-1; i>=0; i--)
-                c.options[i].selected = true;
+        function selectAllAlbums() {
+            var combo = document.getElementById('albums'),
+                i;
+            for (i = combo.options.length - 1; i >= 0; i--) {
+                combo.options[i].selected = true;
+            }
         }
     </script>
-
     <form name="AdminPhotos" action="admin.php" method="POST">
-        <input type="hidden" name="gadget" value="Phoo" />
-        <input type="hidden" name="action" value="BrowsePhoo" />
-        <table id="phoo-table">
-            <tr>
-                <td id="albums-combo-cell">
-                    <table>
-                        <tr>
-                            <td>
-                            <label>{date}:</label>
-                            {date_combo}
-                            </td>
-                        </tr>
-                        <tr>
-                            <td>
-                            <label>{albums}:</label>
-                            {albums_combo}
-                            </td>
-                        </tr>
-                    </table>
-                </td>
-                <td>
-                <!-- BEGIN failures -->
-                <center><div class="error-message" style="margin-bottom: 1.4em;">{message}</div><center>
-                <!-- END failures -->
-                <div id="albums-area">
-                    <!-- BEGIN albums -->
-                    <div class="phoo-album">
-                        <span class="phoo-album-date">{createtime}</span>
-                        <h2>{title}</h2>
-                        <div class="phoo-album-description">{description}</div>
-                        <div class="phoo-album-actions">{actions}</div>
-                    </div>
-                    <div class="clearfix">
-                        <!-- BEGIN item -->
-                        <span class="phoo-album-item">
-                        <a href="{url}">
-                        <img class="phoo-image phoo-square" src="{thumb}" title="{name}" width="{width}" height="{height}" alt="{name}" />
-                        <!-- BEGIN notpublished -->
-                        <br /><span class="not-published">{notpublished}</span>
-                        <!-- END notpublished -->
-                        </a>
-                        </span>
-                        <!-- END item -->
-                    </div>
-                    <!-- BEGIN nophotos -->
-                    <div class="no-photos"><div class="notice-message">{message}</div></div>
-                    <!-- END nophotos -->
-                    <!-- END albums -->
+      <input type="hidden" name="gadget" value="Phoo" />
+      <input type="hidden" name="action" value="BrowsePhoo" />
+      <table id="phoo-table">
+        <tr>
+          <td id="albums-combo-cell">
+            <div><label for="date">{date}:</label></div>
+            <div>{date_combo}</div><br/>
+            <div><label for="albums">{albums}:</label></div>
+            <div>{albums_combo}</div>
+          </td>
+          <td>
+            <!-- BEGIN failures -->
+            <center><div class="error-message" style="margin-bottom: 1.4em;">{message}</div><center>
+            <!-- END failures -->
+            <div id="albums-area">
+              <!-- BEGIN albums -->
+              <div class="phoo-album">
+                <span class="phoo-album-date">{createtime}</span>
+                <h2>{title}</h2>
+                <div class="phoo-album-description">{description}</div>
+                <div class="phoo-album-items clearfix">
+                  <!-- BEGIN item -->
+                  <span class="phoo-album-item">
+                    <a href="{url}">
+                      <img class="phoo-image phoo-square" src="{thumb}" title="{name}" width="{width}" height="{height}" alt="{name}" />
+                      <!-- BEGIN notpublished -->
+                      <span class="not-published">{notpublished}</span>
+                      <!-- END notpublished -->
+                    </a>
+                  </span>
+                  <!-- END item -->
                 </div>
-                </td>
-        </table>
+                <!-- BEGIN nophotos -->
+                <div class="no-photos">
+                  <div class="notice-message">{message}</div>
+                </div>
+                <!-- END nophotos -->
+              </div>
+              <!-- END albums -->
+            </div>
+          </td>
+        </tr>
+      </table>
     </form>
-<!-- END photos -->
+    <!-- END photos -->
+  </div>
 </body>
 </html>
-<!-- END phoo_browse -->
\ No newline at end of file
+<!-- END phoo_browse -->

Modified: trunk/jaws/html/gadgets/Phoo/templates/SelectImage.html
===================================================================
--- trunk/jaws/html/gadgets/Phoo/templates/SelectImage.html	2012-01-16 11:10:48 UTC (rev 12426)
+++ trunk/jaws/html/gadgets/Phoo/templates/SelectImage.html	2012-01-16 11:11:57 UTC (rev 12427)
@@ -1,3 +1,4 @@
+<!-- BEGIN ImageSelect -->
 <?xml version="1.0" encoding="utf-8" ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html>
@@ -2,72 +3,128 @@
 <head>
-    <title>Phoo Browse</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <meta name="generator" content="Jaws 0.7.0" /> 
-    <link rel="stylesheet" type="text/css"  href="gadgets/ControlPanel/resources/ControlPanel.css" />
+  <title>Select Image</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <link rel="stylesheet" type="text/css" href="gadgets/ControlPanel/resources/public{.dir}.css" />
+  <link rel="stylesheet" type="text/css" href="gadgets/Phoo/resources/style{.dir}.css" />
+  <script type="text/javascript" src="libraries/tinymce/tiny_mce_popup.js"></script>
 </head>
-<body style="background: #fff;">
-
-<!-- BEGIN message -->
-    <div align="center" style="padding:20px;">
-        <span class="{class}">{message}</span>
-    </div>
-<!-- END message -->
-
-<!-- BEGIN selected -->
-
-<form name="AdminPhotos" action="admin.php" method="POST">
+<body>
+  <div id="image_select_container">
+    <div id="image_select">
+      <!-- BEGIN selected -->
+      <form name="AdminPhotos" action="admin.php" method="POST">
         <input type="hidden" name="gadget" value="Phoo" />
         <input type="hidden" name="action" value="BrowsePhoo" />
         <input type="hidden" name="album" value="{album}" />
-        <table style="border: solid 1px #999; background: #f5f5f5; margin-top: 10px; margin-bottom: 10px; margin-right: auto; margin-left: auto; padding: 10px;" >
+        <table class="image-box">
             <tr>
-                <td>
-                     <h3>{image_label}:</h3> 
-                     <center>
-                         <img style="margin: 2px; padding: 2px; border: 1px solid #999; background: #fff;" src="{s_image}" title="{s_name}"/>
-                     </center><br />
-                </td>
-                <td >
-                    <b>{t_title}:</b> <input name="s_title" type="text" value="{s_name}" size="20" maxlength="50"><br />
-                    <b>{t_css}:</b>  <input name="s_class" type="text" value="image" size="12" maxlength="50"><br />
-                    <b>{t_size}:</b>
-                    <br /><input name="size" type="radio" value="Thumb" checked onClick="javascript: this.form.s_size.value ='Thumb' " >{t_thumb}
-                    <br /><input name="size" type="radio" value="Medium" onClick="javascript: this.form.s_size.value='Medium'">{t_medium} 
-                    <!-- BEGIN original -->
-                    <br /><input name="size" type="radio" value="Original" onClick="javascript: this.form.s_size.value='Original'">{t_original}
-                    <!-- END original -->
-                    <br /><input name="s_linked" type="checkbox" value="Yes" onClick="javascript: this.form.linked.value = this.form.s_linked.checked;"> <b>{include_link}</b>
-                </td>
+              <td class="phoo-image">
+                <img src="{s_image}" title="{s_name}" />
+              </td>
+              <td valign="top">
+                <table class="image-porperties">
+                  <tr>
+                    <td><label for="s_title">{t_title}:</label></td>
+                    <td><input id="s_title" name="s_title" type="text" value="{s_name}" size="35" maxlength="50"></td>
+                  </tr>
+                  <tr>
+                    <td><label for="s_class">{t_css}:</label></td>
+                    <td><input id="s_class" name="s_class" type="text" value="image" size="35" maxlength="50"></td>
+                  </tr>
+                  <tr>
+                    <td><label for="thumb">{t_size}:</label></td>
+                    <td>
+                      <input id="thumb" name="size" type="radio" value="Thumb" checked onClick="javascript:this.form.s_size.value ='Thumb'" ><label for="thumb">{t_thumb}</label>
+                      <input id="medium" name="size" type="radio" value="Medium" onClick="javascript:this.form.s_size.value='Medium'"><label for="medium">{t_medium}</label>
+                      <!-- BEGIN original -->
+                      <input id="original" name="size" type="radio" value="Original" onClick="javascript:this.form.s_size.value='Original'"><label for="original">{t_original}</label>
+                      <!-- END original -->
+                    </td>
+                  </tr>
+                  <tr>
+                    <td> </td>
+                    <td>
+                      <input type="checkbox" id="s_linked" name="s_linked" value="Yes" onClick="javascript: this.form.linked.value = this.form.s_linked.checked;">
+                      <label for="s_linked">{include_link}</label>
+                    </td>
+                  </tr>
+                </table>
+              </td>
             </tr>
             <tr>
-               <td colspan="2" align="center">
-                   <input name="s_size" type="hidden" value="Thumb" size="1" maxlength="1">
-                   <input name="linked" type="hidden" value="false" size="1" maxlength="1">
-                   {button_bar}
-               </td>
+              <td colspan="2" align="center">
+                <input name="s_size" type="hidden" value="Thumb" size="1" maxlength="1">
+                <input name="linked" type="hidden" value="false" size="1" maxlength="1">
+              </td>
             </tr>
         </table>
-</form>
-<!-- END selected -->
+        {button_bar}
+      </form>
+      <!-- END selected -->
 
-<!-- BEGIN not_published -->
+      <!-- BEGIN not_published -->
+      <form name="AdminPhotos" action="admin.php" method="POST">
+        <input type="hidden" name="gadget" value="Phoo" />
+        <input type="hidden" name="action" value="BrowsePhoo" />
+        <input type="hidden" name="album" value="{album}" />
+        <div class="image-box">
+          <div class="notice-message">{not_published_label}</div> 
+        </div>
+        {button_bar}
+      </form>
+      <!-- END not_published -->
+    </div>
+  </div>
+</body>
+<script type="text/JavaScript">
+    function goSelect(album, picture, title, clase, psize, linked, img_src, type) {
+        if (linked == 'true') {
+            is_linked = 'Yes';
+        } else {
+            is_linked = 'No';
+        }
 
-<form name="AdminPhotos" action="admin.php" method="POST">
-    <input type="hidden" name="gadget" value="Phoo" />
-    <input type="hidden" name="action" value="BrowsePhoo" />
-    <input type="hidden" name="album" value="{album}" />
-        <table style="border: solid 1px #999; background: #f5f5f5; margin-top: 10px; margin-bottom: 10px; margin-right: auto; margin-left: auto; padding: 10px;">
-            <tr>
-                <td>
-                     <b>{not_published_label}:</b> 
-                </td>
-            </tr>
-            <tr>
-               <td align="center">
-                   {button_bar}
-               </td>
-            </tr>
-        </table>
-</form>
-<!-- END not_published -->
-</body>
+        img_src = getSizePath(img_src, psize);
+        switch (type) {
+            case 'tinymce':
+                var win = tinyMCEPopup.getWindowArg("window");
+                win.document.getElementById('src').value = img_src;
+                win.document.getElementById('alt').value = title;
+                win.document.getElementById('title').value = title;
+                if (win.ImageDialog.getImageData) win.ImageDialog.getImageData();
+                if (win.ImageDialog.showPreviewImage) win.ImageDialog.showPreviewImage(img_src);
+                tinyMCEPopup.close();
+                break;
+            case 'plugin':
+                insertTags(textarea_outer,
+                       '[phoo album="'+album+'" picture="'+picture+'" title="'+title+'" class="'+clase+'" size="'+psize+'" linked="'+is_linked+'"]',
+                       '',
+                       '');
+                GB_hide();
+                break;
+            default:
+                img = '<img src="' + img_src + '" class="' + clase + '" title="' + title + '" alt="' + title + '" />';
+                if (linked == 'true') {
+                    img = '<a href="' + img_src + '">' + img + '</a>';
+                }
+                insertTags(textarea_outer, img, '', '');
+                GB_hide();
+        }
+
+        function getSizePath(filename, size) {
+            path = filename.substring(0, filename.lastIndexOf('/'));
+            file = filename.substring(filename.lastIndexOf('/'));
+
+            switch(size) {
+                case 'Thumb':
+                    return path + '/thumb' + file;
+                    break;
+                case 'Medium':
+                    return path + '/medium' + file;
+                    break;
+                default:
+                    return filename;
+            }
+        }
+    }
+</script>
+<!-- END ImageSelect -->
\ No newline at end of file



More information about the Jaws-commits mailing list