Jump to content

Juergen

Members
  • Posts

    1,424
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Juergen

  1. Hello Horst, I have looked into that before I have posted this topic, but I couldnt find the reason on line 8 and 69. <?php /** * Provides the implementation for the PageEditFieldPermission::getModuleConfigInputfields method * */ function PageEditFieldPermissionConfig(array $data) { $inputfields = new InputfieldWrapper(); $f = wire('modules')->get('InputfieldMarkup'); $f->label = 'How to use this module'; $f->attr('name', '_instructions'); $config = wire('config'); $f->value = <<< _OUT <p> To use, create a <a href='{$config->urls->admin}access/permissions/'>new permission</a> and name it <b>page-edit-[field]</b>, replacing [field] with the name of the field you want to limit access to. <em>Better yet, use the tool below to create them for you and save some time.</em> </p> <p> Once your page-edit-[field] permission(s) exist, <a href='{$config->urls->admin}access/roles/'>add them to any roles</a> that you want to have edit access to the field. Roles that have edit access to a page, but do not have the required page-edit-[field] permission will not be able to see or modify the [field] in the page editor. </p> <p>Note that none of this applies to users with the superuser role, as they always have access to edit everything.</p> _OUT; $createPermissions = wire('input')->post->_create_permissions; if($createPermissions) foreach($createPermissions as $name) { $name = wire('sanitizer')->pageName($name); $permission = wire('permissions')->add("page-edit-$name"); $permission->title = "Access to edit the '$name' field"; $permission->save(); wire('modules')->message("Added permission: $permission->name"); } $inputfields->add($f); $f = wire('modules')->get('InputfieldCheckboxes'); $f->attr('name', '_create_permissions'); $f->label = 'Handy tool to create permissions for you'; $f->optionColumns = 3; $f->description = 'Check the box next to each field name you would like this tool to create a permission for you. This is the same thing as going to the Permissions page and creating them yourself, so this is here primarily as a time saver.'; $fields = array('name', 'parent', 'template', 'status'); $notes = ''; foreach(wire('fields') as $field) $fields[] = $field->name; foreach($fields as $name) { if($name == 'pass') continue; if(wire('permissions')->get("page-edit-$name")->id) { $notes .= "$name, "; continue; } $f->addOption($name); } if(!$notes) $notes = "[none yet]"; $f->notes = "Fields that already have permissions: " . rtrim($notes, ", ") . ". " . "Non-superuser roles that have page-edit access will no longer be able to see/edit these fields unless the appropriate permission is assigned to that role. "; $inputfields->add($f); return $inputfields; } Line 8 is function PageEditFieldPermissionConfig(array $data) { and line 69 is the closing bracket at the end
  2. I use the upgrade module - it was not updated via FTP. It seems that PageEditFieldPermission Module doesnt work with the latest version.
  3. After upgrade I got the following error: Compile Error: Cannot redeclare PageEditFieldPermissionConfig() (previously declared in /home/.sites/24/site1275/web/site/modules/PageEditFieldPermission/PageEditFieldPermissionConfig.php:8) (line 69 of /home/.sites/24/site1275/web/site/modules/PageEditFieldPermission/PageEditFieldPermissionConfig.php) This error message was shown because you are logged in as a Superuser. Error has been logged. I upgraded wire and index.php not the htaccess file. At the moment I changed it back to 2.5.24 to get it working. Does anyone struggle with the same problem?
  4. For all users with the same problem: Downloading inputfields.js and the minified version from Github solved the problem. I had slightly different js files in my directory and they have caused the strange behaviour. Thanks to all contributors for their efforts to solve the problem.
  5. If I change $config->debug = true to $config->debug = false in config.php the strange behaviour is back. If I change it back then it works. I will add it to the minified version too because it will be loaded if debug is off. Addition: I have downloaded the latest min-version from Github and now it works also with debug off. I have updated my PW to the latest version but I had another js version - very strange!!!! Now everything works fine.
  6. Yep I think so! ProcessWire Core (Development) ProcessWire dev 2.5.24 2.5.24 Auf dem neuesten Stand But your piece of code was not in my JS file.
  7. This code doesnt add anything to the log files (wheter checked or unchecked). This piece of code solves my problem. Now checkbox fields work as expected as dependency field! Thank you so much for your effort!!!!! From now on you are no longer LostKobrakai - you are BestKobrakai Best regards Jürgen
  8. With condition "0" and checkbox checked: <li style="display: block;" class="Inputfield InputfieldCheckbox Inputfield_facebookaktivation..... With condition "0" and checkbox unchecked: <li style="display: none;" class="Inputfield InputfieldCheckbox Inputfield_facebookaktivation.... Work as expected!! With condition "1" and checkbox checked: <li class="Inputfield InputfieldCheckbox Inputfield_facebookaktivation.... With condition "1" and checkbox unchecked: <li class="Inputfield InputfieldCheckbox Inputfield_facebookaktivation.... As you can see no CSS-inline-style will be added!!
  9. Here is the problem: Field snintegration - Current value: 1 inputfi...s?v=13c (Zeile 20) Field snintegration - Matched? YES inputfi...s?v=13c (Zeile 20) Field snintegration - Current value: 0 inputfi...s?v=13c (Zeile 20) Field snintegration - Matched? NO inputfi...s?v=13c (Zeile 20) ---- inputfi...s?v=13c (Zeile 20) Determined that field "facebookaktivation" should be visible. inputfi...s?v=13c (Zeile 20) Field is already visible. The field is always visible independent if the value matches or not!!!!!! This only happens if I choose the value "1" as condition - with the value "0" it works as expected.
  10. This is from the console: Checkbox is checked: JqueryC...s?v=183 (Zeile 2) ------------------------------------------------------------------- inputfi...s?v=13c (Zeile 20) Field "socialnetworksintro" detected a change to a dependency field! Beginning dependency checks... inputfi...s?v=13c (Zeile 20) ---- inputfi...s?v=13c (Zeile 20) Start Dependency 0 inputfi...s?v=13c (Zeile 20) Condition type: show inputfi...s?v=13c (Zeile 20) Field: socialnetworkactivation inputfi...s?v=13c (Zeile 20) Operator: = inputfi...s?v=13c (Zeile 20) Required value: 1 inputfi...s?v=13c (Zeile 20) Field socialnetworkactivation - Current value: 1 inputfi...s?v=13c (Zeile 20) Field socialnetworkactivation - Matched? YES inputfi...s?v=13c (Zeile 20) ---- inputfi...s?v=13c (Zeile 20) Determined that field "socialnetworksintro" should be visible. inputfi...s?v=13c (Zeile 20) Field is already visible. inputfi...s?v=13c (Zeile 20) ------------------------------------------------------------------- inputfi...s?v=13c (Zeile 20) Field "Inputfield_fieldset1" detected a change to a dependency field! Beginning dependency checks... inputfi...s?v=13c (Zeile 20) ---- inputfi...s?v=13c (Zeile 20) Start Dependency 0 inputfi...s?v=13c (Zeile 20) Condition type: show inputfi...s?v=13c (Zeile 20) Field: socialnetworkactivation inputfi...s?v=13c (Zeile 20) Operator: = inputfi...s?v=13c (Zeile 20) Required value: 0 inputfi...s?v=13c (Zeile 20) Field socialnetworkactivation - Current value: 1 inputfi...s?v=13c (Zeile 20) Field socialnetworkactivation - Matched? NO inputfi...s?v=13c (Zeile 20) ---- inputfi...s?v=13c (Zeile 20) Determined that field "Inputfield_fieldset1" should be hidden. inputfi...s?v=13c (Zeile 20) Field is now hidden. inputfi...s?v=13c (Zeile 20) 1 visibility changes were made. inputfi...s?v=13c (Zeile 20) InputfieldWindowResizeActions() Checkbox is not checked: JqueryC...s?v=183 (Zeile 2) ------------------------------------------------------------------- inputfi...s?v=13c (Zeile 20) Field "socialnetworksintro" detected a change to a dependency field! Beginning dependency checks... inputfi...s?v=13c (Zeile 20) ---- inputfi...s?v=13c (Zeile 20) Start Dependency 0 inputfi...s?v=13c (Zeile 20) Condition type: show inputfi...s?v=13c (Zeile 20) Field: socialnetworkactivation inputfi...s?v=13c (Zeile 20) Operator: = inputfi...s?v=13c (Zeile 20) Required value: 1 inputfi...s?v=13c (Zeile 20) Field socialnetworkactivation - Current value: 1 inputfi...s?v=13c (Zeile 20) Field socialnetworkactivation - Matched? YES inputfi...s?v=13c (Zeile 20) Field socialnetworkactivation - Current value: 0 inputfi...s?v=13c (Zeile 20) Field socialnetworkactivation - Matched? NO inputfi...s?v=13c (Zeile 20) ---- inputfi...s?v=13c (Zeile 20) Determined that field "socialnetworksintro" should be visible. inputfi...s?v=13c (Zeile 20) Field is already visible. inputfi...s?v=13c (Zeile 20) ------------------------------------------------------------------- inputfi...s?v=13c (Zeile 20) Field "Inputfield_fieldset1" detected a change to a dependency field! Beginning dependency checks... inputfi...s?v=13c (Zeile 20) ---- inputfi...s?v=13c (Zeile 20) Start Dependency 0 inputfi...s?v=13c (Zeile 20) Condition type: show inputfi...s?v=13c (Zeile 20) Field: socialnetworkactivation inputfi...s?v=13c (Zeile 20) Operator: = inputfi...s?v=13c (Zeile 20) Required value: 0 inputfi...s?v=13c (Zeile 20) Field socialnetworkactivation - Current value: 1 inputfi...s?v=13c (Zeile 20) Field socialnetworkactivation - Matched? NO inputfi...s?v=13c (Zeile 20) Field socialnetworkactivation - Current value: 0 inputfi...s?v=13c (Zeile 20) Field socialnetworkactivation - Matched? YES inputfi...s?v=13c (Zeile 20) ---- inputfi...s?v=13c (Zeile 20) Determined that field "Inputfield_fieldset1" should be visible. inputfi...s?v=13c (Zeile 20) Field is now visible. inputfi...s?v=13c (Zeile 20) 1 visibility changes were made.
  11. Markups: 1) Checkbox not checked: <input id="Inputfield_socialnetworkactivation" class="FieldtypeCheckbox" name="socialnetworkactivation" value="1" type="checkbox"> 2) Checkbox checked: <input id="Inputfield_socialnetworkactivation" class="FieldtypeCheckbox" name="socialnetworkactivation" value="1" checked="checked" type="checkbox"> As you can see in the source code the value is always 1, the difference is only checked="checked" In the log files no entry!
  12. Outputting the value in frontend shows 1 or 0 as expected. <?php echo $page->mycheckboxfieldname;?> The form is only an admin form to create content in the backend and there I am not able to change the values of the checkboxfield.
  13. Hello @ all, I use a checkbox field to show or hide other fields in my form in the backend. If the checkbox is checked then show the fields. If the checkbox is unchecked then hide the fields. Unfortunately it will only work if I add the following condition to a field which has the field dependency mycheckboxfieldname=0 but it doesnt work if I add mycheckboxfieldname=1 As far as I know the values of checkboxes are 0 and 1 (unchecked and checked) I have no idea why it doesnt work. This case also doesnt work mycheckboxfieldname!=0 I use the latest dev version and the input field dependencies with checkboxes have worked in the past, but now I have troubles. Has anyone an idea?
  14. Issue was fixed by Ryan. $options = $fieldtypes->get('FieldtypeOptions')->getOptions('YOURFIELDNAME'); foreach($options as $option) { echo $option->id; echo $option->value; echo $option->title; } This output all your options (id, value or title). This piece of code doesnt work multilingual. It only outputs the default language. If you have a multilingual site you have to output value and title in the specific language. //get value and title in different languages; if ($user->language->name != 'default') { $title = "title{$user->language}"; $value = "value{$user->language}"; } else { $title = 'title'; $value = 'value'; } $options = $fieldtypes->get('FieldtypeOptions')->getOptions('YOURFIELDNAME'); foreach($options as $option) { echo $option->id; echo $option->$value; echo $option->$title; }; Hope this is useful for others!
  15. hello @ all, I have upgraded to the latest dev version and have tried the new image upload function for the ckeditor. It works quite well but I cant find a button to remove an image from the page if it is not used anymore. Have I missed something or is this not possible? Thanx for your answeres
  16. Damn, Ryans solution doesnt work! $options = $fieldtypes->get('FieldtypeOptions')->getOptions('YOURFIELDNAME'); foreach($options as $option) { echo $option->title; } OR $field = $fields->get('YOURFIELDNAME'); $options = $field->type->getOptions($field); It produces also the error
  17. Maybe this could be a solution posted by Ryan: https://processwire.com/talk/topic/9018-new-options-fieldtype/ I havent tested it, because I am not at home. If it works I write a feedback here. Best regards Jürgen
  18. I found the sequence but I dont understand how to output it at the frontend! /** * Get all options available for the given field * * @param id|string|Field $field Field name, id or object * @return SelectableOptionArray * @throws WireException * */ public function getOptions($field) { return $this->manager->getOptions($field = $this->_getField($field)); } Maybe in a way like this?? $options= $fields->get("fieldname")->????;
  19. Hello at all, I use the new select options fieldtype and I want to output all avaliable options on a frontend template. In my case I want to use it as a list of all kinds of events (internal event, external event,....). With the API calls provided in the documentation I am only be able to output the selected option (fe internal event) but not the whole list. Is there a way to ouput all options fe in a foreach loop? Best regards Jürgen
  20. Stefan, this is awesome. I have updated the module and at the moment I have not detected any problems. I am still testing it further more. Thanks so much!!!!
  21. Hello Stefan, thanks for your contribution (and the awesome module too). Yes it would be great to get the possibility of multilanguage support. At the moment I dont need this function immediately. I am not very familiar with hooks in processwire so I will wait until an update Next time I will post it under the right section, I`ll swear Thanks and best regards Jürgen
  22. hello Henning, as I understand you correct: you mean to create more than one instance of the pdf creation button depending on the language? Mmmhh, I will try this tomorrow but this could be a possible solution. It has to create a pdf file for each language - at the moment only on pdf-file is created (independent of the language). Best regards jürgen
  23. Hello @ all, I have setted up a multilanguage site and the Pages2pdf module provides the pdf for a page only in one language. Has someone tried to get one pdf-document for each language and how? I cant figure out how this could be achieved (if it is possible). Best regards Jürgen
  24. Thank you for your prompt answere!! Yes I know that this could be tricky to find out. As I mentioned I use the sitemap module to create a sitemap in a xml format. This module produces a pure sitmap.xml file. So in this case there cannot be included something before. This module has worked for a long time but now there is also a whitespace at the beginning of the XML opening tag (http://www.juergen-kern.at/sitemap.xml). So in this case I have no influence on creating the output code (no include errors and so on) . This module produce the xml markup code on its own but the whitespace is still there.
  25. Hello @ all, I couldn´t find the cause why I am always getting a white space at the beginning of my source code. <!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="de"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="de"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9" lang="de"> <![endif]--> As you can see there is a white space before the doctype declaration (<!DOCTYPE html>). This leads in pages with RSS-markup to errors, because whitespaces are not allowed there. I have not included anything before!! I dont know when this problem started. I use the sitemap module on my site which produce a XML-page. This module was working for a long time without problems. But in the past I always get errors because of the whitespace. It seems that the whitespace problem started either with an update or with the installation of a module. Unfortunately I cannot figure out what the cause could be. Has someone discovered the same behaviour on his site or has someone an idea how to find out the cause of this problem. Best regards Jürgen
×
×
  • Create New...