Jump to content

MadeMyDay

Members
  • Posts

    371
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by MadeMyDay

  1. I am not sure, but shouldn't this: $user = wire('users'); be: $user = wire('user'); since you don't want all users in that object but the current one?
  2. Are you sure this is correct: $.post('../../../scripts/update.php', $("#profile").serialize(), function(data) { ? Because the starting point for the path in jQuery takes is exactly the one from the adress bar. So this is perhaps not correct. What says Firebug/Inspector console? I think it would be better and more flexible to use: $.post('/scripts/update.php', $("#profile").serialize(), function(data) { if the scripts folder is in the root.
  3. This template was made before the column feature was introduced. So look in the code, the columns have a special class (guess something with "column", I am not at my computer now). Just apply a "float:left;" to that class in the admin's CSS. edit: I think it is the class "InputfieldColumnWidth". Look for that in the ui.css or add this: .Inputfields > li.InputfieldColumnWidth { float: left; clear: none; margin-top: 0; margin-left: 1%; } .Inputfields li.InputfieldColumnWidthFirst { clear: both; margin-left: 0; }
  4. Hi seddass, Go to modules overview and look for the page name input field. Click on it, there you can define the rules for the char replacement. Try to include the Cyrillic characters there.
  5. It will. I want to configure sets where widgets (or whole sets) that can be defined: - global - per role - per permission - per user
  6. So, last one for today. Just threw it on a site I am currently developing which uses the great Futura theme from nikola. It just works and looks good imho (eleminated the sidebar earlier, though):
  7. Since Soma asked what these buttons have to do there: This is just a button module where you can define some individual buttons and url. Like "add news" or even an url to a custom module or whatever:
  8. Sneak Preview (everything configurable, styling mostly controlled by admin theme):
  9. While developing my dashboard module I came across a lot of difficulties when building a configurable filter for selecting pages for the last pages widget. Some things I discovered: "or" filter in native page fields didn't work. Fixed by Ryan in the last commit (Big thanks!): https://github.com/ryancramerdesign/ProcessWire/commit/70093241b2cbfe7cae79f28531c1a5df1a572169 It is was somehow difficult/impossible to use get('/')->find(...). This resulted in weird results where direct children were not in the results array. Should also be fixed (not tested). There is an undocumented selector "has_parent" which looks for a parent up to the root. Quite handy! So "has_parent!=2" removes all admin pages (except admin itself, add id!=2 for that) from a select (thanks @Soma!). The "user" which created the standard pages is not the superuser. This was the reason I doubted my results because I thought the superuser would have created everything. Me stupid. The inputFieldSubmitButton module generates a button which gets doubled in the admin head section. Couldn't find the place where this happens until I found out that this is generated with Javascript. Me stupid again. Important rule for selectors: First "has_parent" (if needed), second "include=all" (if needed), then the other filters. And in the end "sort" and then "limit". Not sure about this, but this works for me, so I have only one selector which seems to be correct. For example the latest pages for a specific user which are not admin pages (and no trash): has_parent!=2,id!=2|7,include=all,created_users_id|modified_users_id=41,sort=-modified,limit=10 Looks easy, but wasn't (at least for me)
  10. some time in the future, yes ;-) Until then just share on GitHub and post here.
  11. what Soma says ;-) Problem is that "OR" can have a different meaning, depending of your are talking or if you are writing code. And there is also a difference between a SQL-"OR" and the field1|field2=x meaning. I was looking for "either created or modified" by a user. While in SQL a created = userid OR modified=userid would be the result I was after, it is something different in PW with field1|field2=x. And it is also something different to use the filter field1=x,field2=x which would be a SQL-"AND". So a solution which would make it possible to use $pages->find(field1=x|field2=x) would be nice (or if it exists, an implementation for native fields).
  12. First post, first module, first awesome Thanks for your module, will try it asap and report.
  13. hehe, you know the "german ernst"? We take everything serious
  14. Sorry, oversaw this: good idea! For which purpose? This is all possible. But I am more looking for PW-related tasks. Something everyone could use for productivity. Certainly possible. But not for a first release. But a good point though: Some "quick edit" features for pages like checking/unchecking checkboxes, publishing etc. Good point
  15. A bit Messaging is not a dashboard's task I think. Comments: Good idea. The widget system is very easy to develop for. Other developers can/SHOULD easily develop widgets for it. I think of the Piwik dashboard widgets. Easy to customize, easy to configure.
  16. Hello everybody, I am developing a dashboard process module with which you are able to configure and display individual widget modules. As a beginning I created a PageList widget with which you can display the page tree (the one from the standard admin home at the moment). I also created a ListPages widget with which you can display all sorts of page lists (like "recent pages", "your recent pages", "latest news" etc.). What I want to know from you is: What what you expect from such a dashboard as additional functionality? I think some sort of statistics would be nice (total pages etc.) but also charts from statistic solutions like GA and Piwik. But beside that? Any suggestions? Edit: While writing this... latest images and latest files also makes sense I guess.
  17. Hey Ryan, thanks! How is the selector supposed to look like? created_users_id=1009|modified_users_id=1009 produces the same result as above (like where created_users_id=1009 AND modified_users_id=1009) created_users_id|modified_users_id=1009 seems to skrew up everything (identically for all results without filter) edit: Not true, generates the same as above. Problem is: I have a more complex environment which also produces weird results when I set a get('/') before filtering. This is the code, I hope it is not too weird, PHP skills are a bit rusty (if ever existed): <?php /** * ProcessWire 'Hello world' demonstration module * * Demonstrates the Module interface and how to add hooks. * * ProcessWire 2.x * Copyright (C) 2010 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://www.processwire.com * http://www.ryancramer.com * */ class WidgetListPages extends Widget { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( // The module'ss title, typically a little more descriptive than the class name 'title' => 'ListPages Widget', // version: major, minor, revision, i.e. 100 = 1.0.0 'version' => 001, // summary is brief description of what this module is 'summary' => 'Widget which shows pages in a table with optional edit and view buttons.', // singular=true: indicates that only one instance of the module is allowed. // This is usually what you want for modules that attach hooks. 'singular' => false, // autoload=true: indicates the module should be started with ProcessWire. // This is necessary for any modules that attach runtime hooks, otherwise those // hooks won't get attached unless some other code calls the module on it's own. // Note that autoload modules are almost always also 'singular' (seen above). 'autoload' => false, ); } public function __construct() { $this->set('sortby', '-created'); $this->set('parentid','/'); $this->set('limit', 10); $this->set('lable', 'title'); $this->set('ownCreated', false); $this->set('ownModified', false); $this->set('restriction', 'page-edit'); $this->set('createNew', false); $this->set('createNewLabel', $this->_('Create new page here')); $this->set('createNewParent', $this->parent); } public function init(){ } public function render(){ $adminUrl = $this->config->urls->admin; $this->filter = 'sort='.$this->sortby.','; $table = $this->modules->get("MarkupAdminDataTable"); $table->setEncodeEntities(false); //show only documents of viewing user if($this->ownCreated===true && $this->ownModified===true){ $this->filter.='created_users_id|modified_users_id=' . $this->user->id . ','; } else { if($this->ownCreated===true) $this->filter.='created_users_id=' . $this->user->id . ','; if($this->ownModified===true) $this->filter.='modified_users_id=' . $this->user->id . ','; } //debug echo $this->filter.'<br>'; // this is the next weird thing: If I apply a parent some pages are missing (the ones directly under the root) $res = wire('pages')->get($this->parentid)->find($this->filter); foreach ($res as $result){ //$output .= $result->title.'<br>'; $table->row(array('<a href="'.$adminUrl.'page/edit/?id='.$result->id.'">'.$result->title.'</a>',$result->modified)); } // apply create new page button? if($this->createNew){ $button = $this->modules->get("InputfieldButton"); $button->type = 'submit'; $button->id = 'submit_new'; $button->value = $this->createNewLabel; $table->action(array('create New' => $adminUrl.'page/add/?parent_id='.$this->createNewParent)); } $this->content = $table->render(); $out = $this->renderWidget(); return $out; } } Sorry for just pasting it, but have to go now. Perhaps you see something I totally miss (probably )
  18. aaaaaaargh [place Homer Simpson DOH here] Thanks Diogo, that's it!
  19. Diogo, this is an interesting approach, thank you! I would extend it to use the toSlug function for the title only for the case if there is no individual name for the other language. And I would automatically create this field with a hook after page save. With that we can use the options of the page name module, hopefully. Thanks again, I will try that!
  20. Hello everybody, following selector doesn't act as expected: created_users_id|modified_users_id=1009 while these two do: modified_users_id=1009 result (page id): 1002,1004,1006 created_users_id=1009 result (page id): 1004 complete statement: wire('pages')->find('created_users_id|modified_users_id=1009') result: 1004 I want to display all pages, which where created OR last modified by the user with ID 1009. For me it seems that this filter runs an AND filter, I just get one result where the user created and modified the page.
  21. @Ryan: Brilliant! Shouldn't something like your text be in the documentation? @Soma: Perfect! That was what I was looking for: public function execute(){ $pl = $this->modules->get("ProcessPageList"); $pl->set('id',1001); // or any other parent page return $pl->execute(); }
  22. Thx for your suggestions @diogo: I think a different tree just for the navigation is not very usable. You first have to create the content and after that create another page somewhere different. If the original page gets unpublished/removed/moved the structure breaks. I think the only possibility to deal with that is to create the navigation tree automagically with hooking after the page save/duplicate/move and populate the page in the navigation tree. That could work... and the user doesn't have to deal with a separate tree. @soma: Hmm, where is the other language on bag-shop.ch? As long as you are using the system on your own, a separate tree is okay. But I think it is hard to explain a client why all the belonging stuff shouldn't be in one place.
  23. Hello everybody, I am evaluating the possibilities of customizing the admin. What I don't understand yet is the difference of a process module and a usual module. What I understand is that a process module is used as a single admin page which is able to get its actions via url segments. But how can I use a process module like the pagelister as a kind of widget in a yet to build admin dashboard? I would like to have some boxes on my dashboard like recent pages, other pages listings and also the page lister on the left. While I would implement the listings as custom modules (or one module with different settings) I am not sure how to use the page lister. Can I use the process module at all? Or do I have to build an own one by duplicating the process module as a starting point?
×
×
  • Create New...