function PrePopulateAdminForm($formDescriptor) { $mod = $this->form_ptr->module_ptr; $main = array(array($mod->Lang('title_text'), $mod->CreateTextArea(get_preference(get_userid(), 'use_wysiwyg') == '1', $formDescriptor, $this->GetOption('text', ''), 'fbrp_opt_text', 'pageheadtags'))); $adv = array(array($mod->Lang('title_smarty_eval'), $mod->CreateInputCheckbox($formDescriptor, 'fbrp_opt_smarty_eval', '1', $this->GetOption('smarty_eval', '0')))); return array('main' => $main, 'adv' => $adv); }
function smarty_modifier_cms_date_format($string, $format = '', $default_date = '') { $gCms = cmsms(); if ($format == '') { $format = get_site_preference('defaultdateformat'); if ($format == '') { $format = '%b %e, %Y'; } if (!isset($gCms->variables['page_id'])) { $uid = get_userid(false); if ($uid) { $tmp = get_preference($uid, 'date_format_string'); if ($tmp != '') { $format = $tmp; } } } } $config = $gCms->GetConfig(); $fn = cms_join_path($config['root_path'], 'lib', 'smarty', 'plugins', 'modifier.date_format.php'); if (!file_exists($fn)) { die; } require_once $fn; return smarty_modifier_date_format($string, $format, $default_date); }
public function getUserFormat($fmt = '') { $config = cmsms()->GetConfig(); $stz = new DateTimeZone($config['timezone']); $utz = new DateTimeZone($config['user_timezone']); // this calls the cms_date_format stuff. if (empty($fmt)) { $fmt = get_site_preference('defaultdateformat', '%b %e, %Y'); global $gCms; if (!isset($gCms->variables['page_id'])) { $uid = get_userid(FALSE); if ($uid) { $fmt = get_preference($uid, 'date_format_string', $fmt); } } } $this->setTimeZone($utz); $when = $this->format('U'); $this->setTimeZone($stz); return strftime($fmt, $when); }
/** * Smarty date_format modifier plugin * * Type: modifier<br> * Name: cms_date_format<br> * Purpose: format datestamps via strftime<br> * Input:<br> * - string: input date string * - format: strftime format for output * - default_date: default date if $string is empty * * @link http://www.smarty.net/manual/en/language.modifier.date.format.php date_format (Smarty online manual) * @author Monte Ohrt <monte at ohrt dot com> * @param string $string input date string * @param string $format strftime format for output * @param string $default_date default date if $string is empty * @param string $formatter either 'strftime' or 'auto' * @return string |void * @uses smarty_make_timestamp() * * Modified by Tapio Löytty <*****@*****.**> */ function smarty_cms_modifier_cms_date_format($string, $format = '', $default_date = '') { if ($format == '') { $format = get_site_preference('defaultdateformat'); if ($format == '') { $format = '%b %e, %Y'; } if (!cmsms()->is_frontend_request()) { if ($uid = get_userid(false)) { $tmp = get_preference($uid, 'date_format_string'); if ($tmp != '') { $format = $tmp; } } } } $fn = cms_join_path(SMARTY_PLUGINS_DIR, 'modifier.date_format.php'); if (!file_exists($fn)) { die; } require_once $fn; return smarty_modifier_date_format($string, $format, $default_date); }
$gCms = cmsms(); $config = $gCms->GetConfig(); $userid = get_userid(); if (isset($USE_THEME) && $USE_THEME == false) { //echo '<!-- admin theme disabled -->'; } else { debug_buffer('before theme load'); $themeObject = cms_utils::get_theme_object(); debug_buffer('after theme load'); if (isset($headtext) && $headtext != '') { $themeObject->set_value('headertext', $headtext); } // Display notification stuff from modules // should be controlled by preferences or something $ignoredmodules = explode(',', get_preference($userid, 'ignoredmodules')); if (get_site_preference('enablenotifications', 1) && get_preference($userid, 'enablenotifications', 1)) { debug_buffer('before notifications'); if ($data = get_site_preference('__NOTIFICATIONS__')) { $data = unserialize($data); if (is_array($data) && count($data)) { foreach ($data as $item) { $old = $item->html; $regex = '/' . CMS_SECURE_PARAM_NAME . '\\=[0-9a-z]{8}/'; $to = CMS_SECURE_PARAM_NAME . '=' . $_SESSION[CMS_USER_KEY]; $new = preg_replace($regex, $to, $old); $themeObject->AddNotification($item->priority, $item->name, $item->html); } } } // if the install directory still existsx // add a priority 1 dashboard item
function display_content_list($themeObject = null) { $gCms = cmsms(); global $thisurl; global $urlext; check_login(); $userid = get_userid(); // setup which columns to display. $mypages = author_pages($userid); $columnstodisplay = array(); $columnstodisplay['expand'] = 1; $columnstodisplay['hier'] = 1; $columnstodisplay['page'] = 1; $columnstodisplay['alias'] = get_site_preference('listcontent_showalias', 1); $columnstodisplay['url'] = get_site_preference('listcontent_showurl', 1); $columnstodisplay['template'] = 1; $columnstodisplay['friendlyname'] = 1; $columnstodisplay['owner'] = 1; $columnstodisplay['active'] = check_permission($userid, 'Manage All Content'); $columnstodisplay['default'] = check_permission($userid, 'Manage All Content'); $columnstodisplay['move'] = check_permission($userid, 'Manage All Content') || check_permission($userid, 'Reorder Content'); $columnstodisplay['view'] = 1; $columnstodisplay['copy'] = check_permission($userid, 'Add Pages') || check_permission($userid, 'Manage All Content'); $columnstodisplay['edit'] = 1; $columnstodisplay['delete'] = check_permission($userid, 'Remove Pages') || check_permission($userid, 'Manage All Content'); $columnstodisplay['multiselect'] = check_permission($userid, 'Remove Pages') || check_permission($userid, 'Manage All Content'); $page = 1; if (isset($_GET['page'])) { $page = $_GET['page']; } //$limit = get_preference($userid, 'paging', 0); $limit = 0; //Took out pagination $thelist = ''; $count = 0; $currow = "row1"; if ($themeObject == null) { $themeObject = AdminTheme::GetThemeObject(); } // construct true/false button images $image_true = $themeObject->DisplayImage('icons/system/true.gif', lang('true'), '', '', 'systemicon'); $image_set_false = $themeObject->DisplayImage('icons/system/true.gif', lang('setfalse'), '', '', 'systemicon'); $image_set_true = $themeObject->DisplayImage('icons/system/false.gif', lang('settrue'), '', '', 'systemicon'); $expandImg = $themeObject->DisplayImage('icons/system/expand.gif', lang('expand'), '', '', 'systemicon'); $contractImg = $themeObject->DisplayImage('icons/system/contract.gif', lang('contract'), '', '', 'systemicon'); $downImg = $themeObject->DisplayImage('icons/system/arrow-d.gif', lang('down'), '', '', 'systemicon'); $upImg = $themeObject->DisplayImage('icons/system/arrow-u.gif', lang('up'), '', '', 'systemicon'); $viewImg = $themeObject->DisplayImage('icons/system/view.gif', lang('view'), '', '', 'systemicon'); $editImg = $themeObject->DisplayImage('icons/system/edit.gif', lang('edit'), '', '', 'systemicon'); $copyImg = $themeObject->DisplayImage('icons/system/copy.gif', lang('copy'), '', '', 'systemicon'); $deleteImg = $themeObject->DisplayImage('icons/system/delete.gif', lang('delete'), '', '', 'systemicon'); #Setup array so we don't load more templates than we need to $templateops = TemplateOperations::get_instance()->LoadTemplates(); #Ditto with users $users = array(); $menupos = array(); $openedArray = array(); if (get_preference($userid, 'collapse', '') != '') { $tmp = explode('.', get_preference($userid, 'collapse')); foreach ($tmp as $thisCol) { $colind = substr($thisCol, 0, strpos($thisCol, '=')); if ($colind != "") { $openedArray[] = $colind; } } } debug_buffer('At Start of Display Content List'); $hierarchy = $gCms->GetHierarchyManager(); $rowcount = 0; if ($hierarchy->hasChildren()) { $pagelist = array(); $children = $hierarchy->getChildren(false, true); $author_allpages = check_permission($userid, 'Reorder Content') && check_peer_authorship($userid, $children[0]->getId()); foreach ($children as $child) { display_hierarchy($child, $userid, check_modify_all($userid), $users, $menupos, $openedArray, $pagelist, $image_true, $image_set_false, $image_set_true, $upImg, $downImg, $viewImg, $editImg, $copyImg, $deleteImg, $expandImg, $contractImg, $mypages, $page, $columnstodisplay, $author_allpages); } $rowcount += count($pagelist); foreach ($pagelist as $item) { $thelist .= $item; } $thelist .= '</tbody>'; $thelist .= "</table>\n"; } $headoflist = ''; $headoflist .= '<div class="pageoverflow"><p class="pageoptions">'; if (check_permission($userid, 'Add Pages') || check_permission($userid, 'Manage All Content')) { $headoflist .= '<a href="addcontent.php' . $urlext . '" class="pageoptions">'; $headoflist .= $themeObject->DisplayImage('icons/system/newobject.gif', lang('addcontent'), '', '', 'systemicon') . '</a>'; $headoflist .= ' <a class="pageoptions" href="addcontent.php' . $urlext . '">' . lang("addcontent") . '</a>'; } $headoflist .= '<a style="margin-left: 10px;" href="' . $thisurl . '&expandall=1" onclick="xajax_content_expandall(); return false;">'; $headoflist .= $themeObject->DisplayImage('icons/system/expandall.gif', lang('expandall'), '', '', 'systemicon') . '</a>'; $headoflist .= ' <a class="pageoptions" href="' . $thisurl . '&expandall=1" onclick="xajax_content_expandall(); return false;">' . lang("expandall") . '</a> '; $headoflist .= ' <a href="' . $thisurl . '&collapseall=1" onclick="xajax_content_collapseall(); return false;">'; $headoflist .= $themeObject->DisplayImage('icons/system/contractall.gif', lang('contractall'), '', '', 'systemicon') . '</a>'; $headoflist .= ' <a class="pageoptions" href="' . $thisurl . '&collapseall=1" onclick="xajax_content_collapseall(); return false;">' . lang("contractall") . '</a>'; if (check_permission($userid, 'Manage All Content')) { $reorderurl = "ordercontent.php?" . CMS_SECURE_PARAM_NAME . "=" . $_SESSION[CMS_USER_KEY]; $headoflist .= ' <a href="' . $reorderurl . '">'; $headoflist .= $themeObject->DisplayImage('icons/system/reorder.gif', lang('reorderpages'), '', '', 'systemicon') . '</a>'; $headoflist .= ' <a class="pageoptions" href="' . $reorderurl . '">' . lang('reorderpages') . '</a>'; } $headoflist .= '</p></div>'; $headoflist .= '<form action="multicontent.php" method="post">'; $headoflist .= '<div class="hidden" ><input type="hidden" name="' . CMS_SECURE_PARAM_NAME . '" value="' . $_SESSION[CMS_USER_KEY] . '"/></div>' . "\n"; $headoflist .= '<table cellspacing="0" class="pagetable">' . "\n"; $headoflist .= '<thead>'; $headoflist .= "<tr>\n"; // setup column titles. if ($columnstodisplay['expand']) { $headoflist .= "<th> </th>"; } if ($columnstodisplay['hier']) { $headoflist .= "<th> </th>"; } if ($columnstodisplay['page']) { $str = lang('menutext'); if (get_site_preference('listcontent_showtitle')) { $str = lang('title'); } $headoflist .= '<th scope="col" class="pagew25" title="' . lang('lctitle_page') . '">' . lang('page') . " <em>({$str})</em></th>\n"; } if ($columnstodisplay['alias']) { $headoflist .= '<th scope="col" title="' . lang('lctitle_alias') . '">' . lang('pagealias') . "</th>\n"; } if ($columnstodisplay['url']) { $headoflist .= '<th scope="col" title="' . lang('lctitle_url') . '">' . lang('url') . "</th>\n"; } if ($columnstodisplay['template']) { $headoflist .= '<th scope="col" title="' . lang('lctitle_template') . '">' . lang('template') . "</th>\n"; } if ($columnstodisplay['friendlyname']) { $headoflist .= "<th scope=\"col\" >" . lang('type') . "</th>\n"; } if ($columnstodisplay['owner']) { $headoflist .= '<th scope="col" title="' . lang('lctitle_owner') . '">' . lang('owner') . "</th>\n"; } if ($columnstodisplay['active']) { $headoflist .= '<th scope="col" title="' . lang('lctitle_active') . '" class="pagepos">' . lang('active') . "</th>\n"; } if ($columnstodisplay['default']) { $headoflist .= '<th scope="col" title="' . lang('lctitle_default') . '" class="pagepos">' . lang('default') . "</th>\n"; } if ($columnstodisplay['move']) { $headoflist .= '<th scope="col" title="' . lang('lctitle_move') . '" class="move">' . lang('move') . "</th>\n"; } if ($columnstodisplay['view']) { $headoflist .= "<th class=\"pageicon\"> </th>\n"; } if ($columnstodisplay['copy']) { $headoflist .= "<th class=\"pageicon\"> </th>\n"; } if ($columnstodisplay['edit']) { $headoflist .= "<th class=\"pageicon\"> </th>\n"; } if ($columnstodisplay['delete']) { $headoflist .= "<th class=\"pageicon\"> </th>\n"; } if ($columnstodisplay['multiselect']) { $headoflist .= '<th scope="col" title="' . lang('lctitle_multiselect') . '" class="checkbox"><input id="selectall" type="checkbox" onclick="select_all();" /><label for="selectall" class="invisible">' . lang('toggle') . '</label></th>' . "\n"; // checkbox column } $headoflist .= "</tr>\n"; $headoflist .= '</thead>'; $headoflist .= '<tbody>'; ob_start(); $opts = array(); if (check_permission($userid, 'Remove Pages') || check_permission($userid, 'Manage All Content')) { bulkcontentoperations::register_function(lang('delete'), 'delete'); } if (check_permission($userid, 'Manage All Content')) { bulkcontentoperations::register_function(lang('active'), 'active'); bulkcontentoperations::register_function(lang('inactive'), 'inactive'); bulkcontentoperations::register_function(lang('cachable'), 'setcachable'); bulkcontentoperations::register_function(lang('noncachable'), 'setnoncachable'); bulkcontentoperations::register_function(lang('showinmenu'), 'showinmenu'); bulkcontentoperations::register_function(lang('hidefrommenu'), 'hidefrommenu'); bulkcontentoperations::register_function(lang('secure'), 'secure'); bulkcontentoperations::register_function(lang('insecure'), 'insecure'); bulkcontentoperations::register_function(lang('settemplate'), 'settemplate'); bulkcontentoperations::register_function(lang('changeowner'), 'changeowner'); } $opts = bulkcontentoperations::get_operation_list(); if (!empty($opts)) { echo '<div class="pageoptions">' . "\n"; echo '<div style="margin-top: 0; float: right; text-align: right">' . "\n"; echo '<label for="multiaction">' . lang('selecteditems') . '</label>: '; echo '<select name="multiaction" id="multiaction">'; foreach ($opts as $key => $value) { echo '<option value="' . $key . '">' . $value . '</option>'; } echo '</select>' . "\n"; echo '<input type="submit" accesskey="s" value="' . lang('submit') . '"/></div></div>' . "\n"; } /* } */ ?> <div style="float: left;"> <?php if (check_permission($userid, 'Add Pages') || check_permission($userid, 'Manage All Content')) { ?> <a href="addcontent.php<?php echo $urlext; ?> " class="pageoptions"> <?php echo $themeObject->DisplayImage('icons/system/newobject.gif', lang('addcontent'), '', '', 'systemicon') . '</a>'; echo ' <a class="pageoptions" href="addcontent.php' . $urlext . '">' . lang("addcontent"); ?> </a> <?php } ?> <a style="margin-left: 10px;" href="'.$thisurl.'&expandall=1" onclick="xajax_content_expandall(); return false;"> <?php echo $themeObject->DisplayImage('icons/system/expandall.gif', lang('expandall'), '', '', 'systemicon') . '</a>'; echo ' <a class="pageoptions" href="' . $thisurl . '&expandall=1" onclick="xajax_content_expandall(); return false;">' . lang("expandall"); ?> </a> <a href="<?php echo $thisurl; ?> &collapseall=1" onclick="xajax_content_collapseall(); return false;"> <?php echo $themeObject->DisplayImage('icons/system/contractall.gif', lang('contractall'), '', '', 'systemicon') . '</a>'; echo ' <a class="pageoptions" href="' . $thisurl . '&collapseall=1" onclick="xajax_content_collapseall(); return false;">' . lang("contractall") . '</a>'; if (check_permission($userid, 'Manage All Content')) { $image_reorder = $themeObject->DisplayImage('icons/system/reorder.gif', lang('reorderpages'), '', '', 'systemicon'); $reorderurl = "ordercontent.php?" . CMS_SECURE_PARAM_NAME . "=" . $_SESSION[CMS_USER_KEY]; echo ' <a class="pageoptions" href="' . $reorderurl . '">' . $image_reorder . '</a> <a class="pageoptions" href="' . $reorderurl . '">' . lang('reorderpages') . '</a>'; } ?> </div> <br /> <div class="clearb"></div> <?php $footer = ob_get_contents(); ob_end_clean(); return $headoflist . $thelist . $footer . '</form></div>'; }
} ?> <div class="pagecontainer"> <div class="pageoverflow"> <?php $userid = get_userid(); $gcbops = cmsms()->GetGlobalContentOperations(); $modifyall = check_permission($userid, 'Modify Global Content Blocks'); $htmlbloblist = $gcbops->LoadHtmlBlobs(); $myblobs = $gcbops->AuthorBlobs($userid); $page = 1; if (isset($_GET['page'])) { $page = $_GET['page']; } $limit = get_preference($userid, 'listgcbs_pagelimit', 20); echo "<p class=\"pageshowrows\">" . pagination($page, count($htmlbloblist), $limit) . "</p>"; echo $themeObject->ShowHeader('htmlblobs') . '</div>'; if ($htmlbloblist && count($htmlbloblist) > 0) { echo "<table cellspacing=\"0\" class=\"pagetable\">\n"; echo "<thead>"; echo "<tr>\n"; echo "<th>" . lang('name') . "</th>\n"; echo "<th>" . lang('tagtousegcb') . "</th>\n"; echo "<th>" . lang('description') . "</th>\n"; echo "<th class=\"pageicon\"> </th>\n"; echo "<th class=\"pageicon\"> </th>\n"; echo "</tr>\n"; echo "</thead>"; echo "<tbody>"; $currow = "row1";
/** * A function to retrieve the global admin theme object. * This method will create the admin theme object if has not yet been created. It will read the cms preferences and cross reference with available themes. * * @param String optional theme name. * @return object Reference to the initialized admin theme. */ public static function &GetThemeObject($name = '') { if (is_object(self::$_instance)) { return self::$_instance; } if (!$name) { $name = get_preference(get_userid(FALSE), 'admintheme', self::GetDefaultTheme()); } if (class_exists($name)) { self::$_instance = new $name(); } else { $gCms = cmsms(); $config = $gCms->GetConfig(); $themeObjName = $name . "Theme"; $fn = $config['admin_path'] . "/themes/{$name}/{$themeObjName}.php"; if (file_exists($fn)) { include_once $fn; self::$_instance = new $themeObjName($gCms, get_userid(FALSE), $name); } else { // theme not found... use default $name = self::GetDefaultTheme(); $themeObjName = $name . "Theme"; $fn = $config['admin_path'] . "/themes/{$name}/{$themeObjName}.php"; if (file_exists($fn)) { include_once $fn; self::$_instance = new $themeObjName($gCms, get_userid(FALSE), $name); } else { // still not found $res = null; return $res; } } } return self::$_instance; }
public function do_header() { $this->DisplayDocType(); $this->DisplayHTMLStartTag(); $headtext = $this->get_value('headertext'); $this->DisplayHTMLHeader(false, $headtext); $this->DisplayBodyTag(); $this->DisplayTopMenu(); $this->DisplayMainDivStart(); $this->DisplayNotifications(3); // todo, a preference. $marks = get_preference(get_userid(), 'bookmarks'); if ($marks) { $this->StartRighthandColumn(); if ($marks) { $this->DoBookmarks(); } $this->EndRighthandColumn(); } }
} elseif (isset($_REQUEST['mact'])) { $ary = explode(',', cms_htmlentities($_REQUEST['mact']), 4); $module = isset($ary[0]) ? $ary[0] : ''; $id = isset($ary[1]) ? $ary[1] : 'm1_'; $action = isset($ary[2]) ? $ary[2] : ''; } if (!$module) { trigger_error('Module action specified, but could not determine the module.'); redirect("index.php" . $urlext); } $modinst = ModuleOperations::get_instance()->get_module_instance($module); if (!$modinst) { trigger_error('Module ' . $module . ' not found in memory. This could indicate that the module is in need of upgrade or that there are other problems'); redirect("index.php" . $urlext); } if (get_preference($userid, 'use_wysiwyg') == '1' && $modinst->IsWYSIWYG()) { $htmlarea_flag = "true"; $htmlarea_replaceall = true; } $USE_THEME = true; if (isset($_REQUEST[$id . 'disable_buffer']) || isset($_REQUEST['disable_buffer'])) { $USE_THEME = false; } else { if (isset($_REQUEST[$id . 'disable_theme']) || isset($_REQUEST['disable_theme'])) { $USE_THEME = false; } } if (isset($_REQUEST['showtemplate']) && $_REQUEST['showtemplate'] == 'false') { // for simplicity and compatibility with the frontend. $USE_THEME = false; }
$wysiwyg = get_preference($userid, 'wysiwyg'); $syntaxhighlighter = get_preference($userid, 'syntaxhighlighter'); $default_cms_language = get_preference($userid, 'default_cms_language'); $old_default_cms_lang = $default_cms_language; $admintheme = get_preference($userid, 'admintheme', CmsAdminThemeBase::GetDefaultTheme()); $bookmarks = get_preference($userid, 'bookmarks', 0); $indent = get_preference($userid, 'indent', true); $enablenotifications = get_preference($userid, 'enablenotifications', 1); $paging = get_preference($userid, 'paging', 0); $date_format_string = get_preference($userid, 'date_format_string', '%x %X'); $default_parent = get_preference($userid, 'default_parent', -2); $listtemplates_pagelimit = get_preference($userid, 'listtemplates_pagelimit', 20); $liststylesheets_pagelimit = get_preference($userid, 'liststylesheets_pagelimit', 20); $listgcbs_pagelimit = get_preference($userid, 'listgcbs_pagelimit', 20); $hide_help_links = get_preference($userid, 'hide_help_links', 0); $homepage = get_preference($userid, 'homepage'); /** * Cancel */ if (isset($_POST["cancel"])) { redirect("index.php" . $urlext); return; } /** * Check tab */ $tab = ''; if (isset($_POST['active_tab'])) { $tab = trim($_POST['active_tab']); } /**
// You are in no active projects, active or expired make_no_projects_greeting($user, true); } else { if (count($project_objects) == 0) { // You are in no active projects make_no_projects_greeting($user, false); print "<script type='text/javascript'>"; print "\$(document).ready(function(){"; print 'update_selector($("#projectfilterswitch"), "-EXPIRED-PROJECTS-");'; print 'switch_to_card("#projects");'; print 'update_projects();'; print "});"; print "</script>"; } make_navigation_tabs(); if (get_preference($user->urn(), "homepage_view") == "cards") { // Get the user's unexpired slices $unexpired_slices = array(); foreach ($slice_objects as $slice) { $slice_id = $slice[SA_SLICE_TABLE_FIELDNAME::SLICE_ID]; $expired = $slice[SA_SLICE_TABLE_FIELDNAME::EXPIRED]; if (!convert_boolean($expired)) { $unexpired_slices[$slice_id] = $slice; } } $slice_objects = $unexpired_slices; // Get all of the slice owner names $slice_owner_names = array(); if (count($slice_objects) > 0) { $slice_owner_names = lookup_member_names_for_rows($ma_url, $user, $slice_objects, SA_SLICE_TABLE_FIELDNAME::OWNER_ID); }
if (isset($_GET['setactive'])) { $thetemplate->active = 1; $thetemplate->Save(); } if (isset($_GET['setinactive'])) { $thetemplate->active = 0; $thetemplate->Save(); } } } $templatelist = $templateops->LoadTemplates(); $page = 1; if (isset($_GET['page'])) { $page = $_GET['page']; } $limit = get_preference($userid, 'listtemplates_pagelimit', 20); if (count($templatelist) > $limit) { echo "<p class=\"pageshowrows\">" . pagination($page, count($templatelist), $limit) . "</p>"; } echo $themeObject->ShowHeader('currenttemplates') . '</div>'; if ($templatelist && count($templatelist) > 0) { echo '<table cellspacing="0" class="pagetable">'; echo '<thead>'; echo "<tr>\n"; echo '<th class="pagew50">' . lang('template') . '</th>'; echo "<th class=\"pagepos\">" . lang('default') . "</th>\n"; echo "<th class=\"pagepos\">" . lang('active') . "</th>\n"; if ($edit) { echo "<th class=\"pagepos\"> </th>\n"; } echo "<th class=\"pageicon\"> </th>\n";
public function postprocess($html) { $smarty = cmsms()->GetSmarty(); $otd = $smarty->template_dir; $smarty->template_dir = dirname(__FILE__) . '/templates'; $module_help_type = $this->get_value('module_help_type'); // get a page title $title = $this->get_value('pagetitle'); $alias = $this->get_value('pagetitle'); if ($title) { if (!$module_help_type) { // if not doing module help, translate the string. $extra = $this->get_value('extra_lang_params'); if (!$extra) { $extra = array(); } $title = lang($title, $extra); } } else { // no title, get one from the breadcrumbs. $bc = $this->get_breadcrumbs(); if (is_array($bc) && count($bc)) { $title = $bc[count($bc) - 1]['title']; } } // page title and alias $smarty->assign('pagetitle', $title); $smarty->assign('pagealias', munge_string_to_url($alias)); // module name? if ($module_name = $this->get_value('module_name')) { $smarty->assign('module_name', $module_name); } // module icon? if ($module_icon_url = $this->get_value('module_icon_url')) { $smarty->assign('module_icon_url', $module_icon_url); } // module_help_url if (!get_preference(get_userid(), 'hide_help_links', 0)) { if ($module_help_url = $this->get_value('module_help_url')) { $smarty->assign('module_help_url', $module_help_url); } } // if bookmarks if (get_preference(get_userid(), 'bookmarks')) { $marks = $this->get_bookmarks(); $smarty->assign('marks', $marks); } $headtext = $this->get_value('headertext'); $smarty->assign('headertext', $headtext); // and some other common variables,. $smarty->assign('content', str_replace('</body></html>', '', $html)); $smarty->assign('config', cmsms()->GetConfig()); $smarty->assign('theme', $this); $smarty->assign('secureparam', CMS_SECURE_PARAM_NAME . '=' . $_SESSION[CMS_USER_KEY]); $userops = cmsms()->GetUserOperations(); $smarty->assign('user', $userops->LoadUserByID(get_userid())); // get user selected language $smarty->assign('lang', get_preference(get_userid(), 'default_cms_language')); // get language direction $lang = CmsNlsOperations::get_current_language(); $info = CmsNlsOperations::get_language_info($lang); $smarty->assign('lang_dir', $info->direction()); if (is_array($this->_errors) && count($this->_errors)) { $smarty->assign('errors', $this->_errors); } if (is_array($this->_messages) && count($this->_messages)) { $smarty->assign('messages', $this->_messages); } $_contents = $smarty->fetch('pagetemplate.tpl'); $smarty->template_dir = $otd; return $_contents; }
} if (isset($_POST['use_wysiwyg'])) { $use_wysiwyg = (int) $_POST['use_wysiwyg']; } if (isset($_POST['description'])) { $description = trim($_POST['description']); } if (isset($_POST['owner_id'])) { $owner_id = $_POST['owner_id']; } if (isset($_POST['ajax']) && $_POST['ajax']) { $ajax = true; } $gcb_wysiwyg = get_site_preference('nogcbwysiwyg', '0') == '0' ? 1 : 0; if ($gcb_wysiwyg) { $gcb_wysiwyg = get_preference($userid, 'gcb_wysiwyg', 1); } if ($access) { if (isset($_POST["submit2"]) || $ajax) { $validinfo = true; if ($htmlblob == "") { $error .= "<li>" . lang('nofieldgiven', array(lang('name'))) . "</li>"; $validinfo = false; } else { if ($htmlblob != $oldhtmlblob && $gcbops->CheckExistingHtmlBlobName($htmlblob, $htmlblob_id)) { $error .= "<li>" . lang('blobexists') . "</li>"; $validinfo = false; } else { if ($content == "") { $error .= '<li>' . lang('nofieldgiven', array('content')) . '</li>'; $validinfo = false;
$access = check_permission($userid, 'Modify Group Assignments'); if (!$access) { die('Permission Denied'); return; } $userops =& $gCms->GetUserOperations(); $adminuser = $userops->UserInGroup($userid, 1) || $userid == 1; $message = ''; include_once "header.php"; global $gCms; $db =& $gCms->GetDb(); if (isset($_POST['filter'])) { $disp_group = $_POST['groupsel']; set_preference($userid, 'changegroupassign_group', $disp_group); } $disp_group = get_preference($userid, 'changegroupassign_group', -1); // always display the group pulldown global $gCms; $groupops =& $gCms->GetGroupOperations(); $userops =& $gCms->GetUserOperations(); $tmp = new stdClass(); $tmp->name = lang('all_groups'); $tmp->id = -1; $allgroups = array($tmp); $groups = array($tmp); $group_list = $groupops->LoadGroups(); foreach ($group_list as $onegroup) { if ($onegroup->id == 1 && $adminuser == false) { continue; } $allgroups[] = $onegroup;
<?php $CMS_ADMIN_PAGE = 1; $path = dirname(dirname(dirname(__FILE__))); require_once $path . DIRECTORY_SEPARATOR . 'include.php'; $urlext = get_secure_param(); check_login(); $userid = get_userid(); $config =& $gCms->GetConfig(); $modules =& $gCms->modules; $tiny = $modules["TinyMCE"]['object']; $tiny->curlang = get_preference($userid, 'default_cms_language'); $filepickerstyle = $tiny->GetPreference("filepickerstyle", "both"); $tiny->smarty->assign("filepickerstyle", $filepickerstyle); $tiny->smarty->assign("rooturl", $config["root_url"]); $tiny->smarty->assign("admindir", $config["admin_dir"]); $tiny->smarty->assign("filepickertitle", $tiny->Lang("filepickertitle")); $tiny->smarty->assign("youareintext", $tiny->Lang("youareintext")); $rootpath = ""; $rooturl = ""; if ($_GET["type"] == "image") { $rootpath = $config["image_uploads_path"]; $rooturl = $config["image_uploads_url"]; $tiny->smarty->assign("isimage", "1"); } else { $rootpath = $config["uploads_path"]; $rooturl = $config["uploads_url"]; $tiny->smarty->assign("isimage", "0"); } if (!$tiny->CheckPermission('allowadvancedprofile')) { if ($tiny->GetPreference("restrictdirs", 0) == 1) {
$multi_input_tpls[$tpl['tpl_id']]['set_default_link'] = $this->CreateLink($id, 'savePrefs', $returnid, cmsms()->variables['admintheme']->DisplayImage('icons/system/false.gif', '', '', '', 'systemicon'), array('set_default' => 'multi_input', 'tpl_id' => $tpl['tpl_id'], 'active_tab' => 'multi_input_tpl')); } else { $multi_input_tpls[$tpl['tpl_id']]['set_default_link'] = cmsms()->variables['admintheme']->DisplayImage('icons/system/true.gif', '', '', '', 'systemicon'); } } $this->smarty->assign('selectall', $this->CreateInputCheckbox($id, 'multi_input_tpl', true, false, 'id="' . $id . 'multi_input_tpl" onclick="AdvancedContent.selectAll(this)"')); $this->smarty->assign_by_ref('multi_input_tpl_array', $multi_input_tpls); $this->smarty->assign('add_multi_input_tpl', $this->CreateLink($id, 'addMultiInputTpl', $returnid, cmsms()->variables['admintheme']->DisplayImage('icons/system/newobject.gif', '', '', '', 'systemicon') . ' ' . $this->lang('add_multi_input_tpl'))); $this->smarty->assign('submit_bulkaction', $this->CreateInputSubmit($id, 'submit_bulkaction', $this->lang('delete_selected'), '', '', $this->lang('confirm_delete_selected'))); $this->smarty->assign('template_name_text', lang('template')); $this->smarty->assign('start_form', $this->CreateFormStart($id, 'deleteMultiInputTpl', $returnid, 'post', 'multipart/form-data')); $this->smarty->assign('end_form', $this->CreateFormEnd()); $tabs['multi_input_tpl']['tabcontent'] = $this->StartTab('multi_input_tpl') . $this->ProcessTemplate('multiInputTplTab.tpl') . $this->EndTab(); } $this->smarty->assign_by_ref('tabs', $tabs); $this->smarty->assign('start_tabheaders', $this->StartTabHeaders()); $this->smarty->assign('end_tabheaders', $this->EndTabHeaders()); $this->smarty->assign('start_tabcontent', $this->StartTabContent()); $this->smarty->assign('end_tabcontent', $this->EndTabContent()); $this->smarty->assign('end_tab', $this->EndTab()); $this->smarty->assign('moduleId', $id); $this->smarty->assign('locale', substr(get_preference(get_userid(), 'default_cms_language'), 0, 2)); if (isset($params['message'])) { echo $this->ShowMessage($this->lang($params['message'], isset($params['old_type']) && isset($params['new_type']) ? $this->lang($params['old_type']) . ',' . $this->lang($params['new_type']) : '')); } #$this->smarty->assign('message', $this->lang($params['message'], (isset($params['old_type']) && isset($params['new_type']) ? $this->lang($params['old_type']) . ',' . $this->lang($params['new_type']) : ''))); if (isset($params['errormessage'])) { echo $this->ShowErrors($this->lang($params['errormessage'], isset($params['old_type']) && isset($params['new_type']) ? $this->lang($params['old_type']) . ',' . $this->lang($params['new_type']) : '')); } #$this->smarty->assign('errormessage', $this->lang($params['errormessage'], (isset($params['old_type']) && isset($params['new_type']) ? $this->lang($params['old_type']) . ',' . $this->lang($params['new_type']) : ''))); echo $this->_pp() . $this->ProcessTemplate('defaultadmin.tpl');
function toggleexpand($contentid, $collapse = false) { $userid = get_userid(); $openedArray = array(); if (get_preference($userid, 'collapse', '') != '') { $tmp = explode('.', get_preference($userid, 'collapse')); foreach ($tmp as $thisCol) { $colind = substr($thisCol, 0, strpos($thisCol, '=')); $openedArray[$colind] = 1; } } if ($collapse) { $openedArray[$contentid] = 0; } else { $openedArray[$contentid] = 1; } $cs = ''; foreach ($openedArray as $key => $val) { if ($val == 1) { $cs .= $key . '=1.'; } } set_preference($userid, 'collapse', $cs); }
$plugin_name = ""; if (isset($_POST["plugin_name"])) { $plugin_name = $_POST["plugin_name"]; } $code = ""; if (isset($_POST["code"])) { $code = $_POST["code"]; } if (isset($_POST["cancel"])) { redirect("listusertags.php" . $urlext); return; } $userid = get_userid(); $access = check_permission($userid, 'Modify User-defined Tags'); $use_javasyntax = false; if (get_preference($userid, 'use_javasyntax') == "1") { $use_javasyntax = true; } $smarty = new Smarty_CMS($gCms->config); load_plugins($smarty); global $gCms; $db =& $gCms->GetDb(); if ($access) { if (isset($_POST["addplugin"])) { $validinfo = true; if ($plugin_name == "") { $error[] = lang('nofieldgiven', array(lang('name'))); $validinfo = false; } elseif (preg_match('<^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$>', $plugin_name) == 0) { $error[] = lang('error_udt_name_chars'); $validinfo = false;
$plugin_name = $row["userplugin_name"]; $orig_plugin_name = $plugin_name; $code = $row['code']; } } } if (strlen($plugin_name) > 0) { $CMS_ADMIN_SUBTITLE = $plugin_name; } $addlScriptSubmit = ''; foreach (array_keys($gCms->modules) as $moduleKey) { $module =& $gCms->modules[$moduleKey]; if (!($module['installed'] && $module['active'] && $module['object']->IsSyntaxHighlighter())) { continue; } if ($module['object']->SyntaxActive() or get_preference(get_userid(), 'syntaxhighlighter') == $module['object']->GetName()) { $addlScriptSubmit .= $module['object']->SyntaxPageFormSubmit(); } } $headtext = <<<EOSCRIPT <script type="text/javascript"> // <![CDATA[ window.Edit_UserPlugin_Apply = function(button) { \t{$addlScriptSubmit} \t\$('Edit_UserPlugin_Result').innerHTML = ''; \tbutton.disabled = 'disabled'; \tvar data = new Array(); \tdata.push('ajax=1'); \tdata.push('apply=1');
if ($action == "showpluginhelp") { if (function_exists('smarty_cms_help_function_' . $plugin)) { echo '<div class="pagecontainer">'; // Display the title along with a wiki help link $header = '<div class="pageheader">'; $header .= lang('pluginhelp', array($plugin)); $wikiUrl = $config['wiki_url']; $module_name = $plugin; // Turn ModuleName into _Module_Name $moduleName = preg_replace('/([A-Z])/', "_\$1", $module_name); $moduleName = preg_replace('/_([A-Z])_/', "\$1", $moduleName); if ($moduleName[0] == '_') { $moduleName = substr($moduleName, 1); } $wikiUrl .= '/Tags/' . $moduleName; if (FALSE == get_preference($userid, 'hide_help_links')) { // Clean up URL $wikiUrl = str_replace(' ', '_', $wikiUrl); $wikiUrl = str_replace('&', 'and', $wikiUrl); $help_title = lang('help_external'); $image_help = $themeObject->DisplayImage('icons/system/info.gif', lang('help'), '', '', 'systemicon'); $image_help_external = $themeObject->DisplayImage('icons/system/info-external.gif', lang('help'), '', '', 'systemicon'); $header .= '<span class="helptext"><a href="' . $wikiUrl . '" target="_blank">' . $image_help_external . '</a> <a href="' . $wikiUrl . '" target="_blank">' . lang('help') . '</a> (' . lang('new_window') . ')</span>'; } $header .= '</div>'; echo $header; // Get and display the plugin's help @ob_start(); call_user_func_array('smarty_cms_help_function_' . $plugin, array()); $content = @ob_get_contents(); @ob_end_clean();
function DisplayBookmarks($marks) { if (get_preference($this->userid, 'bookmarks')) { echo '<div id="navt_bookmarks_c">' . "\n"; $counter = 0; foreach ($marks as $mark) { echo "<a href=\"" . $mark->url . "\">" . ++$counter . '. ' . $mark->title . "</a><br />" . "\n"; } echo '</div>' . "\n"; } }
} else { $error .= "<li>" . lang('errorretrievingcss') . "</li>"; } } } # end of getting css } # end of has access if (strlen($css_name) > 0) { $CMS_ADMIN_SUBTITLE = $css_name; } if (isset($_POST["apply"])) { $CMS_EXCLUDE_FROM_RECENT = 1; } $addlScriptSubmit = ''; $syntaxmodule = get_preference(get_userid(FALSE), 'syntaxhighlighter'); if ($syntaxmodule && ($module = ModuleOperations::get_instance()->get_module_instance($syntaxmodule))) { if ($module->IsSyntaxHighlighter() && $module->SyntaxActive()) { $addlScriptSubmit .= $module->SyntaxPageFormSubmit(); } } $closestr = cms_html_entity_decode(lang('close')); $headtext = <<<EOSCRIPT <script type="text/javascript"> // <![CDATA[ jQuery(document).ready(function(){ jQuery('[name=apply]').live('click',function(){ var data = jQuery('#Edit_CSS').find('input:not([type=submit]), select, textarea').serializeArray(); data.push({ 'name': 'ajax', 'value': 1}); data.push({ 'name': 'apply', 'value': 1 }); \$.post('{$_SERVER['REQUEST_URI']}',data,function(resultdata,text){
#This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. #You should have received a copy of the GNU General Public License #along with this program; if not, write to the Free Software #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # #$Id: editcontent.php 10116 2015-08-27 21:58:42Z calguy1000 $ $CMS_ADMIN_PAGE = 1; require_once "../include.php"; $urlext = '?' . CMS_SECURE_PARAM_NAME . '=' . $_SESSION[CMS_USER_KEY]; check_login(); $userid = get_userid(); include_once "../lib/classes/class.admintheme.inc.php"; $dateformat = get_preference(get_userid(), 'date_format_string', '%x %X'); define('XAJAX_DEFAULT_CHAR_ENCODING', $config['admin_encoding']); require_once dirname(dirname(__FILE__)) . '/lib/xajax/xajax_core/xajax.inc.php'; require_once dirname(__FILE__) . '/editcontent_extra.php'; $error = FALSE; $content_id = ""; if (isset($_REQUEST["content_id"])) { $content_id = (int) $_REQUEST["content_id"]; } $pagelist_id = "1"; if (isset($_REQUEST["page"])) { $pagelist_id = (int) $_REQUEST["page"]; } $submit = false; if (isset($_POST["submitbutton"])) { $submit = true;
public function GetInput() { if (!$this->GetContent()) { $this->SetContent(time()); } setlocale(LC_ALL, get_preference(get_userid(), 'default_cms_language')); $date = strftime('%x', intval($this->GetContent())); $time = '0:0'; if ($this->GetProperty('show_clock')) { $time = strftime('%H:%M', intval($this->GetContent())); } $_tmp = ac_utils::CleanArray(explode(':', $time)); $timeSeconds = $_tmp[0] * 3600 + $_tmp[1] * 60; $dateSeconds = $this->GetContent() - $timeSeconds; $dateInput = '<input id="' . $this->GetProperty('id') . '_AdvancedContentDatePickerDisplay" type="text" value="' . $date . '" /> <input id="' . $this->GetProperty('id') . '_AdvancedContentDate" type="hidden" name="' . $this->GetProperty('id') . '[date]" value="' . $dateSeconds * 1000 . '" />'; $suffix = ''; $timeInput = ''; if ($this->GetProperty('show_clock')) { $timeInput = ' - <select name="' . $this->GetProperty('id') . '[time]">'; $_i = 0; for ($i = $this->GetProperty('start_hour'); $i <= $this->GetProperty('end_hour'); $i += $this->GetProperty('step_hours')) { if ($i < 12 && !$this->GetProperty('show24h')) { $suffix = ' am'; } else { if (!$this->GetProperty('show24h')) { $suffix = ' pm'; } } for ($j = $this->GetProperty('start_minute'); $j <= $this->GetProperty('end_minute'); $j += $this->GetProperty('step_minutes')) { $value = $i * 3600 + $j * 60; if ($this->GetProperty('end_hour') < 23 && $value <= $this->GetProperty('end_hour') * 3600 || $this->GetProperty('end_hour') == 23) { $timeInput .= '<option value="' . $value . '"' . ($value == $timeSeconds ? ' selected="selected"' : '') . '>' . ($i < 10 ? '0' . $i : (!$this->GetProperty('show24h') && $i > 12 ? $i - 12 : $i)) . ':' . ($j < 10 ? '0' . $j : $j) . $suffix . '</option>'; } } $j = $this->GetProperty('start_minute'); } $timeInput .= '</select>'; } return $dateInput . $timeInput; }
<?php //CHANGED Header("Content-type: text/css"); require_once "../include.php"; $theme = get_preference(get_userid(), "admintheme"); if (file_exists(dirname(__FILE__) . "/themes/{$theme}/tab.css")) { echo file_get_contents(dirname(__FILE__) . "/themes/{$theme}/tab.css"); } else { echo file_get_contents(dirname(__FILE__) . "/themes/default/tab.css"); } //STOP
</div> <div class="pageoverflow"> <div class="pagetext"><?php echo lang('admintheme'); ?> :</div> <div class="pageinput"> <?php if ($dir = opendir(dirname(__FILE__) . "/themes/")) { //Does the themedir exist at all, it should... echo '<select name="admintheme">'; while (($file = readdir($dir)) !== false) { if (@is_dir("themes/" . $file) && $file[0] != '.' && is_readable("themes/{$file}/{$file}Theme.php")) { echo '<option value="' . $file . '"'; echo get_preference($userid, "admintheme") == $file ? " selected=\"selected\"" : ""; echo '>' . $file . '</option>'; } } echo '</select>'; } ?> </div> </div> <div class="pageoverflow"> <div class="pagetext"><?php echo lang('admincallout'); ?> :</div> <div class="pageinput">
if (isset($_POST["content_type"])) { $content_type = $_POST["content_type"]; } else { if (isset($existingtypes) && count($existingtypes) > 0) { $content_type = get_site_preference('default_contenttype', 'content'); } else { $error = "No content types loaded!"; } } $contentobj = null; $page_secure = get_site_preference('page_secure', 0); $page_cachable = get_site_preference('page_cachable', "1") == "1" ? true : false; $active = get_site_preference('page_active', "1") == "1" ? true : false; $showinmenu = get_site_preference('page_showinmenu', "1") == "1" ? true : false; $metadata = get_site_preference('page_metadata'); $parent_id = get_preference($userid, 'default_parent', -2); if (isset($_GET["parent_id"])) { $parent_id = $_GET["parent_id"]; } $contentobj = $contentops->CreateNewContent($content_type); $contentobj->SetAddMode(); $contentobj->SetOwner($userid); $contentobj->SetCachable($page_cachable); $contentobj->SetActive($active); $contentobj->SetShowInMenu($showinmenu); $contentobj->SetLastModifiedBy($userid); $templateops = $gCms->GetTemplateOperations(); $dflt = $templateops->LoadDefaultTemplate(); if (isset($dflt)) { $contentobj->SetTemplateId($dflt->id); }
// changing content type updatecontentobj($contentobj); } } } if (strlen($contentobj->Name()) > 0) { $CMS_ADMIN_SUBTITLE = $contentobj->Name(); } // Detect if a WYSIWYG is in use, and grab its form submit action $addlScriptSubmit = ''; foreach (array_keys($gCms->modules) as $moduleKey) { $module =& $gCms->modules[$moduleKey]; if (!($module['installed'] && $module['active'] && $module['object']->IsWYSIWYG())) { continue; } if ($module['object']->WYSIWYGActive() or get_preference(get_userid(), 'wysiwyg') == $module['object']->GetName()) { $addlScriptSubmit .= $module['object']->WYSIWYGPageFormSubmit(); } } $headtext .= <<<EOSCRIPT <script type="text/javascript"> // <![CDATA[ window.Edit_Content_Apply = function(button) { \t{$addlScriptSubmit} \t\$('Edit_Content_Result').innerHTML = ''; \tbutton.disabled = 'disabled'; \tvar data = new Array(); \tdata.push('ajax=1'); \tdata.push('applybutton=1');