Changeset 514

Show
Ignore:
Timestamp:
04/22/05 19:38:48 (4 years ago)
Author:
dufuz
Message:

Ohh, don't forget the cool person :-)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/jaws/AUTHORS

    r69 r514  
    55Jorge Gallegos <kad@gulags.org> 
    66Mirco Bauer <meebey@meebey.net> 
     7Helgi �rmar �rbj�son <dufuz@php.net> 
  • trunk/jaws/html/gadgets/Phoo/Phoo.php

    r505 r514  
    206206                $albumid = isset ($_REQUEST["albumid"]) ? $_REQUEST["albumid"] : ""; 
    207207 
    208                 $image = $this->_Model->GetImage ($id, $albumid); 
    209                 if (!JawsError::IsError ($image)) { 
     208                $image = $this->_Model->GetImage($id, $albumid); 
     209                $settings = $this->_Model->GetSettings(); 
     210 
     211                if (!JawsError::IsError($image)) { 
    210212                        $t->SetVariable("name",$image["title"]); 
    211213                        $t->SetVariable("albumid",$albumid); 
    212214                        $t->SetVariable("description",$image["description"]); 
    213                         $t->SetVariable("image",$image["image"]); 
    214                         $t->SetVariable("original",$image["original"]); 
    215                          
     215                        $t->SetVariable("image", $image["image"]); 
     216                        $t->SetVariable('original', $image["original"]); 
     217 
    216218                        // Comment stuff 
    217219                        if ($image["allow_comments"] == 1) { 
     
    255257                        $t->SetVariable ("thumbs", _t("PHOO_THUMBS")); 
    256258                        $t->ParseBlock ("ViewImage/navigation"); 
     259 
     260            // show if the original was kept 
     261                        if ($settings['keep_original'] == 'true') { 
     262                            $t->SetBlock('ViewImage/original_a'); 
     263                            $t->SetVariable('original', $image["original"]); 
     264                            $t->ParseBlock('ViewImage/original_a'); 
     265                            $t->SetBlock('ViewImage/original_b'); 
     266                                $t->ParseBlock('ViewImage/original_b'); 
     267                        } 
    257268                         
     269 
    258270                        // EXIF STUFF 
    259                         if (isset ($image["exif"]) && count ($image["exif"]) > 0) { 
     271                        if ($settings['show_exif_info'] == 'true' && isset ($image["exif"]) && count ($image["exif"]) > 0) { 
    260272                                $datatext = ''; 
    261273                                if (!empty($image["exif"]["width"])) { 
     
    14431455                $commCombo->SetDefault($settings['allow_comments']); 
    14441456 
     1457        // Keep original 
     1458                $keepCombo =& new Combo("keep_original"); 
     1459                $keepCombo->SetTitle (_t("PHOO_KEEP_ORIGINAL")); 
     1460                $keepCombo->AddOption (_t("GLOBAL_ENABLED_UPPER"), "true"); 
     1461                $keepCombo->AddOption (_t("GLOBAL_DISABLED_UPPER"), "false"); 
     1462                $keepCombo->SetDefault($settings['keep_original']); 
     1463 
     1464        // Show EXIF info 
     1465                $exifCombo =& new Combo("show_exif_info"); 
     1466                $exifCombo->SetTitle (_t("PHOO_SHOW_EXIF_INFO")); 
     1467                $exifCombo->AddOption (_t("GLOBAL_ENABLED_UPPER"), "true"); 
     1468                $exifCombo->AddOption (_t("GLOBAL_DISABLED_UPPER"), "false"); 
     1469                $exifCombo->SetDefault($settings['show_exif_info']); 
     1470 
    14451471                // Moblog 
    14461472                $albums = $this->_Model->GetAlbumsByName(); 
     
    14851511 
    14861512 
    1487                 $fieldset->Add ($viewCombo); 
    1488                 $fieldset->Add ($resizeCombo); 
    1489                 $fieldset->Add ($statusCombo); 
    1490                 $fieldset->Add ($commCombo); 
    1491                 $fieldset->Add ($moblogAlbumCombo); 
    1492                 $fieldset->Add ($moblogLimitCombo); 
    1493                 $fieldset->Add ($photoblogAlbumCombo); 
    1494                 $fieldset->Add ($photoblogLimitCombo); 
     1513                $fieldset->Add($viewCombo); 
     1514                $fieldset->Add($resizeCombo); 
     1515                $fieldset->Add($statusCombo); 
     1516                $fieldset->Add($commCombo); 
     1517                $fieldset->Add($keepCombo); 
     1518                $fieldset->Add($exifCombo); 
     1519                $fieldset->Add($moblogAlbumCombo); 
     1520                $fieldset->Add($moblogLimitCombo); 
     1521                $fieldset->Add($photoblogAlbumCombo); 
     1522                $fieldset->Add($photoblogLimitCombo); 
    14951523                $fieldset->SetDirection ("vertical"); 
    14961524                $form->Add ($fieldset); 
     
    15261554        { 
    15271555                $GLOBALS["session"]->CheckPermission ("Phoo", "Settings"); 
    1528                 $this->_Model->SaveSettings (   $_POST["default_action"], 
    1529                                                 $_POST["resize_method"], 
    1530                                                 $_POST["published"], 
    1531                                                 $_POST["allow_comments"], 
    1532                                                 $_POST["moblog_album"], 
    1533                                                 $_POST["moblog_limit"], 
    1534                                                 $_POST["photoblog_album"], 
    1535                                                 $_POST["photoblog_limit"]); 
     1556                $this->_Model->SaveSettings ( 
     1557                        $_POST["default_action"], 
     1558                        $_POST["resize_method"], 
     1559                        $_POST["published"], 
     1560                        $_POST["allow_comments"], 
     1561                        $_POST["moblog_album"], 
     1562                        $_POST["moblog_limit"], 
     1563                        $_POST["photoblog_album"], 
     1564                        $_POST["photoblog_limit"], 
     1565                        $_POST['show_exif_info'], 
     1566                        $_POST['keep_original'] 
     1567                ); 
    15361568                JawsHeader::Location ("admin.php?gadget=Phoo&action=AdditionalSettings"); 
    15371569        } 
  • trunk/jaws/html/gadgets/Phoo/PhooModel.php

    r512 r514  
    5858                 
    5959                // Registry keys 
    60                 $GLOBALS["app"]->Registry->NewKey ("/gadgets/Phoo/default_action", "AlbumList"); 
    61                 $GLOBALS["app"]->Registry->NewKey ("/gadgets/Phoo/resize_method", "ImageMagick"); 
    62                 $GLOBALS["app"]->Registry->NewKey ("/gadgets/Phoo/thumbsize", "133x100"); 
    63                 $GLOBALS["app"]->Registry->NewKey ("/gadgets/Phoo/mediumsize", "400x300"); 
    64                 $GLOBALS["app"]->Registry->NewKey ("/gadgets/Phoo/moblog_album", ""); 
    65                 $GLOBALS["app"]->Registry->NewKey ("/gadgets/Phoo/moblog_limit", "10"); 
    66                 $GLOBALS["app"]->Registry->NewKey ("/gadgets/Phoo/photoblog_album", ""); 
    67                 $GLOBALS["app"]->Registry->NewKey ("/gadgets/Phoo/photoblog_limit", "5"); 
    68                 $GLOBALS["app"]->Registry->NewKey ("/gadgets/Phoo/allow_comments", "true"); 
    69                 $GLOBALS["app"]->Registry->NewKey ("/gadgets/Phoo/published", "true"); 
    70                 $GLOBALS["app"]->Registry->NewKey ("/gadgets/Phoo/plugabble", "true"); 
     60                $GLOBALS["app"]->Registry->NewKey("/gadgets/Phoo/default_action", "AlbumList"); 
     61                $GLOBALS["app"]->Registry->NewKey("/gadgets/Phoo/resize_method", "ImageMagick"); 
     62                $GLOBALS["app"]->Registry->NewKey("/gadgets/Phoo/thumbsize", "133x100"); 
     63                $GLOBALS["app"]->Registry->NewKey("/gadgets/Phoo/mediumsize", "400x300"); 
     64                $GLOBALS["app"]->Registry->NewKey("/gadgets/Phoo/moblog_album", ""); 
     65                $GLOBALS["app"]->Registry->NewKey("/gadgets/Phoo/moblog_limit", "10"); 
     66                $GLOBALS["app"]->Registry->NewKey("/gadgets/Phoo/photoblog_album", ""); 
     67                $GLOBALS["app"]->Registry->NewKey("/gadgets/Phoo/photoblog_limit", "5"); 
     68                $GLOBALS["app"]->Registry->NewKey("/gadgets/Phoo/allow_comments", "true"); 
     69                $GLOBALS["app"]->Registry->NewKey("/gadgets/Phoo/published", "true"); 
     70                $GLOBALS["app"]->Registry->NewKey("/gadgets/Phoo/plugabble", "true"); 
     71                $GLOBALS["app"]->Registry->NewKey("/gadgets/Phoo/show_exif_info", "true"); 
     72                $GLOBALS["app"]->Registry->NewKey("/gadgets/Phoo/keep_original", "true"); 
    7173 
    7274                // ACL keys 
     
    16161618                $ret["allow_comments"] = $GLOBALS["app"]->Registry->Get ("/gadgets/Phoo/allow_comments"); 
    16171619                $ret["published"] = $GLOBALS["app"]->Registry->Get ("/gadgets/Phoo/published"); 
     1620                $ret['show_exif_info'] = $GLOBALS['app']->Registry->Get('/gadgets/Phoo/show_exif_info'); 
     1621                $ret['keep_original'] = $GLOBALS['app']->Registry->Get('/gadgets/Phoo/keep_original'); 
    16181622                return $ret; 
    16191623        } 
     
    16231627         * @access public 
    16241628         */ 
    1625         function SaveSettings($default_action, $resize_method, $published, $allow_comments, $moblog_album, $moblog_limit, $photoblog_album, $photoblog_limit
     1629        function SaveSettings($default_action, $resize_method, $published, $allow_comments, $moblog_album, $moblog_limit, $photoblog_album, $photoblog_limit, $show_exif_info, $keep_original
    16261630        { 
    16271631                $rs = array (); 
     
    16351639                $rs[6] = $GLOBALS["app"]->Registry->Set ("/gadgets/Phoo/photoblog_album", $photoblog_album); 
    16361640                $rs[7] = $GLOBALS["app"]->Registry->Set ("/gadgets/Phoo/photoblog_limit", $photoblog_limit); 
     1641                $rs[8] = $GLOBALS['app']->Registry->Set('/gadgets/Phoo/show_exif_info', $show_exif_info); 
     1642                $rs[9] = $GLOBALS['app']->Registry->Set('/gadgets/Phoo/keep_original', $keep_original); 
    16371643 
    16381644                foreach ($rs as $r) { 
  • trunk/jaws/html/gadgets/Phoo/languages/en/Phoo.php

    r374 r514  
    5959define ("_EN_PHOO_CREATE_NEW_ALBUM", "Create new album"); 
    6060define ("_EN_PHOO_DELETE_ALBUM", "Delete album"); 
     61define('_EN_PHOO_KEEP_ORIGINAL', 'Keep original image'); 
     62define('_EN_PHOO_SHOW_EXIF_INFO', 'Show EXIF info'); 
    6163 
    6264define ("_EN_PHOO_SAVE_CHANGES", "Save Changes"); 
  • trunk/jaws/html/gadgets/Phoo/templates/ViewImage.html

    r70 r514  
    1111<!-- END navigation --> 
    1212<div align="center"> 
    13 <a href="{original}"><img style="border: 1px solid #999; padding: 8px;" src="{image}" border="0" alt="" /></a> 
     13<!-- BEGIN original_a --> 
     14<a href="{original}"> 
     15<!-- END original_a --> 
     16 <img style="border: 1px solid #999; padding: 8px;" src="{image}" border="0" alt="" /> 
     17<!-- BEGIN original_b --> 
     18</a> 
     19<!-- END original_b --> 
    1420</div> 
     21 
    1522<p>{description}</p> 
     23 
    1624<!-- BEGIN exif --> 
    1725<div style="border:1px solid #ddd; padding: 4px;"> 
  • trunk/jaws/html/install/stages/WriteConfig.php

    r388 r514  
    8181        { 
    8282                // following what the web page says (choice 1) and assume that the user has created it already 
    83                 if (file_exists($GLOBALS["path"]."include/JawsConfig.php")) 
     83                if (file_exists($GLOBALS["path"]."include/JawsConfig.php")) { 
    8484                        return true; 
     85        } 
    8586 
    8687                // create a new one if the dir is writeable 
  • trunk/jaws/html/install/stages/WriteConfig/templates/JawsConfig.php

    r224 r514  
    99 
    1010// Path where Jaws is installed 
    11 $GLOBALS["path"] = substr(dirname(__FILE__),0,-7); 
     11$GLOBALS['path'] = substr(dirname(__FILE__), 0, -7); 
    1212 
    1313$db = array (); //DONT RENAME/DELETE THIS VARIABLE!! 
     
    2121 * DB username 
    2222 */ 
    23 $db["user"] = "{db_user}"; 
     23$db['user'] = "{db_user}"; 
    2424 
    2525/** 
    2626 * DB Password 
    2727 */ 
    28 $db["password"] = "{db_pass}"; 
     28$db['password'] = "{db_pass}"; 
    2929 
    3030/** 
    3131 * DB Name 
    3232 */ 
    33 $db["name"] = "{db_name}"; 
     33$db['name'] = "{db_name}"; 
    3434 
    3535/** 
    3636 * DB Server host 
    3737 */ 
    38 $db["host"] = "{db_host}"; 
     38$db['host'] = "{db_host}"; 
    3939 
    4040/** 
     
    4343 * Currently we just support the following DB Drivers: MySQL 
    4444 */ 
    45 $db["driver"] = "MySQL"; 
     45$db['driver'] = "MySQL"; 
    4646 
    4747/** 
     
    5050 * Optional, just make sure it has an empty value 
    5151 */ 
    52 $db["prefix"] = "{db_prefix}"; 
     52$db['prefix'] = "{db_prefix}"; 
    5353 
    5454/**