Forums | Mahara Community

Support /
Share access


Wullie's profile picture
Posts: 252

20 August 2012, 6:32

Hi,

When I try to share access with other users/groups, the first option I have in the serach box is to search for Friends to share with (for most work pages, this is my least likely requirement) rather than Users.

I'm guessing it's purely because it's sorted alphabetically, but is their any way that I can change it so that the default is Users?

I don't mind changing a little code (I'd guess in view/access.php), if required.

Thanks

Kristina Hoeppner's profile picture
Posts: 4863

20 August 2012, 8:11

Hello Wullie,

It's only a very small change you have to make. Smile I suspect the default setting is on friends because these are the ones you might search for most often, but of course that depends on whether you use friends much / whether the use is encouraged or not. Here are the steps I took for changing the selected drop-down option:

  1. Search for a unique lang string so you can find the correct file. I searched for "Share with other users and groups" which returned the lang string "otherusersandgroups" in the file htdocs/theme/raw/templates/form/viewacl.tpl
  2. Find the lang string in the template file and look around where there might be something that looks like a drop-down menu. I didn't have to look for long as the three options (friends, groups, users) were in the fieldset. As I don't know which version of Mahara you are using, I can't give you the line numbers. Below please find the updated code.
  3. Move the 'selected="selected"' to the user option and save the file.

And that's what my code looks like now. The option that I moved around is highlighted.

<fieldset id="viewacl-advanced" class="collapsible collapsed cb">
  <legend><a href="" id="viewacl-advanced-show">{{str tag=otherusersandgroups section=view}}</a></legend>
    <div class="fl viewacl-advanced-search">
      <label>{{str tag=search}}</label>
      <select name="type" id="type">
        <option value="friend">{{str tag=friends section=view}}</option>
        <option value="group">{{str tag=groups}}</option>
        <option value="user" selected="selected">{{str tag=users}}</option>
      </select>
      <input type="text" name="search" id="search">
      <button id="dosearch" class="btn-search" type="button">{{str tag=go}}</button>
    </div>
    <table id="results" class="fl">
        <tbody>
        </tbody>
    </table>
    <div class="cb"></div>
</fieldset>

 

Cheers

Kristina

Wullie's profile picture
Posts: 252

20 August 2012, 9:44

Perfect Kristina

Thanks

3 results