Exemple #1
0
    /**
     * Helper main function
     * @param $actionsHtml String HTML code showing the action buttons
     * @param $content String The content of this element
     * @param $dbId Int DB id of the object
     * @param $order Int order of this item in the DB
     * @param $params Array parameters (if any)
     * @return String HTML to be inserted in the view
     */
    public function ContentFile($actionsHtml = '', $content = '', $dbId = 0, $order = 0, $params = array('level' => 1), $moduleName = 'adminpages', $pagstructureId = 0, $sharedInIds = '')
    {
        $eventsInfo = SafactivitylogOp::getAuthorNLastEditorForContent($dbId, $moduleName);
        $module = 'publicms';
        $params2 = array('mode' => 'filids', 'layout' => 'none', 'viewl' => 'list', 'noviewswitch' => 'Y', 'ids' => $content);
        $this->view->flist = array();
        $sql = '';
        $fltr = new Zend_Filter_Digits();
        if ($params2['mode'] == 'filids' && isset($params2['ids'])) {
            $ids = array();
            foreach (explode(',', $params2['ids']) as $id) {
                $ids[] = $fltr->filter($id);
            }
        }
        if (is_array($params) && isset($params['type']) && $params['type'] == "categories") {
            // Load the files id based on their category
            $linkedFiles = new FilfoldersFilfiles();
            $ids = array();
            foreach (preg_split('/,/', $content) as $category) {
                $ids[] = $linkedFiles->getFilfilesLinkedTo($category);
            }
        }
        $this->view->viewl = 'list';
        $this->view->noviewswitch = 'Y';
        $oFile = new Filfiles();
        $params2['flist'] = $oFile->getFileInfosByIdList($ids);
        $toret = '<li
                    class="' . $params['addClass'] . ' sydney_editor_li"
                    dbparams="' . $content . '"
                    type=""
                    editclass="files"
                    dbid="' . $dbId . '"
                    dborder="' . $order . '"
                    data-content-type="file-block"
                    pagstructureid="' . $pagstructureId . '"
                    sharedinids="' . $sharedInIds . '">
		' . $actionsHtml . '
			<div class="content">
				' . $this->view->partial('file/filelist.phtml', $module, $params2) . '
			</div>
			<p class="lastUpdatedContent sydney_editor_p">' . $eventsInfo['firstEvent'] . '<br />' . $eventsInfo['lastEvent'] . '</p>
		</li>';
        return $toret;
    }
Exemple #2
0
    /**
     * Helper main function
     * @param $actionsHtml String HTML code showing the action buttons
     * @param $content String The content of this element
     * @param $dbId Int DB id of the object
     * @param $order Int order of this item in the DB
     * @param $params Array parameters (if any)
     * @return String HTML to be inserted in the view
     */
    public function ContentText($actionsHtml = '', $content = '', $dbId = 0, $order = 0, $params = array(), $moduleName = 'adminpages', $pagstructureId = 0, $sharedInIds = '')
    {
        $eventsInfo = SafactivitylogOp::getAuthorNLastEditorForContent($dbId, $moduleName);
        $toReturn = '
            <li
                class="' . $params['addClass'] . ' sydney_editor_li"
                editclass="text"
                dbid="' . $dbId . '"
                data-content-type="text-block"
                dborder="' . $order . '"
                pagstructureid="' . $pagstructureId . '"
                sharedinids="' . $sharedInIds . '">
		' . $actionsHtml . '
		<div class="content clearfix2">
				' . $content . '
		</div>
		<p class="lastUpdatedContent sydney_editor_p">' . $eventsInfo['firstEvent'] . '<br />' . $eventsInfo['lastEvent'] . '</p>
		</li>';
        return $toReturn;
    }
    /**
     * Helper main function
     * @param $actionsHtml String HTML code showing the action buttons
     * @param $content String The content of this element
     * @param $dbId Int DB id of the object
     * @param $order Int order of this item in the DB
     * @param $params Array parameters (if any)
     * @return String HTML to be inserted in the view
     */
    public function ContentFreeText($actionsHtml = '', $content = '', $dbId = 0, $order = 0, $params = array('language' => 'php'), $moduleName = 'adminpages', $pagstructureId = 0, $sharedInIds = '')
    {
        $eventsInfo = SafactivitylogOp::getAuthorNLastEditorForContent($dbId, $moduleName);
        $secureContent = htmlspecialchars($content);
        $contentToDisplay = nl2br(htmlspecialchars(substr($content, 0, 200) . ' ...'));
        $toReturn = '<li class="' . $params['addClass'] . ' sydney_editor_li"
						type="' . $params['language'] . '"
                        data-content-type="plain-text-html-block"
						editclass="freetext"
						dbid="' . $dbId . '"
						dborder="' . $order . '"
						pagstructureid="' . $pagstructureId . '"
						sharedinids="' . $sharedInIds . '">
			' . $actionsHtml . '
			<div class="content">
				' . $contentToDisplay . '
			</div>
			<textarea id="textAreaFreeText" style="display:none;">' . $secureContent . '</textarea>
			<p class="lastUpdatedContent sydney_editor_p">' . $eventsInfo['firstEvent'] . '<br />' . $eventsInfo['lastEvent'] . '</p>
		</li>';
        return $toReturn;
    }
Exemple #4
0
 public function __construct($id = 0)
 {
     $this->_schema = Sydney_Tools_Sydneyglobals::getConf()->db->params->dbname;
     parent::__construct($id);
 }