pwFoo
Members-
Posts
708 -
Joined
-
Last visited
Everything posted by pwFoo
-
Ok, thanks for testing I think it would be better to remove url segment check. So developer have the choice how to handle it (for example a simple if / else). I try to build it as simple and flexible as possible...
-
Hi Adrian, is it a problem with the link or because the module isn't approved yet? Sorry my bad! I have to update the documentation. At current version I use url segments! But maybe I change this. Module checks permissions, template isn't an admin template AND url segment /add or /edit. What do you think. Should I remove the url segment check from module and move it to the template (in developers hand)?
-
My goal is to build a community site with a integrated forum. It's a "small" (the community, not to write the modules *g*) hobby project.
-
Not yet released login / register example, because module isn't finished (module name, register features, ...) Released dev / unstable FrontendContentManager (edit / add pages). So you can see FormHelper in action
-
FrontendContentManager: add and edit pages as frontend user
pwFoo replied to pwFoo's topic in Module/Plugin Development
New topic FrontendContentManager. -
FrontendContentManager (unstable / testing) FrontendContentManager is a module based on FormHelper to generate needed page edit / add form via form api. NO sanitizing of form values at the moment!!! edit pages create / add new pages add, replace and remove images Download ProcessWire module page: http://modules.processwire.com/modules/frontend-content-manager Bitbucket Repo: https://bitbucket.org/pwFoo/frontendcontentmanager Version 0.2.0 Required FormHelper (0.7.1+) Usage Example template file <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title><?php echo $page->title; ?></title> <?php // Load FormHelper module and also set wire('fh') variable $fcm = $modules->get('FrontendContentManager'); // edit existing page //$form = $fcm->edit($pages->get('1108')); // add a new page based on a template and a parent object $parent = $pages->get('name=test'); $form = $fcm->add($parent, $parent->template); // jsConfig needed by ckeditor echo $fcm->JsConfig(); // outpunt needed scripts for inputfield modules, ... foreach ($config->styles as $file) { echo "<link type='text/css' href='$file' rel='stylesheet' />\n"; } foreach ($config->scripts as $file) { echo "<script type='text/javascript' src='$file'></script>\n"; } ?> </head> <body> <h1><?php echo $page->title; ?></h1> <?php // output the forom echo $form; ?> </body> </html> *UPDATED TO 0.1.0* At the moment I have no usage for FCM module, but after FormHelper 0.5.2 is finished I've done a quick FCM rewrite. Only few tests done yet! *UPDATED TO 0.2.0* Updated to work with redesigned FormHelper 0.7
-
I know and use Esotalk. It's great and so I migrated a smf forum to it. Flarum is a Option for the future. So I follow the development / kickstarter.
-
I'll release some simple example / unstable dev modules which use FormHelper (login, register, profile, edit & add content)...
-
I know and understand it, but if modules work with minor tweaks also in the frontend... why reinvent the wheel and duplicate such modules? If form action would be changed or configurable the module would work for both. Backend and frontend. How ever. Because it sounds there is no need for the mentioned change I have to build me a solution (based on FormHelper and FrontendContentManager modules it should be done with some lines of code)...
-
After site / server is hacked it's important to collect information about it. Is "only" the webspace affected by the hack? Are files changed? Often code is injected to index.html vor index.php files. But code could also be inserted to the database... Are strange processes running (ps aux). Maybe changes made in system / user environment (search /proc with strange process id). Or emails send? Via URL call or a local spawned process? A new listening port or strange traffic (use tcpdump)? Check logs to find hack attempts and maybe the entry point. If attacker reached root permissions binaries (ls, ps, ...) could be replaced to hide things!
-
I'll write a edit profile module myself if there is no way to get it work, but would be great to use a existing core module
-
Hi, I would use ProcessProfile core module in the fronted that way. if (!$user->isGuest() && $input->urlSegment1 == 'edit') { echo $modules->get('ProcessProfile')->execute(); } Problem is the form action, because after send the form the url segment "edit" is missing. To get it work I have to change the following line (ProcessProfile line 58). // changed $form->attr('action', './'); $form->attr('action', ''); Is there a way to do this without modify a core module? Would be great to make such modules (ProcessProfile, ProcessLogin, ProcessPageEdit, ProcessPageAdd) more flexible for usage in the site frontend.
-
@sforsman Thank you for helping here! Ok, got the way it works. Interesting and nice way. Dependent on the quantity of plugins it could be better, but I should keep it simple first... So I start with a simple conditional autoload (module is installed). Would like to see example code, too. But wouldn't waste your time to write the code
-
A working solution at the moment is a autoload if the main module is installed. 'autoload'=> function() { return wire('modules')->isInstalled('UserFrontendRegister'); }, And add a hook after register process at init(). $this->addHookAfter('UserFrontendRegister::executeRegister',$this,'sendEmail'); I know this solution, but tried to find a way to reduce loading of not needed modules.
-
@sforsman Ok, thanks. So I have to find another way @Soma No problem, thanks for reading and answer here I have a register user module loaded inside a template and now try to (auto-)load an plugin / extension (here an example / test notification module) via conditional autoload. public static function getModuleInfo() { return array( 'title' => 'UserFrontendRegisterNotification', 'summary' => 'Enable Emails to Registration', 'version' => '001', 'requires' => array('UserFrontendRegister'), 'autoload'=> function() { return class_exists('UserFrontendRegister',false); }, ); } The notification module hooks into the register method after a user is successful registered. I wouldn't autoload the register notifications on every page, but if the register module is loaded. So a conditional autoload (see above) looks like the best solution. Unfortunately that way doesn't work Here the example addHook from example module notifications public function init() { $this->addHookAfter('UserFrontendRegister::executeRegister',$this,'sendEmail'); } The conditional autoload should load the notifications module only if the register module is loaded. During init() the submodule / plugin hooks into the "main module". Any other resource friendly method to do that?
-
Hi Soma, I know this post and tried to use Ryans Code example as autoload condition The main module isn't an autoload module. I don't know how PW handles or cache this.
-
Got it! I think not the conditional autoload was the problem, but the main module is loaded after conditional autoload decision...
-
Hello sforsman, please read my first post with Ryans examples I only tested the class_exists function inside a template and it works as expected. As an autoload function inside getModuleInfo() it doesn't work.
-
Yes, should work, but isn't my needed case I need to check if the module is loaded instead of just installed. Here a example class_exists('UserFrontendRegister',false); // return false $modules->get('UserFrontendRegister') class_exists('UserFrontendRegister',false); // return true As autoload condition it could be used to load a register plugin only if the register module / page is active. Use template or page as selector is possible, but not as flexible as a class_exists check.
-
Hi, I would like to build plugins with conditional autoload dependent on loaded modules. Topic: ProcessWire Dev Branch - 3. Conditional autoload modules I tried that simple function code inside getModuleInfo(). [...] 'requires' => array('UserFrontendRegister'), 'autoload'=> function() { return class_exists('UserFrontendRegister',false); }, [...] Class_exists was suggested to check if a module is loaded. That works fine inside a template, but not with my module / autoload function. I think the module is NOT loaded during this code is executed, but I'm not sure... Is such a conditional autoload possible?
-
FrontendContentManager: add and edit pages as frontend user
pwFoo replied to pwFoo's topic in Module/Plugin Development
At the moment FrontendContentManager module (dev, unstable) used to edit and add pages as frontend user. Also add and delete images works. CKeditor doesn't work in regular mode. Inline mode ckeditor is loaded, but text isn't saved (save works fine with simple text field without wysiwyg ?!) jsconfig is set and JqueryCore loaded first. Two questions: How should such a module named? (add, edit and optional delete pages as frontend user)? Any better suggestion than FrontendContentManager (short: FCM)? Form (created via form api with own FormHelper module) is unstyled. Inputfield scripts and styles are loaded, but form / fields still unstyled. Are there some more styles and scripts which be used in the admin section to style forms / edit page? -
At the moment I'm thinking about a correct module name... I split up the module into login & logout register profile (no code yet) Possible addons / plugins like RegisterEmailActivation, ForgotPassword (simple integration with ProcessForgotPassword core module), ... are planned. I renamed the modules to UserFrontendLogin, UserFrontendRegister and UserFrontendProfile and with a own sub directory inside a folder UserFrontend. So it's possible to extend the module collection with plugins and additional functionalities. (also changed Repo: https://bitbucket.org/pwFoo/userfrontend) modules/UserFrontend/ /UserFrontendLogin/UserFrontendLogin.module /UserFrontendRegister/UserFrontendRegister.module /UserFrontendProfile/UserFrontendProfile.module But how should the module collection named? UserFrontend? FrontendUsers? User? ... ? Any suggestions? UPDATE UserFrontendProfile initial commit. Edit profile based on ProcessProfile core module. Profile information / fields will be based on (hidden system) user template.
-
Form processing on front-end, dynamic forms and creating page
pwFoo replied to Vineet Sawant's topic in Getting Started
Released a first dev / unstable module FormHelper for testing... https://processwire.com/talk/topic/7860-module-formhelper/ -
Released a first dev / unstable module FormHelper for testing... https://processwire.com/talk/topic/7860-module-formhelper/
-
FormHelper The redesigned FormHelper extends the InputfieldForm object with additional features. Features The FormHelper module extends the PW form object and simplifies the form handling. create basic PW form object with submit button add form field value handling and sanitizing take care about form submit / error state and processing CKEditor pwImagePlugin field, jsConfig, load form admin styles FormHelperExtra is a submodule to handle additional features. create a form object with fields based on Template, Page, Form objects or field data array form file upload handling (temp page uploads, creation of a hidden storage page) Usage Documentation / examples Repository PW module repo GIT repo ToDo / Issues Issues