sync
authorAlan Knowles <alan@roojs.com>
Thu, 13 Jul 2017 02:28:00 +0000 (10:28 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 13 Jul 2017 02:28:00 +0000 (10:28 +0800)
DataObjects/Core_person.php
I18n.php
Pman.Dialog.Image.bjs
Pman.Dialog.Image.js

index 1de318b..bbe4a17 100644 (file)
@@ -151,7 +151,7 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject
         $decoder = new Mail_mimeDecode($mailtext);
         $parts = $decoder->getSendArray();
         
-        if (PEAR::isError($parts)) {
+        if (is_a($parts,'PEAR_Error')) {
             return $parts;
             //echo "PROBLEM: {$parts->message}";
             //exit;
@@ -350,9 +350,11 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject
         $u->whereAdd(' LENGTH(passwd) > 0');
         $n = $u->count();
         $_SESSION[get_class($this)][$sesPrefix .'-empty']  = $n;
-        $error =  PEAR::getStaticProperty('DB_DataObject','lastError');
-        if ($error) {
-            die($error->toString()); // not really a good thing to do...
+        if (class_exists('PEAR')) {
+            $error =  PEAR::getStaticProperty('DB_DataObject','lastError');
+            if ($error) {
+                die($error->toString()); // not really a good thing to do...
+            }
         }
         if (!$n){ // authenticated as there are no users in the system...
             return true;
index b6812a0..d87210f 100644 (file)
--- a/I18n.php
+++ b/I18n.php
@@ -201,6 +201,7 @@ class Pman_Core_I18n extends Pman
         }
         //echo '<PRE>';print_r($ar);
         header('Content-type: text/javascript');
+        echo "Roo.namespace('Pman.I18n');";
         echo 'Pman.I18n.Data = ' .  json_encode($ar);
         exit;
         
index fd363ab..5f3dbde 100644 (file)
@@ -28,7 +28,7 @@
    "closable" : false,
    "resizable" : false,
    "haveProgress" : false,
-   "height" : 200,
+   "height" : 140,
    "$ uploadProgress" : "function()\n{\n    var dlg = this;\n   if (!dlg.haveProgress) {\n        Roo.MessageBox.progress(\"Uploading\", \"Uploading\");\n    }\n    \n    if (dlg.haveProgress == 2) {\n        // it's been closed elsewhere..\n        return;\n    }\n    if (dlg.uploadComplete) {\n        Roo.MessageBox.hide();\n        return;\n    }\n    \n    dlg.haveProgress = 1;\n\n    var uid = _this.form.findField('UPLOAD_IDENTIFIER').getValue();\n    new Pman.Request({\n        url : baseURL + '/Core/UploadProgress.php',\n        params: {\n            id : uid\n        },\n        method: 'GET',\n        success : function(res){\n            //console.log(data);\n            var data = res.data;\n            if (dlg.haveProgress == 2) {\n                // it's been closed elsewhere..\n                return;\n            }\n            \n            if (dlg.uploadComplete) {\n                Roo.MessageBox.hide();\n                return;\n            }\n                \n            if (data){\n                Roo.MessageBox.updateProgress(data.bytes_uploaded/data.bytes_total,\n                    Math.floor((data.bytes_total - data.bytes_uploaded)/1000) + 'k remaining'\n                );\n            } else {\n                Roo.MessageBox.updateProgress(1,\n                    \"Upload Complete - processing\"\n                );\n                return;\n            }\n            dlg.uploadProgress.defer(2000,dlg);\n        },\n        failure: function(data) {\n          //  console.log('fail');\n         //   console.log(data);\n        }\n    })\n    \n}\n",
    "items" : [
     {
index b13eec9..8f1ebac 100644 (file)
@@ -42,7 +42,7 @@ Pman.Dialog.Image = {
     closable : false,
     collapsible : false,
     haveProgress : false,
-    height : 200,
+    height : 140,
     modal : true,
     resizable : false,
     shadow : true,