Jump to content

renobird

PW-Moderators
  • Posts

    1,699
  • Joined

  • Last visited

  • Days Won

    14

Everything posted by renobird

  1. A friend reported a few small issues, pushed a few quick updates for API usage.
  2. This module creates a per-page activity log. It's not version control, but it is a history of changes made to all core field types. See the screenshots below for further explanation. It consists of 2 modules: MarkupActivityLog ProcessActivityLogService (handles ajax calls for show old/new values of textareas) More information on github Non-Superusers add an 'activity-log' permission. Thanks Nico, Netcarver, Ryan. MarkupSEO, Field Change Notifier, and FormBuilder where heavily referenced (*cough* copied) at points. Activity Log Tab Changes to textareas show in modal Module configuration
  3. Gazley, I think it's important to have something like a page save, or other button that actually triggers the send. You could trigger it to happen via ajax when the user checks the "send email" checkbox, but that doesn't give them an opportunity to change their mind. The send would be immediate, unless of course you ask for a confirmation in a modal.
  4. Once each notification is marked as read, cron/lazycron could clean them out.
  5. Kongondo, I'm still holding out hope to see your calendar module released. lindquist, looks very nice. I'll take a look later today — thanks for sharing.
  6. Ah, Seems like the least overhead would be to create a separate table for those. The lookups would be quick, even if each topic has hundreds of notifications.
  7. Some quick comments. Repeaters / PageTable seem like far too much overhead. Have you looked at the new comments system on the dev branch? You mentioned temporary storage — do the topics only exist for a short time?
  8. Here's a quick recursive version. Written in the browser and untested. Should give you a solid place to start. <?php function renderAccordion(pageArray $pages){ $out = "<dl class='accordion'>"; foreach ($pages as $page){ $out .= "<dt><a href='$page->url'>$page->title</a></dt>"; $out .= "<dd>"; if ($page->numChildren){ $out .= renderAccordion($page->children()); // go recursive } else $out .= $page->body; } $out .= "</dd>"; } $out .= "</dl>"; return $out; } $items = $pages->find("your_selector"); echo renderAccordion($items); This will just keep going. You could set it to accept a $levels argument that would stop it after a specified depth.
  9. The module I have is too complicated to take apart right now. I have a lot of stuff going on that is specific to my local needs. The easiest way to handle this is to put this in a template. <?php $items = $pages->find('your_selector');?> <dl class="accordion"> <?php foreach ($items as $item):?> <dt><a href="<?php echo $item->url;?>"><?php echo $item->title;?></a></dt> <dd><?php echo $item->body;?></dd> <?php endforeach;?> </dl> Then include your own CSS/JS, or use the CSS/JS from my demo If you need a nested accordion, then it's a little tricker, and would be easier with a recursive function.
  10. I have a local version that does that. Let me see if I can get it cleaned up enough to send you.
  11. As a side note (and to plug my own module), If you just need blocks of text collapsed into an accordion, you can do that with a single textarea and the TextformatterAccordion module.
  12. That's not exactly true. Repeaters do support dependencies, but only for field=value. You have to set 'useDependencies' => false in your config.php — and that can have undesired consequences. I haven't tried this, but instead of setting that in the config file, it might be possible to set it on a per-template basis using a hook.
  13. Unfortunately I'm stuck at 2.5.3 for production sites at work — at least until early May. The current vhost clusters here only have PHP 5.3.3 available. The minimum requirement for PW is PHP 5.3.8, but 5.3.3 still works for the master branch. That's not the case with dev. New infrastructure is just about to be released with PHP 5.5+, and we'll be moving ASAP. In the meantime — I suffer.
  14. Ah, dev branch — of course. Thanks kongondo.
  15. Hey Ryan, Do you mind explaining $page->status(true) a little further? Perhaps I'm a little dense today, but I'm having trouble deciphering where to find the related code in Page.php
  16. Wow. That is nice. I'm storing old/new as part of an activity log module. Currently I was storing the codes, easier to just store the actual labels. Thanks all!
  17. Jan Romero! It is indeed as simple as that. Thank you.
  18. Anyone know of a build in way to take the bitmasked status codes and convert them back to their names/labels? Some of them get converted in ProcessPageEdit I could use that as a starting point and roll my own, but was hoping there was an easier way that I'm not aware of.
  19. It may actually be related to AdminThemeReno and the way the Pages menu item is built. Have you tried it in the default theme? I'll look closer when I can get to a computer later,
  20. Set permission in getModuleInfo() "permission" => "drafts", Create a permission called drafts and assign it to the roles you want to have access. On mobile, sorry for the terse reply.
  21. $q = (int) $input->get->q; Not sure what else you could do to sanitize beyond that.
×
×
  • Create New...