|
@@ -3,6 +3,7 @@
|
|
|
namespace Poster\Lib;
|
|
|
|
|
|
use Dever;
|
|
|
+use Dever\Support\Img as Handle;
|
|
|
|
|
|
class Manage
|
|
|
{
|
|
@@ -27,6 +28,28 @@ class Manage
|
|
|
return $id;
|
|
|
}
|
|
|
|
|
|
+ public function template()
|
|
|
+ {
|
|
|
+ $id = Dever::input('search_option_template_id');
|
|
|
+
|
|
|
+ $info = Dever::db('poster/template')->find($id);
|
|
|
+
|
|
|
+ if ($info['create'] == 1) {
|
|
|
+
|
|
|
+ $filename = 'background_' . $info['id'];
|
|
|
+ $file = Dever::pathDay('upload/poster', false) . $filename . '.jpg';
|
|
|
+ $img = new Handle();
|
|
|
+ $img->create($file, $info['width'], $info['height'], 1);
|
|
|
+ $info['background'] = Dever::pic($file);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $info['background'] = "background-image:url('".$info['background']."');";
|
|
|
+
|
|
|
+ return $info;
|
|
|
+ }
|
|
|
+
|
|
|
public function model()
|
|
|
{
|
|
|
$where['template_id'] = Dever::input('search_option_template_id');
|
|
@@ -37,8 +60,9 @@ class Manage
|
|
|
foreach ($data as $k => $v) {
|
|
|
$data[$k]['content'] = '';
|
|
|
$data[$k]['style'] = 'display:none;position:absolute;';
|
|
|
-
|
|
|
+
|
|
|
if ($v['type'] == 1) {
|
|
|
+
|
|
|
$data[$k]['content'] = '<img src="'.$v['value_pic'].'" style="width: '.$v['width'].'px;height:'.$v['height'].'px;">';
|
|
|
$data[$k]['style'] .= 'width: '.$v['width'].'px;height:'.$v['height'].'px;';
|
|
|
} else {
|
|
@@ -46,7 +70,7 @@ class Manage
|
|
|
$v['value'] = $v['name'];
|
|
|
}
|
|
|
$data[$k]['content'] = $v['value'];
|
|
|
-
|
|
|
+ $data[$k]['style'] .= 'width: '.$v['text_width'].'px;';
|
|
|
|
|
|
if ($v['color']) {
|
|
|
$data[$k]['style'] .= 'color:' . $v['color'] . ';';
|
|
@@ -61,8 +85,13 @@ class Manage
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ $edit_link = Dever::url('project/database/update&project=poster&table=model&where_id=' . $v['id'], 'manage');
|
|
|
+ $del_link = Dever::url('database.delete_action&project=poster&table=model&where_id=' . $v['id'], 'manage');
|
|
|
+
|
|
|
+ $data[$k]['content'] .= '<ul class="custom-context-menu hidden"><li class="edit" onclick="fastEdit($(this), \''.$edit_link.'\', \'编辑\', \'\')">编辑</li><li class="del" onclick="del_act(\''.$del_link.'\')">删除</li></ul>';
|
|
|
+
|
|
|
$p = explode(',', $v['position']);
|
|
|
- $data[$k]['style'] .= 'left:'.$p[0].'px;top:'.$p[1].'px;';
|
|
|
+ $data[$k]['style'] .= 'left:'.$p[0].'px;top:'.$p[1].'px;';
|
|
|
}
|
|
|
}
|
|
|
|