Jump to content

Spica

Members
  • Posts

    122
  • Joined

  • Last visited

Everything posted by Spica

  1. I very often need a selector like this$matches = $page->find("parent=1020")->not("template=product"); $matches = $page->find("parent=1020, template!=product"); I have to make sure, that certain pages do not get selected, in this case those with template=product. To avoid to accidentically include these pages I thougt about adding the restricting selector globally by a hook with the possibility to explicitely include it when needed. At the moment I think to 1. hook before 2. supplement arguments(0) with "template!=product" 3. return if in arguments(0) is e.g. a "include=product" (which should be ignored later on by the find method) So, is that a good proccedure or would you recommend another?
  2. Is there any hook after a comment is posted possible? Cannot find any. (Mabye too late)
  3. Well, partly yes, adrian. But it does much more, than I need. And I am not shure if taking features away is easier than building them up.
  4. I'd like a field with user-id bind for pages. e.g. to have comments or simple ratings on pages, so that users can just edit their comment/rating on the page. Any hint how to start?
  5. I'd like this as fieldtype also. Or does anyone has a hint how to place the ratingform/-field at the pageedit form in the be. Would like to integrate user ratings, e.g. in that way the user only sees his own rating to edit.
  6. I am using count($page->buildings) at for a frontendpage and for an adminpage, and do get different values. At the adminpage the unpublished repeaterfields are included. So same code gives an pagearray of 2 and of 5 counts for frontendpage and adminpage. This shows no effect: count($page->buildings->not(Page::statusUnpublished)) How to deal best with that? Edit: Now found this thread with a solution – count($page->buildings->filter("status=1")). But theres no explanation found for that behaviour.
  7. Adding a parent::init(); solved it. <?php class JqueryFooTable extends ModuleJS { public static function getModuleInfo() { return array( 'title' => 'JqueryFooTable', 'version' => 1, 'summary' => 'jQuery plugin to make HTML tables responsive', 'href' => 'http://fooplugins.com/plugins/footable-jquery/', 'icon' => 'smile-o', 'singular' => true, 'autoload' => false, ); } public function init() { parent::init(); $this->config->scripts->append($this->config->urls->siteModules . "JqueryFooTable/footable.js"); $this->config->scripts->append($this->config->urls->siteModules . "JqueryFooTable/footable.filter.js"); } }
  8. I wonder about behavior of module as this: <?php class JqueryFooTable extends ModuleJS { public static function getModuleInfo() { return array( 'title' => 'JqueryFooTable', 'version' => 1, 'summary' => 'jQuery plugin to make HTML tables responsive', 'href' => 'http://fooplugins.com/plugins/footable-jquery/', 'icon' => 'smile-o', 'singular' => true, 'autoload' => false, ); } public function init() { $this->config->scripts->append($this->config->urls->siteModules . "JqueryFooTable/footable.js"); $this->config->scripts->append($this->config->urls->siteModules . "JqueryFooTable/footable.filter.js"); } } I'd expected JqueryFooTable.js to be autoloaded. But with the init function it doesnt, only without init. Is this a proper way to additionaly load js plugins?
  9. Fatal error: Call to a member function attr() on a non-object in /Applications/MAMP/htdocs/ProcessWire-dev/wire/modules/Process/ProcessTemplate/ProcessTemplate.module on line 1014 After some configurations I have this error when I want to open/edit a template. I have no idea at which point of my configuration this was messed up. Does anyone have one?
  10. Thanks. Did it by the db way, had already found the status entries but was not shure, how the entries are working and did also not find anything about it.
  11. with $config->advanced = true, how to uncheck Settings/Status/System (there are two) in a page settings tab. In my system it always gets reset on save.
  12. But what, if I want to have the required messeage only on publishing (and save published) pages but not for save+keep unpublished. To have it in all cases is the default.
  13. Your absolutely right. I just realized the Session: Missing required value alert and not the save before that.
  14. Using the CKEditor with Plugin WordCount (uncommented limit functions), put in wordcountsettings charLimit: 5. As superuser the limit is executed, as a restricted editor this function does not work. showWordCount: true and showCharCount: true are working. Is there a right managment conflict?
  15. After having trouble about reading my own post after some days I trie a new description: I can bind conditions on fields of a template to make it required for saving. What if I want do make it required for publishing but not for saving? So the warning only prohibits me to publish or save published pages but lets work on unpublished pages without required restrictions.
  16. Finally I ended up with this two modules: AdminRestrictPageTree ProcessDashboard
  17. Thank you Ryan for your answere. I already played a bit with the roles and permissions, it was hard to find out how its ment to be. But I still wonder, if the page-edit-created isnt a global permission for all users but superusers instead only for assigned. I found line 135 in pagepermissions.module and did already another post on that.
  18. Thanks Esrch for the review. I changed it to an addhookafter. Concerning the logic of the rightmanagement I would agree with your point. But as you can see in the code from the core the inverted right logic is already implemented with the (not really well documented) edit-page-created permission; or better said restriction. As edit-page-created seems to be set globally for all users (if anyone could confirm that?) I need the restriction just for certain users. With your suggestion I would set the restriction again globally and would have to give the edit-all permission to all other users. I am not sure if I would run into future conflict with rightmanagement but better stick with the original core logic.
  19. So I ended up with an own hook and an additional permission (without page-edit-created permission installed). This should only restrict users with the assigned permission to edit its own created pages. Seems to work. Reviews appreciated. public function init() { if(!$this->user->hasRole("superuser")) $this->addHookAfter('Page::editable', $this, 'checkEditable'); } public function checkEditable(HookEvent $event){ $page = $event->object; if($this->user->hasPermission('page-edit-created-onlyassigned') && $page->created_users_id != $this->user->id) { $event->return = false; } }
  20. pagepermissions.module line 135 // check if the system has a page-edit-created permission installed if(is_null($this->hasPageEditCreated)) $this->hasPageEditCreated = $this->wire('permissions')->get('page-edit-created')->id > 0; if($this->hasPageEditCreated) { // page-edit-created permission is installed, so we have to account for it // if user is not the one that created this page, don't allow them to edit it if($page->created_users_id != $user->id) return false; } as I see it, this ask only for created permission and does not reflect if it is set in a roles profile. So creating that permission is meant to set it globally?
  21. How does page-edit-created works. If I create this permission, all roles exept super user, have no edit access to pages exept their own created ones, drawn or withdrawn this permission in users role has no or same effect. Isnt it supposed to be like restricting the edit permission only if it is drawn to a role? How to give one role all edit permitions and another only edit permissions to their pages?
  22. Is MarkupAdminDataTable also for use at Frontend Webpages? It generates some table output, but does not generate the style and js links as it does in the BE. How to properly include? Can not find any docs about MarkupAdminDataTable.
  23. This is a template's json settining in the db table template/data {"useRoles":1,"editRoles":[1024],"createRoles":[1024],"noChildren":1,"slashUrls":1,"noSettings":1,"modified":1425627737,"tabContent":"Content","roles":[37,1024]} I wonder, how „"noSettings":1“ did get there, I cannot assign any BE-Template-klickable-Setting that makes this entry. Can anyone tell?
×
×
  • Create New...