Beispiel #1
0
 function input_image($params)
 {
     $params['type'] = 'image';
     $ui = new base_component_ui($this);
     $domid = $ui->new_dom_id();
     $input_name = $params['name'];
     $input_value = $params['value'];
     $image_src = base_storager::image_path($input_value, 's');
     if (!$params['width']) {
         $params['width'] = 50;
     }
     if (!$params['height']) {
         $params['height'] = 50;
     }
     $imageInputWidth = $params['width'] + 24;
     $url = ""index.php?app=desktop&act=alertpages&goto=" . urlencode("index.php?app=image&ctl=admin_manage&act=image_broswer") . """;
     $html = '<div class="image-input clearfix" style="width:' . $imageInputWidth . 'px;" gid="' . $domid . '">';
     $html .= '<div class="flt"><div class="image-input-view" style="display:table-cell;text-align:center;vertical-align: middle;width:';
     $html .= $params['width'] . 'px;height:' . $params['height'] . 'px;font-size:' . $params['height'] * 0.875 . 'px;overflow:hidden;">';
     $html .= '<img src="' . $image_src . '" onload="$(this).zoomImg(' . $params['width'] . ',' . $params['height'] . ');"/>';
     $html .= '</div></div>';
     $html .= '<div class="image-input-handle" onclick="new imgDialog(' . $url . ',{handle:this});" style="width:20px;height:' . $params['height'] . 'px;">选择' . $ui->img(array('src' => 'bundle/arrow-down.gif', 'app' => 'desktop'));
     $html .= '</div>';
     $html .= '<input type="hidden" name="' . $input_name . '" value="' . $input_value . '"/>';
     $html .= '</div>';
     return $html;
 }
Beispiel #2
0
 function input_image($params)
 {
     $params['type'] = 'image';
     $ui = new base_component_ui($this);
     $domid = $ui->new_dom_id();
     $input_name = $params['name'];
     $input_value = $params['value'];
     $image_src = base_storager::image_path($input_value, 's');
     if (!$params['width']) {
         $params['width'] = 50;
     }
     if (!$params['height']) {
         $params['height'] = 50;
     }
     $imageInputWidth = $params['width'] + 24;
     $url = "&quot;index.php?app=desktop&act=alertpages&goto=" . urlencode("index.php?app=image&ctl=admin_manage&act=image_broswer") . "&quot;";
     $html = '<div class="image-input clearfix" style="width:' . $imageInputWidth . 'px;" gid="' . $domid . '">';
     $html .= '<div class="flt"><div class="image-input-view" style="font-size:12px;text-align:center;width:';
     $html .= $params['width'] . 'px;line-height:' . $params['height'] . 'px;height:' . $params['height'] . 'px;overflow:hidden;">';
     if (!$image_src) {
         $image_src = app::get('desktop')->res_url . '/transparent.gif';
     }
     $html .= '<img src="' . $image_src . '" onload="$(this).zoomImg(' . $params['width'] . ',' . $params['height'] . ',function(mw,mh,v){this.setStyle(&quot;marginTop&quot;,(mh-v.height)/2)});"/>';
     $html .= '</div></div>';
     $html .= '<div class="image-input-handle" onclick="Ex_Loader(&quot;modedialog&quot;,function(){new imgDialog(' . $url . ',{handle:this});}.bind(this));" style="width:20px;height:' . $params['height'] . 'px;">' . app::get('desktop')->_('选择') . "" . $ui->img(array('src' => 'bundle/arrow-down.gif', 'app' => 'desktop'));
     $html .= '</div>';
     $html .= '<input type="hidden" name="' . $input_name . '" value="' . $input_value . '"/>';
     $html .= '</div>';
     return $html;
 }
Beispiel #3
0
 function create_remove()
 {
     $ui = new base_component_ui($this);
     return "<span style='margin:0 5px;cursor:pointer;float:left' onclick=\"\$(this).getParent('li').remove();\">" . $ui->img(array('src' => 'bundle/delecate.gif', 'app' => 'desktop')) . "</span>";
 }