Jump to content

kixe

Members
  • Posts

    807
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by kixe

  1. Sometimes this happens sometimes not. Sometimes a second value (multiple) is stored after changing back to the blank value in the single select. The behaviour you described happend after setting options with api. Not if I cleaned everything, saved the field and added new options. Looks a bit buggy ... Everything seems to work correctly if value AND title is assigned.
  2. Not curious at all. You didn't define the variable $siblings. $siblings in the description is meant as the 2nd optional argument in the method nextAll(). If you call the function $page->nextAll() you don't need to set an Argument. Both are optional. If you like to specify one or two Arguments, you should define them. First or single Argument should be a selector string. Second one should be a PageArray. If you want to set only the second Argument you have to set an empty string as first Argument. This should work: <?php $siblings = $pages->find('parent=1'); $solutions = $page->nextAll('',$siblings); foreach ($solutions as $solution) { echo "<a href='{$solution->url}'>{$solution->title}</a>"; } ?>
  3. I couldn't reproduce this result (NULL) and Error. Normally you get NULL if the option doesn' exist. The Error looks strange, since 'value' has the expected type (string). How did you edit the options, via API or in the Fieldsettings? I assume your $job variable is an instance of $page? In the fieldsettings (options) you should find. 6=archive|Archiv No idea ...
  4. If I understand you right you would like to render the field via API and manipulate some field properties (filter_column, filter_selector and filter_value). Following code should work. (not tested) $fieldtype = $modules->get('FieldtypeSelectExtOption'); $field = $fields->get(123); // 123 is the id of the field you have assigned to your page template // set your filter options $field->filter_column = 'id'; $field->filter_selector = '<'; $field->filter_value = 3; $inputfield = $fieldtype->getInputfield($page, $field); echo $inputfield->render();
  5. You don't need the API for that. There is a filter option under the details tab. With the filter you can create a WHERE clause. Example: Lets say you have a database table with an inttype column 'gender' (0=male, 1=female). You want only females as selectable options. Go to the Filter settings select 'gender' for column, the equal operator and 1 as value. Done.
  6. The Field Value of Type FieldtypeOptions is a WireArray. Easy to manipulate as Soma described above. Furthermore you can use all the methods supported by WireArray as described here: http://processwire.com/api/modules/select-options-fieldtype/#manipulating-options-on-a-page and here http://processwire.com/api/arrays/ In case of updating existing page don't forget to set of(false) $page->of(false); $page->form_type = 'Yes'; $page->save();
  7. API to change field settings: $field = $fields->get(164); $value = "newoption\n1=oldoption1\n2=oldoption2"; $module = $modules->get('FieldtypeOptions'); $result = $module->manager->setOptionsString($field, $value, true); var_dump($result); /** * description of function setOptionsString() found in Class SelectableOptionManager.php * Set an options string * * Should adhere to the format * * One option per line in the format: 123=title or 123=value|title * where 123 is the option ID, 'value' is an optional value, * and 'title' is a required title. * * For new options, specify just the option title * (or value|title) on its own line. Options should * be in the desired sort order. * * @param Field $field * @param string $value * @param bool $allowDelete Allow removed lines in the string to result in deleted options? * If false, no options will be affected but you can call the getRemovedOptionIDs() method * to retrieve them for confirmation. * @return array containing ('added' => cnt, 'updated' => cnt, 'deleted' => cnt, 'marked' => cnt) * note: 'marked' means marked for deletion * */
  8. Exactly what I am looking for. Since new page will be created by method renderAddable() in class InputfieldPage and not in FieldtypePage it would be maybe more on the Inputfield side to offer this feature. Especially in case of InputfieldChosenSelect it would be great to have it.
  9. Thanks for this great module. It works perfectly together with my FieldtypeSelectExtOption. I use it also with new Core Module Options. Is there any chance to provide the ability to add options via the Inputfield, like adding pages if used together with FieldtypePage? I know it is more on Ryans side to provide this in his Module. Maybe there is a possibility of an approach from your side too?
  10. # standard install 1. ModulesManager 2. MarkupSimpleNavigation # very useful 3. ProFieldsTable 4. ProFieldsMultiplier # often in use in combination with the 2 preceding 5. InputfieldSelectExtOption
  11. Did you try this one? module http://modules.processwire.com/modules/inputfield-chosen-select/
  12. maybe this could help https://processwire.com/talk/topic/9655-pre-release-remote-backup/?hl=%2Bbackup+%2Bfiles
  13. as I said no need for me now. All assets I have to deal with are stored on my or my customers local machine. But you are right in case of file upload option for visitors file backup is a must.
  14. nothing planned. I think this feature could be useful in case of providing file uploads for frontenduser or so. Until now I have no need for this feature. Maybe tomorrow ...
  15. I am working on this, but hadn't time to do. As a starting point this could help date_default_timezone_set('GMT'); $path = "/home/yoursite/backups"; // full server path to the directory where you want the backup files (no trailing slash) $hrs = 3600; $days = 24 * $hrs; $todaysdate = date('Ymd', time()); // Live Site Cutoff $livecutoff = date('Ymd', (time() - (7*$days))); $target = $path . "/site/" . $todaysdate . ".tar.gz"; $filelist = scandir($path . "/site"); foreach ($filelist as $backupfile) { if (stristr($backupfile, ".tar.gz")) { $filedate = explode('.tar.gz', $backupfile); if ($filedate[0] < $livecutoff) { unlink($path . "/site/" . $backupfile); } } } system("tar --create --preserve --gzip --file=".$target." ~/public_html ~/mail ~/ftpconf",$result); $size = filesize($target); switch ($size) { case ($size>=1048576): $size = round($size/1048576) . " MB"; break; case ($size>=1024); $size = round($size/1024) . " KB"; break; default: $size = $size . " bytes"; break; } This is just a snippet for a first approach, nothing to use as is.
  16. Version update 1.1.0 Extended Module Setting Options Max number of backups Minimum 1, default and maximum 100 (defined in constant MAXFILES). Executed with each cron. Deadline Will remove backups older than selected time interval with each cron. Name format syntax # placeholder for db-name. Use surrounding % to escape date() format. Remove backups from module settings dialog Select how many backups you want to keep in storage. Klick *SAVE* to execute.
  17. @icreation Thanks for reporting. I fixed this. Please update your module to version 1.1.1.
  18. To track changes in module settings I am doing something like this. Is there a better way? static public function getModuleConfigInputfields(array $data) { $modules = wire('modules'); $fields = new InputfieldWrapper(); $defaults = self::getDefaultConfig(); $data = array_merge($defaults, $data); $f = $modules->get("InputfieldText"); $f->attr('name', 'mysetting'); $f->label = __("My Setting Field"); if(isset($_POST['mysetting']) && $_POST['mysetting'] != $data['mysetting']) $f->message(__('Setting Field Value changed to').' '.$_POST['mysetting']); $f->value = $data['mysetting']; $fields->add($f); // other stuff return $fields; }
  19. @LostKobrakai thanks for this information. Didn't know about that.
  20. Usually I add the following lines in my htaccess files. Would be nice to have this or something similar in the core packages. Maybe somebody find this useful. # ----------------------------------------------------------------------------------------------- # OPTIONAL: Redirect users to the non 'www.' version of the site # For example: http://www.processwire.com/ would be redirected to https://processwire.com/ # ----------------------------------------------------------------------------------------------- RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [L,R=301] # ----------------------------------------------------------------------------------------------- # OPTIONAL: Force a redirect to SSL # For example: http://processwire.com/ would be redirected to https://processwire.com/ # ----------------------------------------------------------------------------------------------- # RewriteCond %{SERVER_PORT} !^443$ # RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
  21. Login Notifier doesn't work together with ProcessLogger. ProcessLogger only accept filenames in lowercase letters. It worked after changing this in LoginNotifier: /** * Save log entry * */ protected function saveLog(User $user) { $log = new FileLog($this->config->paths->logs, strtolower(get_class($this))); $log->save($this->parseTags($this->logEntry, $user)); } Furthermore a filename with numbers like '404.txt' doesn't render as expected in ProcessLogger.
  22. Translation Problems Path of 'Datepicker translation file' is set in translation file (json) of inputfield DateTime. File (/wire/modules/Jquery/JqueryUI/i18n/jquery.ui.datepicker-de.js) exist and is accesible. cache cleaned Datepicker still uses default regional settings Need help, any ideas? # Edit 23.04.2015 Problem solved, edited jquery translation by adding timepicker regional settings. (/wire/modules/Jquery/JqueryUI/i18n/jquery.ui.datepicker-de.js). Example below (german) /* German initialisation for the jQuery UI date picker plugin. */ /* Written by Milian Wolff (mail@milianw.de). */ /* edited by kixe: timepicker settings added 23.04.2015 */ jQuery(function($){ $.datepicker.regional['de'] = { closeText: 'schließen', prevText: '<zurück', nextText: 'Vor>', currentText: 'heute', monthNames: ['Januar','Februar','März','April','Mai','Juni', 'Juli','August','September','Oktober','November','Dezember'], monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', 'Jul','Aug','Sep','Okt','Nov','Dez'], dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], weekHeader: 'KW', dateFormat: 'dd.mm.yy', firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['de']); $.timepicker.regional['de'] = { timeText: 'Uhrzeit', hourText: 'Stunde', minuteText: 'Мinute', secondText: 'Sekunde', millisecText: 'Millisekunde', timezoneText: 'Zeitzone', currentText: 'jetzt', closeText: 'schließen', timeFormat: 'HH:mm', isRTL: false }; $.timepicker.setDefaults($.timepicker.regional['de']); });
  23. @kongondo Since it works proper now, please move it. Thanks.
  24. Thanks Adrian, finally it should be: $file = $page->pdf->filename; It doesn't work with url here. Don't know why? Got it: readfile() needs fullpath! Added filesize-header. To force download it should be 'attachment' instead of 'inline' <?php $file = $page->pdf->filename; header('Content-Type: application/pdf'); header('Content-Disposition: attachment; filename="' . basename($file).'"'); header('Content-Length: ' . filesize($file)); readfile($file);
  25. You want to display pdf files as pages in frontend? Go here: Create a template file 'showpdf.php' <?php $file = $page->pdf->filename; header('Content-Type: application/pdf'); header('Content-Disposition: inline; filename="' . basename($file).'"'); header('Content-Length: ' . filesize($file)); readfile($file); Create field 'pdf' of type file and add it to your template. Create a page using the template 'showpdf.php' Add pdf to page field 'pdf'. Done. To get save option instead of display use 'attachment' instead of 'inline' like header('Content-Disposition: attachment; filename="' . basename($file).'"');
×
×
  • Create New...