/**
  * Renders the rich text editor.
  * @param string $name
  * @param string $value
  */
 function Render($name, $value = '')
 {
     $baseUrl = $this->baseUrl;
     $grantResult = $this->guard->Grant(Action::UseIt(), $this);
     $disabled = (string) $grantResult != (string) GrantResult::Allowed();
     $_SESSION['KCFINDER']['disabled'] = $disabled;
     $_SESSION['KCFINDER']['uploadURL'] = $this->uploadUrl;
     $_SESSION['KCFINDER']['uploadDir'] = $this->uploadDir;
     $oCKeditor = new \CKEditor();
     $oCKeditor->basePath = IO\Path::Combine($baseUrl, 'ckeditor/');
     $oCKeditor->config['skin'] = 'v2';
     $oCKeditor->config['filebrowserBrowseUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/browse.php?type=files');
     $oCKeditor->config['filebrowserImageBrowseUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/browse.php?type=images');
     $oCKeditor->config['filebrowserFlashBrowseUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/browse.php?type=flash');
     $oCKeditor->config['filebrowserUploadUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/upload.php?type=files');
     $oCKeditor->config['filebrowserImageUploadUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/upload.php?type=images');
     $oCKeditor->config['filebrowserFlashUploadUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/upload.php?type=flash');
     foreach ($this->config as $key => $val) {
         $oCKeditor->config[$key] = $val;
     }
     ob_start();
     echo '<div class="phine-cke">';
     $oCKeditor->editor($name, $value);
     echo '</div>';
     return ob_get_clean();
 }
 /**
  * Renders the content
  * @return string Returns the rendered content
  */
 function Render()
 {
     if (!self::Guard()->Allow(Action::Read(), $this->content)) {
         return '';
     }
     ContentTranslator::Singleton()->SetContent($this->content);
     $module = ClassFinder::CreateFrontendModule($this->content->GetType());
     $module->SetTreeItem($this->tree, $this->item);
     return $module->Render();
 }
Exemple #3
0
 private function PageAllowed(Page $page)
 {
     if ($page->GetType() != (string) PageType::Normal() || $page->GetSitemapRelevance() == 0) {
         return false;
     }
     return $this->guard->Allow(Action::Read(), $page);
 }
Exemple #4
0
 protected function BeforeRemove(TableObject $deleteObject)
 {
     $logger = new Logger(self::Guard()->GetUser());
     $logger->ReportMemberAction($deleteObject, Action::Delete());
 }
Exemple #5
0
 public function Grant(Action $action, $onObject)
 {
     if (!$this->GetUser()) {
         return GrantResult::LoginRequired();
     }
     if ($onObject instanceof User) {
         return $this->GrantOnUser($action, $onObject);
     }
     if ($this->IsAdministrator()) {
         return GrantResult::Allowed();
     }
     if ($onObject instanceof Site) {
         if (!$onObject->Exists() && (string) $action == (string) Action::Create()) {
             return $this->GrantCreateSite();
         }
         return $this->GrantOnSite($onObject, $action);
     } else {
         if ($onObject instanceof Page) {
             return $this->GrantOnPage($onObject, $action);
         } else {
             if ($onObject instanceof Container) {
                 if (!$onObject->Exists() && (string) $action == (string) Action::Create()) {
                     return $this->GrantCreateContainer();
                 }
                 return $this->GrantOnContainer($onObject, $action);
             } else {
                 if ($onObject instanceof Area) {
                     return $this->GrantOnArea($onObject, $action);
                 } else {
                     if ($onObject instanceof Layout) {
                         if (!$onObject->Exists() && (string) $action == (string) Action::Create()) {
                             return $this->GrantCreateLayout();
                         }
                         return $this->GrantOnLayout($onObject, $action);
                     } else {
                         if ($onObject instanceof Content) {
                             return $this->GrantOnContent($onObject, $action);
                         } else {
                             if ($onObject instanceof ModuleBase) {
                                 return $this->GrantOnModule($onObject);
                             }
                         }
                     }
                 }
             }
         }
     }
     return GrantResult::NoAccess();
 }