$error_info = t('You have no right to recover a deleted/shielded post by the administrator.'); } else { if ($user_rights[2] != 't' && $section_info['author_id'] != $curr_fse_id) { $error_info = t('You have no right to recover the post.'); } } } $form_action = "/fse_settings/projects/recover_post"; } } } else { $error_info = t('Bad Request!'); } } if (!isset($error_info)) { $filename = DocSectionManager::getSectionContentPath($section_id, $current_ver_code - 1, 'html'); $previous_content = file_get_contents($filename); } ?> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"> <span aria-hidden="true">×</span> <span class="sr-only"><?php echo t('Close'); ?> </span> </button> <h4 class="modal-title"><?php echo t('Recover Post'); ?>
$version_codes = array(); $content_versions = array(); for ($ver_code = 0; $ver_code <= $section_info['max_ver_code']; $ver_code++) { $content_version = new ContentVersion(); $filename = DocSectionManager::getSectionContentPath($section_id, $ver_code, 'org'); $fp = fopen($filename, "r"); if ($fp) { $fstats = fstat($fp); $content_version->pub_time = $pub_time = date('Y-m-d H:i', $fstats['mtime']) . ' CST'; $content_version->author_id = trim(fgets($fp)); $content_version->type_handle = trim(fgets($fp)); $content_version->attached_files = fgets($fp); $content_version->content_subject = trim(fgets($fp)); $content_version->org_content = fread($fp, filesize($filename)); fclose($fp); $filename = DocSectionManager::getSectionContentPath($section_id, $ver_code, 'html'); if (file_exists($filename)) { $content_version->html_content = file_get_contents($filename); } else { $content_version->html_content = NULL; } $version_codes["{$ver_code}"] = "Version {$ver_code} ({$pub_time})"; $content_versions[] = $content_version; } else { $content_versions[] = NULL; } } $json = Loader::helper('json'); $content_versions_json = $json->encode($content_versions); } }
* See the License for the specific language governing permissions and * limitations under the License. */ defined('C5_EXECUTE') or die('Access Denied.'); /* $page = Page::getCurrentPage (); $page_path = $page->getCollectionPath (); $page_id = $page->getCollectionID (); $path_frags = explode ('/', trim ($page_path, '/')); $project_id = $path_frags[1]; */ if ($currentVerCode > 0) { $last_author_id = $author_id; $last_edit_time = $edit_time; $last_author_name_info = FSEInfo::getNameInfo($last_author_id); $full_content_file_name = DocSectionManager::getSectionContentPath($sectionID, 0, 'org'); $fp = fopen($full_content_file_name, "r"); if ($fp) { $author_id = trim(fgets($fp)); $fstats = fstat($fp); $edit_time = date('Y-m-d H:i', $fstats['mtime']) . ' CST'; fclose($fp); unset($fp); $author_name_info = FSEInfo::getNameInfo($author_id); } } $request_part = "?fsenDocLang={$doc_lang}&domainHandle={$domainHandle}§ionID={$sectionID}¤tVerCode={$currentVerCode}"; $visible_class = 'visible-on-logged-in'; $link_style = false; $type_fragments = explode(":", $type_handle); switch ($type_fragments[0]) {
public static function getPlainContent($section_id, $curr_ver_code, $max_length = 140) { $plain_content = array(); $filename = self::getSectionContentPath($section_id, $curr_ver_code, 'org'); $fp = fopen($filename, "r"); if ($fp) { $plain_content['author_id'] = trim(fgets($fp)); $tmp = trim(fgets($fp)); $tmp = fgets($fp); $plain_content['title'] = trim(fgets($fp)); $fstats = fstat($fp); $plain_content['edit_time'] = date('Y-m-d H:i', $fstats['mtime']) . ' CST'; fclose($fp); unset($fp); unset($fstats); unset($tmp); } else { return false; } $filename = DocSectionManager::getSectionContentPath($section_id, $curr_ver_code, 'html'); $html_content = file_get_contents($filename); if ($html_content) { $plain_content['content'] = strip_tags($html_content); if (mb_strlen($plain_content['content']) > $max_length) { $plain_content['content'] = mb_substr($plain_content['content'], 0, $max_length) . '…'; } } return $plain_content; }
* Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ defined('C5_EXECUTE') or die('Access Denied.'); require_once 'helpers/fsen/DocSectionManager.php'; require_once 'helpers/fsen/FSEInfo.php'; $doc_lang = $_REQUEST['fsenDocLang']; if (!isset($doc_lang)) { $doc_lang = 'en'; } $full_content_file_name = DocSectionManager::getSectionContentPath($sectionID, $currentVerCode, 'html'); $html_content = file_get_contents($full_content_file_name); $full_content_file_name = DocSectionManager::getSectionContentPath($sectionID, $currentVerCode, 'org'); $fp = fopen($full_content_file_name, "r"); if ($fp) { $author_id = trim(fgets($fp)); $type_handle = trim(fgets($fp)); $attached_files = fgets($fp); $content_subject = trim(fgets($fp)); $fstats = fstat($fp); $edit_time = date('Y-m-d H:i', $fstats['mtime']) . ' CST'; fclose($fp); unset($fp); $author_name_info = FSEInfo::getNameInfo($author_id); } $json = Loader::helper('json'); $attached_files = $json->decode($attached_files); unset($json);