Esempio n. 1
0
 public function build($name, $value = null, $attribs = null, $disable = false)
 {
     //$info = $this->_getInfo($name, $value, $attribs);
     //extract($info); // name, value, attribs, options, listsep, disable
     // build the element
     if ($disable) {
         // disabled
         $xhtml = $this->_hidden($name, $value) . htmlspecialchars($value);
     } else {
         // enabled
         $id = "dingdan_selector_" . $name;
         $attribs["id"] = $id;
         $sitePath = Pft_Config::getSiteRoot();
         $xhtml = $this->_getCommonHtml();
         $xhtml .= Pft_View_Helper::buildElmentByVartype("C", $name, $value, $attribs);
         //echo "<script>alert('aa');</script>";
         /*
                     $xhtml = '<input type="text"'
                            . ' name="' . htmlspecialchars($name) . '"'
                            . ' value="' . htmlspecialchars($value) . '"'
                            . $this->_htmlAttribs($attribs)
                            . ' />';*/
         $xhtml .= '<a href="#" class="btn" type="button" id="btnSelectCr" onclick="ddSelTool.show(  \'' . $attribs["id"] . '\', this,\'\',\'s0=\'+document.all.' . $name . '.value+\'\' );return false;">' . i18ntrans('#选') . '</a>';
     }
     return $xhtml;
 }
Esempio n. 2
0
 public function build($name, $value = null, $attribs = null, $disable = false)
 {
     //$info = $this->_getInfo($name, $value, $attribs);
     //extract($info); // name, value, attribs, options, listsep, disable
     // build the element
     if ($disable) {
         // disabled
         $xhtml = $this->_hidden($name, $value) . htmlspecialchars($value);
     } else {
         // enabled
         if (!isset($attribs["id"])) {
             $id = "person_selector_" . $name;
             $attribs["id"] = $id;
         }
         if (!isset($attribs["onclick"])) {
             $attribs["onclick"] = 'userSelTool.show( null, \'' . $attribs["id"] . '\', this, \'' . @$attribs["param"] . '\' );return false;';
             if (!isset($attribs["style"])) {
                 $attribs["style"] = 'cursor:pointer;';
             }
         }
         $sitePath = Pft_Config::getSiteRoot();
         $xhtml = $this->_getCommonHtml();
         $xhtml .= Pft_View_Helper::buildElmentByVartype("C", $name, $value, $attribs);
         /*
                     $xhtml = '<input type="text"'
                            . ' name="' . htmlspecialchars($name) . '"'
                            . ' value="' . htmlspecialchars($value) . '"'
                            . $this->_htmlAttribs($attribs)
                            . ' />';*/
         $xhtml .= '<a href="#" class="btn" type="button" id="btnSelectCr" onclick="userSelTool.show( null, \'' . $attribs["id"] . '\', this, \'' . @$attribs["param"] . '\' );return false;">' . i18ntrans('#选') . '</a>';
     }
     return $xhtml;
 }
Esempio n. 3
0
    /**
     * 使用yui-ext建立TableGrid
     * 
     * <code>
     * $grid->showMe( array('gridId'=>'sql_grid') );
     * Pft_View_Helper_Ext::buildTableGrid( 'sql_grid' );
     * </code>
     *
     * @param string $gridId grid的ID
     */
    public static function buildTableGrid($gridId)
    {
        if (!self::$_loadedTableGridLib) {
            ?>
<script src="<?php 
            echo Pft_Config::getSiteRoot();
            ?>
js/ext-1.0/tpm/TableGrid.js"></script>
<?php 
            self::$_loadedTableGridLib = true;
        }
        ?>
<script>
/*
 * Ext JS Library 1.0
 * Copyright(c) 2006-2007, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://www.extjs.com/license
 */
Ext.onReady(function() {
	// create the grid
    var grid = new Ext.grid.TableGrid('<?php 
        echo $gridId;
        ?>
');
    grid.render();
});
</script>
<?php 
    }
Esempio n. 4
0
    public function build($name, $value = null, $attribs = null, $disable = false)
    {
        //$info = $this->_getInfo($name, $value, $attribs);
        //extract($info); // name, value, attribs, options, listsep, disable
        // build the element
        if ($disable) {
            // disabled
            $xhtml = $this->_hidden($name, $value) . htmlspecialchars($value);
        } else {
            // enabled
            if (!isset($attribs['id'])) {
                $id = "date" . mt_rand(1000, 9999);
                $attribs["id"] = $id;
            } else {
                $id = $attribs["id"];
            }
            $sitePath = Pft_Config::getSiteRoot();
            $xhtml = Pft_View_Helper::buildElmentByVartype("C", $name, $value, $attribs);
            $xhtml .= $this->_getCommonHtml();
            /*
                        $xhtml = '<input type="text"'
                               . ' name="' . htmlspecialchars($name) . '"'
                               . ' value="' . htmlspecialchars($value) . '"'
                               . $this->_htmlAttribs($attribs)
                               . ' />';*/
            $xhtml .= <<<EOT
<img id="dateButton_{$id}" src="{$sitePath}js/john/jscalendar/calendar.gif" border="0" align="absmiddle" style="cursor:pointer" />
<!--<input   name="start_date[{\$i}]" type="text" class="Input1" id="start_date[{\$i}]" value="{\$start_mren}" size="14" readonly/>-->
<script type="text/javascript">
    Calendar.setup({
        inputField     :    "{$id}",
EOT;
            if ($this->_showTimes) {
                $xhtml .= '
        ifFormat       :    "%Y-%m-%d %H:%M",
        showsTime      :    true,';
            } else {
                if ($this->_showTimeSecs) {
                    $xhtml .= '
        ifFormat       :    "%Y-%m-%d %H:%M:%S",
        showsTime      :    true,';
                } else {
                    $xhtml .= '
        ifFormat       :    "%Y-%m-%d",';
                }
            }
            $xhtml .= <<<EOT
        button         :    "dateButton_{$id}",
        singleClick    :    true,
        step           :    1
    });
</script>
EOT;
            /* $xhtml .= <<<EOT
                    <img id="dateButton_{$id}" src="{$sitePath}js/john/jscalendar/calendar.gif" border="0" align="absmiddle" style="cursor:pointer" onClick="Calendar.setDayHM(document.getElementById({$id}),0,'');"/>       
            EOT;*/
        }
        return $xhtml;
    }
Esempio n. 5
0
 function __construct()
 {
     $this->_menu_lib_path = Pft_Config::getSiteRoot(1) . 'js/jsmenu/';
 }
Esempio n. 6
0
 function __construct()
 {
     $this->_selector_lib_path = Pft_Config::getSiteRoot() . 'js/tpm/';
 }
Esempio n. 7
0
 /**
  * john 添加
  * 生成文件再下载的方法(改变路径)
  * 2007-4-10
  *
  * @param unknown_type $array
  * @param unknown_type $csv_name
  */
 public static function ExportToCsvPath($array, $csv_name = false, $path = false)
 {
     if ($path) {
         $rootpath = $path;
     } else {
         $rootpath = Pft_Config::getUploadPath();
     }
     $str = "";
     if (!$csv_name) {
         $csv_name = 'dingdanbaobiao' . date('-ymd-Hi', time());
     } else {
         $csv_name = $csv_name . date('-ymd-Hi', time());
     }
     if (is_array($array)) {
         $jc = current($array);
         if (is_array($jc)) {
             foreach ($array as $key => $value) {
                 $str .= self::_outcsv($value) . "\r\n";
             }
         } else {
             $str = self::_outcsv($array) . "\r\n";
         }
     }
     $file = $rootpath . $csv_name . ".csv";
     $handle = fopen($file, 'w+');
     fputs($handle, $str);
     fclose($handle);
     //$path=$rootpath.$csv_name.".csv";
     $path = Pft_Config::getSiteRoot() . "upload/res/error/" . $csv_name . ".csv";
     return $path;
     /*if($str!="")
     		{
     			
     		$file1 = fopen($file,"rb"); // 打开文件 
       
     		// 输入文件标签
     		//ob_clean();		
     		header("Content-Type:application/octet-stream");
     		//header('Content-type: application/csv');
     		header("Accept-Ranges:bytes");
     		
     		header("Accept-Length:".filesize($file));
     		
     		header('Content-Disposition:attachment;filename='.$csv_name.'.csv');
     		//header('Content-Description: PHP3 Generated Data');
     
     		// 输出文件内容
     		
     		echo  fread($file1,filesize($file));
     		
     		fclose($file1);
     		
     		exit;
     		}*/
 }