Explorar el Código

photo verifed

amic hace 2 meses
padre
commit
2346d5a16f

+ 1 - 0
models/News.php

@@ -187,6 +187,7 @@ class News extends \app\models\base\News
 	{
 		if( $this->inscription) return true;
 		if( isset( $this->photo_title ) && stripos($this->photo_title, 'amic.ru') !== false ) return true;
+		if( $this->isAmicPhoto() ) return true;
 		if( $dt_pub ){
 			$dt_pub = strtotime($dt_pub);
 		}else{

+ 5 - 0
models/base/News.php

@@ -300,6 +300,11 @@ class News extends BaseFrontendClass
         return $this->hasMany(StoryRelation::class,['news_id'=>'id']);
     }
 
+    public function isAmicPhoto()
+    {
+        return (bool) ($this->flags & 2);
+    }
+
     /**
      * @return \yii\db\ActiveQuery
      */

+ 1 - 0
modules/manager/controllers/NewsController.php

@@ -381,6 +381,7 @@ class NewsController extends BaseController
 		$post['editors'] = $post['editors'].(($post['editors'])?',':'').$profile->name;
 		$post['photo_name'] = isset($post['photo_name'])?$post['photo_name']:'';
 		$post['flags'] = isset($post['nofirst'])?1:0;
+		$post['flags'] = $post['flags'] | (isset($post['photoamic'])?2:0);
 
 		return $post;
 	}

+ 6 - 0
modules/manager/views/default/formNews.php

@@ -85,6 +85,7 @@ $news->fdzen = ($news['export_rss'] & 1)?'Y':'N';
 $news->fmail = ($news['export_rss'] & 2)?'Y':'N';
 
 $nofirst = ($news->flags & 1);
+$photoamic = ($news->flags & 2);
 
 
 if( isset($uuid) )
@@ -391,6 +392,11 @@ echo $form->field($news, 'title')->textInput([
 				<input type="checkbox" name="News[audio]" id="fcont3" class="custom-control-input"<?=($news->audio == 'Y')?' checked':''?> value="Y">
 				<label class="custom-control-label" for="fcont3"><i class="fa fa-headphones"></i> C аудио материалом</label>
 			</div>
+			<div class="custom-control custom-checkbox custom-control-inline">
+				<input type="checkbox" id="photoamic" name="News[photoamic]" class="custom-control-input"<?=($photoamic)?' checked':''?> value="Y">
+				<label class="custom-control-label" for="photoamic"><i class="fa fa-hand-peace"></i> Проверенные фото</label>
+			</div>
+
 		</div>
 	</div>
 	<div class="card card-outline card-olive">