dever 6 years ago
parent
commit
63cb68c43e
3 changed files with 62 additions and 15 deletions
  1. 43 12
      content/database/article.php
  2. 3 3
      data/compile/wonderful/upload/show.cmp.php
  3. 16 0
      video/lib/Core.php

+ 43 - 12
content/database/article.php

@@ -153,18 +153,6 @@ return array
 			//'list'		=> true,
 		),
 
-		'content'		=> array
-		(
-			'type' 		=> 'text-255',
-			'name' 		=> '内容',
-			'default' 	=> '',
-			'desc' 		=> '请输入内容',
-			'match' 	=> 'is_string',
-			'update'	=> 'editor',
-			'key' 		=> 1,
-			'media'		=> 5,
-		),
-
 		'state'		=> array
 		(
 			'type' 		=> 'tinyint-1',
@@ -222,6 +210,49 @@ return array
 			'desc' 		=> '',
 		),
 
+		'content'		=> array
+		(
+			'type' 		=> 'text-255',
+			'name' 		=> '内容',
+			'default' 	=> '',
+			'desc' 		=> '请输入内容',
+			'match' 	=> 'is_string',
+			'update'	=> 'editor',
+			//自定义编辑器右侧按钮
+			'editor'	=> array
+			(
+				'name' => '选择插入模块',
+				'button' => array
+				(
+					array
+					(
+						# 名称
+						'name' => '图片',
+						# 资源库id
+						'key' => 1,
+						# 类型
+						'type' => 'image',
+					),
+					array
+					(
+						'name' => '音频',
+						'key' => 2,
+						'type' => 'media',
+					),
+					array
+					(
+						'name' => '视频',
+						'key' => 'video/lib/core.vod',
+					),
+					array
+					(
+						'name' => '直播',
+						'key' => 'video/lib/core.live',
+					),
+				),
+			),
+		),
+
 		'cdate'		=> array
 		(
 			'type' 		=> 'int-11',

+ 3 - 3
data/compile/wonderful/upload/show.cmp.php

@@ -27,10 +27,10 @@
 
 <div class="layui-card"  id="component-anim">
   <div class="layui-card-header">
-  	<input type="hidden" class="file_key" value="<?php  echo $config['id'] ?>">
+  	<input type="hidden" class="file_key" value="<?php  echo $key ?>">
   	<input type="hidden" class="file_pg" value="<?php  echo $search_pg ?>">
   	<input type="hidden" class="file_cur" value="<?php  echo $cur ?>">
-  	<div class="layui-inline"><div class="layui-input-inline"><input type="text" style="width: 100%;" class="layui-input file_filename" value="<?php  echo $search_name ?>" autocomplete="new-password" placeholder="文件名"></div></div>
+  	<div class="layui-inline"><div class="layui-input-inline"><input type="text" style="width: 100%;" class="layui-input file_filename" value="<?php  echo $search_name ?>" autocomplete="new-password" placeholder="<?php  echo $name ?>"></div></div>
 
   	<div class="layui-inline" style="display: none;"><div class="layui-input-inline"><input type="text" style="width: 100%;"  class="layui-input file_tag" value="<?php  echo $search_tag ?>" autocomplete="new-password" placeholder="标签"></div></div>
 
@@ -48,7 +48,7 @@
     <ul class="component-anim-demo">
     	<?php if(isset($file) && is_array($file)): foreach($file as $k1 => $v1): ?>
       <li class="<?php if(strstr($cur, $v1['url'])): ?>layui-anim-yes<?php else: ?>layui-anim-no<?php endif ?>">
-        <div class="layui-anim" data-anim="layui-anim-up" onclick="showUploadFilesSet($(this), '<?php  echo $v1['name'] ?>','<?php  echo $v1['url'] ?>')"><img src="<?php  echo $v1['pic'] ?>" style="max-width: 150px;max-height: 100px;margin-left: 10px;"/></div>
+        <div class="layui-anim" data-anim="layui-anim-up" onclick="showUploadFilesSet($(this), '<?php  echo $v1['name'] ?>','<?php  echo $v1['url'] ?>','<?php  echo $v1['id'] ?>')"><img src="<?php  echo $v1['pic'] ?>" style="max-width: 150px;max-height: 100px;margin-left: 10px;"/></div>
         <div class="code"><?php  echo $v1['source_name'] ?></div>
       </li>
       <?php endforeach;endif; ?>

+ 16 - 0
video/lib/Core.php

@@ -0,0 +1,16 @@
+<?php
+namespace Video\Lib;
+
+use Dever;
+
+class Core
+{
+	public function vod()
+    {
+    	$data['name'] = '视频';
+        $data['file'] = Dever::db('video/vod')->list();
+        $data['cate'] = Dever::db('content/cate')->state();
+
+        return $data;
+    }
+}