Retab file
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 20 May 2015 13:09:41 +0000 (09:09 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 20 May 2015 13:09:41 +0000 (09:09 -0400)
no tabs only spaces

Toolkit/Videos/AdminEditVideoForm.php

index 0977087..d421e0b 100644 (file)
 class Toolkit_Videos_AdminEditVideoForm
     extends Toolkit_FormBuilder
 {
-       /**
-        * What do you want the success msg to be if the form validates successfully
-        *
-        * @var string
-        * @access protected
-        */
-       protected $successMsg
-               = '<div id="form-success-top">Coupon successfully updated.</div>';
+        /**
+     * What do you want the success msg to be if the form validates successfully
+     *
+     * @var string
+     * @access protected
+     */
+    protected $successMsg
+        = '<div id="form-success-top">Coupon successfully updated.</div>';
 
-       /**
-        * The default rules to register for validating
-        *
-        * We have to register these rules, or any others we want, before
-        * we are able to use them in our forms.
-        *
-        * @var string
-        * @access protected
-        */
-       protected $registeredRules = array(
-               array(
-                       'checkURI',
-                       'callback',
-                       'uri',
-                       'Validate'
-               )
-       );
+    /**
+     * The default rules to register for validating
+     *
+     * We have to register these rules, or any others we want, before
+     * we are able to use them in our forms.
+     *
+     * @var string
+     * @access protected
+     */
+    protected $registeredRules = array(
+        array(
+            'checkURI',
+            'callback',
+            'uri',
+            'Validate'
+        )
+    );
     public $errorMsg = '
         <div id="form-warning-top">There was a Problem with your form!</div>';
 
@@ -99,7 +99,7 @@ class Toolkit_Videos_AdminEditVideoForm
      * @return void
      */
     public function configureElements(PDO $dbh, Config_Container $c)
-       {
+    {
         $e = array();
 
         //  get reference to [conf] section of config file
@@ -109,12 +109,12 @@ class Toolkit_Videos_AdminEditVideoForm
             ->getContent();
         // All Elements are created here.
         // This includes group element definitions.
-               $e[] = array(
+        $e[] = array(
             'type' => 'advcheckbox',
             'req' => false,
             'name' => 'active',
-                       'display' => 'Active',
-                       'val' => array(0, 1)
+            'display' => 'Active',
+            'val' => array(0, 1)
         );
         if ($appHasFeaturedVideos) {
             $e[] = array(
@@ -132,17 +132,17 @@ class Toolkit_Videos_AdminEditVideoForm
             );
         }
         $e[] = array(
-               'type' => 'text',
-               'req' => true,
-               'name' => 'video_url',
-               'display' => 'Video Link<br>
+            'type' => 'text',
+            'req' => true,
+            'name' => 'video_url',
+            'display' => 'Video Link<br>
                 <span style="color:blue">
                 Click on the \'Share\' function on the YouTube video
                 <br>to get your link. If you\'re having problems click on "show options"
                 and select "long link"</span>',
-               'opts' => array('class' => 'text','size'=>50)
+        'opts' => array('class' => 'text','size'=>50)
         );
-               $e[] = array(
+        $e[] = array(
             'type' => 'submit',
             'req' => false,
             'name' => 'submit_rmv',
@@ -159,8 +159,8 @@ class Toolkit_Videos_AdminEditVideoForm
             );
         }
 
-               $this->setupElements($e);
-       }
+        $this->setupElements($e);
+    }
 
     /**
      * Setup Form filters
@@ -168,19 +168,19 @@ class Toolkit_Videos_AdminEditVideoForm
      * @return void
      */
     public function configureFilters()
-       {
+    {
         $f   = array();
-               $f[] = array(
+        $f[] = array(
             'element' => '__ALL__',
             'filter' => 'trim'
         );
         $f[] = array(
             'element' => 'url',
-                       'filter' => array('Toolkit_Common', 'filterURI')
+            'filter' => array('Toolkit_Common', 'filterURI')
         );
 
-               $this->setupFilters($f);
-       }
+        $this->setupFilters($f);
+    }
 
     /**
      * Runs all function to setup the Form
@@ -191,15 +191,15 @@ class Toolkit_Videos_AdminEditVideoForm
      * @return void
      */
     public function configureForm(
-               PDO $dbh,
-               Config_Container $c
-       ) {
-               $this->configureElements($dbh, $c);
-               $this->configureFilters();
-               $this->configureRules();
-               $this->configureDefaults($dbh);
-               $this->configureConstants();
-       }
+        PDO $dbh,
+        Config_Container $c
+    ) {
+        $this->configureElements($dbh, $c);
+        $this->configureFilters();
+        $this->configureRules();
+        $this->configureDefaults($dbh);
+        $this->configureConstants();
+    }
 
     /**
      * Setup the Form's rules
@@ -207,25 +207,25 @@ class Toolkit_Videos_AdminEditVideoForm
      * @return void
      */
     public function configureRules()
-       {
+    {
         $r = array();
 
-               $r[] = array(
-                       'element'    => 'video_url',
-                       'message'    => 'ERROR: Invalid URL format (http)',
-                       'type'       => 'checkURI',
-                       'format'     => array(
-                               'allowed_schemes' => array('http'),
-                               'strict' => false
-                       ),
-                       'validation' => $this->validationType,
-                       'reset'      => false,
-                       'force'      => false
-               );
+        $r[] = array(
+            'element'    => 'video_url',
+            'message'    => 'ERROR: Invalid URL format (http)',
+            'type'       => 'checkURI',
+            'format'     => array(
+                'allowed_schemes' => array('http'),
+                'strict' => false
+            ),
+            'validation' => $this->validationType,
+            'reset'      => false,
+            'force'      => false
+        );
 
 
-               $this->setupRules($r);
-       }
+        $this->setupRules($r);
+    }
 
     /**
      * _processData function creates an video object Toolkit_Videos_Video
@@ -287,23 +287,23 @@ class Toolkit_Videos_AdminEditVideoForm
             }
         }
 
-               $this->setupRenderers();
-               if ($this->validate()) {
-                       $this->cleanForm();
+        $this->setupRenderers();
+        if ($this->validate()) {
+            $this->cleanForm();
 
-                       $submitValues = $this->getSubmitValues();
-                       if ($this->_processData($dbh, $submitValues)) {
-                               $this->freeze();
-                               $output = $this->successMsg;
-                       }
+            $submitValues = $this->getSubmitValues();
+            if ($this->_processData($dbh, $submitValues)) {
+                $this->freeze();
+                $output = $this->successMsg;
+            }
             header('Location: videos.php');
-               } elseif ($this->isSubmitted()) {
-                       $output  = $this->errorMsg;
-                       $output .= parent::toHTML();
-               } else {
-                       $output = parent::toHTML();
-               }
-               return $output;
-       }
+        } elseif ($this->isSubmitted()) {
+            $output  = $this->errorMsg;
+            $output .= parent::toHTML();
+        } else {
+            $output = parent::toHTML();
+        }
+        return $output;
+    }
 
 }