GetSimple Support Forum
Move components page to pages section - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Move components page to pages section (/showthread.php?tid=6702)



Move components page to pages section - Kida - 2014-09-02

Hi =)

I was already able to
- add the components link to the sidebar of the pages section
- show the pages sidebar on the components page instead of the theme sidebar

But I can't figure out, how to associated the components page with the pages section in terms of tab navigation (it still highlights "theme" here) and, more importantly, permissions. Huh

I need this to work, because some users are not allowed to use the themes section, but should be able to edit components.

Help would really be appreciated! Wink

Best,
Kida


RE: Move components page to pages section - Timbow - 2014-09-02

I think there is a plugin which I think is called Slogans. iirc it allows users to edit text strings like components but keeps them out of the Theme Tab.


RE: Move components page to pages section - Kida - 2014-09-02

Thank you Smile
But unfortunately that's not enough in my case. Slogan seems to be for single phrases only, not for whole paragraphs, let alone html-content. Sad


RE: Move components page to pages section - Kida - 2014-09-02

Figured it out!!
I was just looking for an answer in the admin-folder before... but of course, the permission check it's located in the plugin user-management! Big Grin

PHP Code:
//components.php permissions
if ($current_file == "components.php") {
  if (
$this->mmUserFile('PAGES') == "no") {
      die(
'You Do Not Have Permissions To Access This Page');
  }
        else {

           }


Now I only have to figure out, how to show highlight the pages tab... but that's not that important! Smile

Best,
Kida


RE: Move components page to pages section - Kida - 2014-09-02

DONE! =)

For everyone interested... this is what you have to do, if you want to add "components" to pages instead of theme:

1. install this PlugIn
to add a components link to pages:
http://www.cyberiada.org/cnb/log/add-link-to-components-in-page-manager-getsimple-plugin/

2. edit admin/components.php
search for <? php include('template/sidebar-theme.php'); ?>
and replace it with <? php include('template/sidebar-pages.php'); ?>

3. edit admin/templates/css.php
search for #components .wrapper .nav li a.theme,
and replace it with #components .wrapper .nav li a.pages,

4. update cache file stylesheet.txt
open admin/templates/style.php and comment the lines:
PHP Code:
if (file_exists($cachefile) && time() - 600 filemtime($cachefile) && $cacheme) {
    echo 
file_get_contents($cachefile);
    echo 
"/* Cached copy, generated ".date('H:i'filemtime($cachefile))." '".$cachefile."' */\n";
    exit;

then load the components page in backend. Now "pages" shoud be highlighted instead of "theme". A new stylesheet.txt is written.
If that is working, uncomment the lines above.

5. plugins/user-managment.php
only necessary if you use the plug-in "user-management" and want to deny some users access to the theme section
search for
PHP Code:
// components.php permissions
if ($current_file == "components.php") {
    if (
$this->mmUserFile 'THEME' ) == "no") {
        die ( 
'You Do Not Have Permissions To Access This Page' );
    } else {
    }

and replace THEME with PAGES