<?php

/* ========================================================================
 * $Id: view.php 1328 2020-05-19 16:34:54Z onez $
 * 
 * Email: www@onez.cn
 * QQ: 6200103
 * HomePage: http://www.onez.cn
 * ========================================================================
 * Copyright 2016-2017 佳蓝科技.
 * 
 * ======================================================================== */

!defined('IN_ONEZ') && exit('Access Denied');
# edit
#请求数据
if($MODE=='$post'){
  $id=onez()->gp('id');
  $action=onez()->gp('action');
  if($action=='data'){
    $key=onez()->gp('key');
    unset($_POST['action']);
    $_POST['_siteid']=(int)$G['site']['id'];
    $r=$G['this']->onezapi('view',array('key'=>$key,'post'=>$_POST));
    if($r['isRead']){
      $onezInfoFile=ONEZ_CACHE_PATH.'/plugins/'.$G['this']->token.'/infos/users/'.$G['userid'].'.php';
      @unlink($onezInfoFile);
    }
    if($r['uninstall']){
      $_r=$G['this']->uninstall($r['uninstall'],$G['site']['id']);
      $_r && $r=array_merge($r,$_r);
    }
    if($r['install']){
      $_r=$G['this']->install($r['install'],$G['site']['id']);
      $_r && $r=array_merge($r,$_r);
    }
    if($r['upgrade']){
      foreach($r['upgrade'] as $v){
        onez('fetch')->get($v,1);
      }
    }
    if(onez()->gp('ac')){
      return $r;
    }
    $A['html']=$r;
  }
  return;
}
$this->add(array(
  'type'=>'breadcrumb',
  'name'=>'面包屑导航',
  'data'=>'html',
));
?>
<section :class="html.classname">
  <template v-if="html.type=='record'">
    <component v-for="item in html.record" :is="item.type||'onez-html'" :data="item"></component>
  </template>
  <component v-else :is="html.type||'onez-html'" :data="html"></component>
</section>
