• Content count

  • Joined

  • Last visited

Community Reputation

2 Neutral

1 Follower

About Mirza

  • Rank
    Jr. Member
  • Birthday February 7

Profile Information

  • Gender
  • Location
    Dubai, United Arab Emirates

Recent Profile Visitors

296 profile views
  1. Mirza

    Thanks @DaveP @Pixrael @adrian for your answers. Immediate after login I need to execute a javascript, but that didn't happened with admin custom files module or I am not adding the correct Process currently added ProcessLogin But it is not triggering. worst part is when i click logout, its adding the login script. Any help will be appreciated.
  2. Hi All, Is it possible to add GA scripts to admin panel pages, so that we can track all the users login/logout and each(edit) page duration per user using GA scripts. Please let me know your suggestions. Thanks in advance.
  3. Hi Webhoes, Hope you are doing good Please find the below corrected piece of code. <?php namespace ProcessWire; /** * @global Sanitizer $sanitizer * @global Inputfield $input * @global Page $page * @global Page $pages */ //if user has send a form you can use $input rather that $_POST if ($input->post->aFormFieldName) { //create page if form submitted $p = new Page(); $p->setOutputFormatting(false); $p->parent = $sanitizer->selectorField($_POST['country']);//Country should exists in the page tree $p->template = 'population'; // example template $p->title = $sanitizer->pageName($input->post->name); $p->name = $sanitizer->pageName($input->post->name); $p->email = $sanitizer->pageName($input->post->email); $p->body = $sanitizer->text($input->post->body); $p->save(); echo "page ID {$p->id} created!<br>"; return; // stop with template code here } ?> <h4>Add a sighting</h4> <form method="post" action='<?php echo $page->url; ?>'> Location <input type="text" name="name"><br> Country <select name="country"> <?php foreach ($pages->get(1022)->children as $country) { echo '<option value="' . $country->id . '>' . $country->title . '</option>'; } ?> </select> Subspecie <select name="subspecie"> <?php foreach ($pages->get(1027)->children as $subspecie) { echo '<option value="' . $subspecie->id . '>' . $subspecie->title . '</option>'; } ?> </select> Remark <input type="text" name="body"> E-mail: <input type="text" name="email"><br> <input type="submit" name="aFormFieldName" /> </form> Please check if it helps.
  4. Hi All, I am trying to include the unit tests into our project which is in Processwire(I love it). Directory structure for the same will be shown below Here PWTestCase.php is the parent file where it is getting inherited from the PHPUNIT framework TestCase class and It is in same namespace ProcessWire; as shown below Now I have a basic unit test(FuncTest.php as shown below) to check the language calling the function getLanguage() residing in site/templates/_func.php. ***when try to run this test, getting undefined function getLanguage as shown below*** Since I am using namespace ProcessWire; & bootstraping processwire in PWTestCase why i am not able to access functions? Can you please suggest where i am going wrong? Thanks in advance.
  5. Thanks for the response, But that didn't work, page name should be in english. Trying for another solution.
  6. Thanks for the quick reply, I ran out with some issues earlier with php 7.1. Let me try one more time.
  7. Any plans to support for processwire with php 7?
  8. Hi All, Arabic content changes not available in page getChanges method While editing the page from admin panel in the multi-language field, added a hook to save the changes made to the page. $this->pages->addHookAfter('saveReady', $this, 'hookUpdateLog'); public function hookUpdateLog(HookEvent $event) { $page = $event->arguments[0]; if(in_array($page->template->name, $this->templateList)) { $this->logFieldChanges($page); } } public function logFieldChanges($page) { $changes = $page->getChanges(); //This changes does not contain the field of arabic changes. } Please let me know, If I am approaching in a right way.
  9. Support for Multi-Language field in Module: Import Pages from CSV file Is there a support for multi language field import option from csv? If yes, what will be the structure for csv file data. Case scenario: I have title field which is multi-language field(English & Arabic). business|بزنيس club|كلوب deluxe|ديلوكس duplex|دوبلكس
  10. How to track user active time based on session login and logout. Basically, I want to get the report that each user login time and logout time/session inactivity time. Is there any module available or we can use any hooks to simulate the above. Thanks in advance for your support.
  11. Hi Robin S, Thank you for the reply, Let me try this.
  12. Mirza

    I have not set any value to the publish field on page save, I do checked the pages table schema which has default null value. Might be any module which has a hook will be affecting, Let me give a try.
  13. In a lister find, published column is showing a string as shown in attached screenshot. Can we change the date format to yyyy-mm-dd or any other?
  14. Hi All, I have created a script which will create the pages and it should be unpublished. I have added the status as unpublished by default while first time saving the page as below. $hotelPage->hotel_website = $hotel['hotelWebsite']; // By default page created will be unpublished state $hotelPage->addStatus(Page::statusUnpublished); $hotelPage->save(); $hotelPage->setOutputFormatting(false); // Add hotel images only after setting output formatting to false $hotelPage->images->add($hotel['hotelImage']); $hotelPage->save(); On the same time, saving the hotel image as well and triggering the save method. But when I see the created page in the tree, Its shows unpublished but publish_date is not empty(date will be present as created, modified and published are all same) Now I don't understand why the date is getting filled into the publish field for a page? Please let me know if am doing something wrong.