]> git.andy128k.dev Git - ipf.git/commitdiff
small issues
authoravl <alex.litovchenko@gmail.com>
Thu, 21 Aug 2008 13:16:02 +0000 (16:16 +0300)
committeravl <alex.litovchenko@gmail.com>
Thu, 21 Aug 2008 13:16:02 +0000 (16:16 +0300)
ipf/admin/views.php
ipf/context.php
ipf/form/model.php
ipf/form/widget/image.php
ipf/form/widget/selectinput.php
ipf/http/response/notfound.php

index e6fe5aaa54e3bd825f6d86593b8fdad087255d63..f951c5293992102570a85210c64605d6f2adf87a 100644 (file)
@@ -170,6 +170,7 @@ function IPF_Admin_Views_ChangePassword($request, $match){
 
 
 function IPF_Admin_Views_Login($request, $match){
+    $success_url = '';
     if (!empty($request->REQUEST['next']))
         $success_url = $request->REQUEST['next'];
     if (trim($success_url)=='')
index ad86528b46469866d1986b2c775e7e75fb2991c2..86af69846435abc45fa366120aad02fff7da8d9e 100644 (file)
@@ -19,3 +19,8 @@ function IPF_Context_Version($request)
 {
     return array('IPF_VER' => IPF_Version::$name);
 }
+
+function IPF_Context_Upload($request)
+{
+    return array('UPLOAD_URL' => IPF::get('upload_url'));
+}
index 4ddb1a1a6f0da5147b484a4459f12097757de701..bd24198dbc99a4a84e4f980b40ccfdff556e9d05 100644 (file)
@@ -28,8 +28,7 @@ class IPF_Form_Model extends IPF_Form
         else{
             foreach($user_fields as $uname){
                 $add_method = 'add__'.$uname.'__field';
-                if (method_exists($this->model,$add_method)){
-                    //print $add_method;
+                if (method_exists($this,$add_method)){
                     $this->$add_method();
                     continue;
                 }
index 15ad5d930e8f0382905f93ff7b2f0d8aa2c0d128..e2c3040a9bfc57c5c9043c82ba1e953db39e4749 100644 (file)
@@ -4,6 +4,7 @@ class IPF_Form_Widget_Image extends IPF_Form_Widget_FileInput
 {
     public function render($name, $value, $extra_attrs=array())
     {
+        $sim = '';
         if ($value!='')
             $sim = 'Currently: <a target="_blank" href="'.IPF::get('upload_url').$value.'">'.$value.'</a><br />Change:';
         $value = '';
index 12b461e513a49df842c344a00e13ab25937da91a..67c3ed27d80702b9d094bf3570f292e36711db9e 100644 (file)
@@ -6,8 +6,10 @@ class IPF_Form_Widget_SelectInput extends IPF_Form_Widget
 
     public function __construct($attrs=array())
     {
-        $this->choices = $attrs['choices'];
-        unset($attrs['choices']);
+        if (isset($attrs['choices'])){
+            $this->choices = $attrs['choices'];
+            unset($attrs['choices']);
+        }
         parent::__construct($attrs);
     }
 
index e23a826eeca34fab846929e0c382b1b7677471fd..4abbd24130d1d5d2a964d5a47c2ea1cd7d67f762 100644 (file)
@@ -2,7 +2,7 @@
 
 class IPF_HTTP_Response_NotFound extends IPF_HTTP_Response
 {
-    function __construct($content='Not Found', $mimetype=null)
+    function __construct($content='404 Not Found', $mimetype=null)
     {
         parent::__construct($content, $mimetype);
         $this->status_code = 404;