Lack of interest Pls move _verifyPrivacyChoice to an DW Helper

  • Thread starter Thread starter ragtek
  • Start date Start date
This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.
R

ragtek

Guest
The method can be used for several checks, where a user can set "view permissions" for his content.

If you would move it to the dw user helper (or an other helper) we could use it, instead of c&p

PHP:
    protected function _verifyPrivacyChoice(&$choice, $dw, $fieldName)
      {
          if (!in_array(strtolower($choice), array('everyone', 'members', 'followed', 'none')))
          {
              $choice = 'none';
          }

          return true;
      }

It would also be awsam to have a subtemplate with
PHP:
                                <select name="{$name}" class="textCtrl autoSize" id="ctrl_allow_receive_news_feed">

<xen:if is="{$showEveryone}">                                    <option value="everyone" {xen:selected "{$selected} == 'everyone' "}>{xen:phrase all_visitors}</option></xen:if>
                                    <option value="members"  {xen:selected "$selected} == 'members'  "}>{xen:phrase members_only}</option>
                                    <option value="followed" {xen:selected "$selected} == 'followed' "}>{xen:phrase people_you_follow_only}</option>
                                </select>

ATM it's really a copy & paste process:P
Just check the account_privacy template and count how often you use the same selectbox (with and without the showEveryone option)
 
Upvote 1
This suggestion has been closed. Votes are no longer accepted.
Next suggestion related to this:
I'm planing to add a new "privacy type".
For this, it would be great if:

1. the new template would include an template hook
2. the method would also include an event listener which passes the array, so we can add own elements without the need to owerwrite the method(if it's possible, don't know , have never tried to extend a datawriter helper)

OR what about a helper method, with an list of all possible privacy types and an options param ( to be able to disable elements (like showEveryone)
 
Top Bottom