• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • Examples
  • File List

E:/E/GEAMP/www/openbiz/openbiz/others/ZendX/JQuery/View/Helper/ColorPicker.php

00001 <?php
00026 require_once "ZendX/JQuery/View/Helper/UiWidget.php";
00027 
00037 class ZendX_JQuery_View_Helper_ColorPicker extends ZendX_JQuery_View_Helper_UiWidget
00038 {
00049     public function colorPicker($id, $value='', array $params=array(), array $attribs=array())
00050     {
00051            $attribs = $this->_prepareAttributes($id, $value, $attribs);
00052 
00053            if(strlen($value) >= 6) {
00054                $params['color'] = $value;
00055            }
00056 
00057            if(count($params) > 0) {
00058             $params = ZendX_JQuery::encodeJson($params);
00059            } else {
00060                $params = "{}";
00061            }
00062 
00063         $js = sprintf('%s("#%s").colorpicker(%s);',
00064             ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(),
00065             $attribs['id'],
00066             $params
00067         );
00068 
00069         $this->jquery->addOnLoad($js);
00070 
00071            return $this->view->formText($id, $value, $attribs);
00072     }
00073 }

Generated on Thu Apr 19 2012 17:01:15 for openbiz by  doxygen 1.7.2