Feature requests
some features i would love to see in this app
ability to edit pages from admin dashboard
wysiwyg editor
private pages, password protected
media upload ability
comment system, could use the discussion application for this
ability to edit pages from admin dashboard
wysiwyg editor
private pages, password protected
media upload ability
comment system, could use the discussion application for this
0

Comments
in my custom page:
$perm_manage = Gdn::Session()->CheckPermission('Plugins.CustomPageFood.Manage'); $perm_view = Gdn::Session()->CheckPermission('Plugins.CustomPageFood.View'); if (!($perm_view || $perm_manage)) { exit(); }And in the default.php for the CustomPages plugin I added this:
$PluginInfo['CustomPages'] = array( 'Name' => 'Custom Pages', 'Description' => 'A plugin that lets you add custom pages...', 'Version' => '1', // I added the line below: 'RegisterPermissions' => array( 'Plugins.CustomPageFood.Manage', 'Plugins.CustomPageFood.View' ),A functionality for version rollback and such. A wiki more or less.
Many thanks to share this tip but is it the best way? for do it
now... with v2.0.18.4
the above should work in 2.18.0.4. Can't answer if it is the best way.
Ok, thank you
so, I will try...
Hi!
Could I get more detailed (n00b proof) info, how to add code that dumond posted?
what don't you understand?
The exact lines where to add the code, and if I should wrap it within php -function and if, then how to do it. Sorry, I'm really bad with these. Willing to learn but..
I haven't tested the custom pages aspect - but it does put permissions in your dashboard.
he's saying to the CustomPages plugin - default.php
to this... (this should give you manage and view options for CustomPageFood in the dashboard permissions.
$PluginInfo['CustomPages'] = array( 'Name' => 'Custom Pages', 'Description' => 'A plugin that lets you add custom pages. You need to add them to the "pages" folder of this plugin.', 'Version' => '1', 'RegisterPermissions' =>array('Plugins.CustomPageFood.Manage','Plugins.CustomPageFood.View'), 'Author' => "Mark O'Sullivan", 'AuthorEmail' => 'mark@vanillaforums.com', 'AuthorUrl' => 'http://vanillaforums.com' );and add this to your custom page food.
$perm_manage = Gdn::Session()->CheckPermission('Plugins.CustomPageFood.Manage'); $perm_view = Gdn::Session()->CheckPermission('Plugins.CustomPageFood.View'); if (!($perm_view || $perm_manage)) { exit(); }obviously if food is not your custom page change it accordingly.
Okay, thanks. Seems like I did it right then in a first place. But no new options in the admin and code is visible on the public side.
did you wrap it in php tags?
<?php $perm_manage=Gdn::Session()->CheckPermission('Plugins.CustomPageFood.Manage'); $perm_view = Gdn::Session()->CheckPermission('Plugins.CustomPageFood.View'); if (!($perm_view || $perm_manage)) { exit(); } ?>the options for permissions will show up in each role towards the bottom just before the default category permissions.
Of course not!
To be honest, I kept just staring the part
<?php if (!defined('APPLICATION')) exit(); ?>and wondering, were exactly is the place to add this other function.At least something happened since there's a WSOD now. No new permissions in the admin thou.
This is what I used:
<?php $perm_manage=Gdn::Session()->CheckPermission('Plugins.CustomPageFaqs.Manage'); $perm_view = Gdn::Session()->CheckPermission('Plugins.CustomPageFaqs.View'); ?>What exactly is you goal. to only have people logged in, able to view it?
in that case you could just check for (and forget about the mods to plugin).
$Session = Gdn::Session(); // this tests to see is user is logged in if ($Session->IsValid()) { // do the faq stuff } else { // display you don't have permission to view.}
Yes, just to set that page visible for logged in members only. Most ideal would be, if menu link also is hidden. I think it's often just more user friendly to hide things completely than give those 'You don't have permission to...' -messages.
How did you add it to the menu in the first place?
It is included in Air theme default.master.php,
$this->Menu->AddLink('FAQS', T('FAQS'), '/faqs');