コード例 #1
0
    public function content($key, $type, array $arguments = array(), $default='') {

        $debugmessage = '';

        if ($this->env->isDebug()) {
            $debugmessage .= "<!--debug IbrowsSimpleCMS\n";
            $debugmessage .= "type=$type \n";
            $debugmessage .= "key=$key \n";
            $debugmessage .= "default=$default \n";
            $debugmessage .= "arguments=" . print_r($arguments, true) . " \n";
            $debugmessage .= '-->';

            if ($default == '') {
                $default = "$key-$type";
            }
        }

        $obj = $this->manager->find($type, $key);
        if ($obj) {
            $out = $debugmessage . $obj->toHTML($this, $arguments);
        } else {
            $out = $default;
        }


        
        $grant = $this->handler->isGranted('ibrows_simple_cms_content_edit_key', array('key'=> $key,'type'=>$type ));
        //$grant = $this->handler->isGranted('ibrows_simple_cms_content');
        if(!$grant){
          return $out;
        }
        

        return $this->wrapOutputForEdit($out, $key, $type, $arguments, $default);
    }
コード例 #2
0
 public function isGranted($key, $type)
 {
     $grant = $this->handler->isGranted('ibrows_simple_cms_content');
     if ($grant) {
         $grant = $this->handler->isGranted('ibrows_simple_cms_content_edit_key', array('key' => $key, 'type' => $type));
     }
     return $grant;
 }