Dotclear

Changeset 1090:ed55b73cde39


Ignore:
Timestamp:
12/20/12 23:43:13 (13 years ago)
Author:
JcDenis
Branch:
twig
Message:

Added support of id on forms

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/index.php

    r1089 r1090  
    154154     catch (Exception $e) { } 
    155155      
    156      $form = new dcForm($core,'quickentry','post.php'); 
     156     $form = new dcForm($core,array('quickentry','quick-entry'),'post.php'); 
    157157     $form 
    158158          ->addField( 
  • inc/admin/class.dc.form.php

    r1058 r1090  
    201201class dcForm 
    202202{ 
     203     protected $id; 
    203204     protected $name; 
    204205     protected $core; 
     
    218219     } 
    219220      
     221     protected function getNID($nid) 
     222     { 
     223          if (is_array($nid)) { 
     224               $this->name = $nid[0]; 
     225               $this->id = !empty($nid[1]) ? $nid[1] : null; 
     226          } 
     227          else { 
     228               $this->id = null; 
     229               $this->name = $nid; 
     230          } 
     231     } 
     232      
    220233     public function __construct($core,$name,$action,$method='POST') 
    221234     { 
    222235          $this->core = $core; 
    223           $this->name = $name; 
     236          $this->getNID($name); 
    224237          $this->method = $method; 
    225238          $this->action = $action; 
     
    260273     { 
    261274          echo sprintf( 
    262                '<form method="%s" action="%s">', 
     275               '<form%s method="%s" action="%s">', 
     276               empty($this->id) ? '' : ' id="'.$this->id.'"', 
    263277               $this->method, 
    264278               $this->action 
Note: See TracChangeset for help on using the changeset viewer.

Sites map