Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

  • Beginning Developers

    Beginning Developers

    This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking

Activity

  • Kek added a new discussion topic Changing index page to site page created with AnyPage plugin in the group Beginning Developers
    Hi, I've created a site page called 'Home' using the AnyPage plugin so that it is easily editable by other content admins. It resides at /home. I'd like to make it the default index page for the site. I've tried implementing the advice at...
  • Kek replied on the discussion topic Changing bookmark, rss, delete, and like menu items
    Yay! Prods and props :) view reply
  • Kek replied on the discussion topic Changing bookmark, rss, delete, and like menu items
    Thanks, Matt. I had looked at those pages, but was struggling to understand them. So I took your linking to them as a prod to try harder :) Not sure if what I've done is the best way to go about it, but below is my default theme extension's... view reply
  • Kek added a new discussion topic Changing bookmark, rss, delete, and like menu items in the group Beginning Developers
    I've looked through the discussions but can't find a solution to my problem, or at least one that I can grok. I've been making a number of accessibility improvements to the default theme, mostly by extending various views. Now I'm trying to improve...
    • Thanks, Matt. I had looked at those pages, but was struggling to understand them. So I took your linking to them as a prod to try harder :)

      Not sure if what I've done is the best way to go about it, but below is my default theme extension's start.php. Right or wrong, it has the effect I'm after.

      Cheers for the prod.

      <?php

      elgg_register_event_handler('init', 'system', 'cop_init');

      function cop_init() {
         
          elgg_register_plugin_hook_handler('register', 'menu:extras', 'modify_extras_menu');

          elgg_register_plugin_hook_handler('register', 'menu:entity', 'modify_wire_entity_menu');

          elgg_register_plugin_hook_handler('register', 'menu:river', 'modify_river_menu');

          elgg_register_plugin_hook_handler('register', 'menu:widget', 'modify_widget_menu');

          elgg_register_plugin_hook_handler('register', 'menu:annotation', 'modify_annotation_menu');

          elgg_register_plugin_hook_handler('register', 'menu:topbar', 'modify_topbar_menu');

      }

      function modify_extras_menu($hook, $type, $value, $params) {
          foreach ($value as $k => $v) {
              if ($v->getName() == 'bookmark') {
                  $v->setText('<span class="visually-hidden">' . elgg_echo('bookmarks:this') . '</span>' . elgg_view_icon('push-pin-alt'));
              }
              if ($v->getName() == 'rss') {
                  $v->setText('<span class="visually-hidden">' . elgg_echo('feed:rss') . '</span>' . elgg_view_icon('rss'));
              }
          }
          return $value;
      }

      function modify_wire_entity_menu($hook, $type, $value, $params) {
          foreach ($value as $k => $v) {
              if ($v->getName() == 'delete') {
                  $v->setText('<span class="visually-hidden">' . elgg_echo('delete') . '</span>' . elgg_view_icon('delete'));
              }
          }
          return $value;
      }

      function modify_river_menu($hook, $type, $value, $params) {
          foreach ($value as $k => $v) {
              if ($v->getName() == 'delete') {
                  $v->setText('<span class="visually-hidden">' . elgg_echo('delete') . '</span>' . elgg_view_icon('delete'));
              }
          }
          return $value;
      }

      function modify_widget_menu($hook, $type, $value, $params) {
          foreach ($value as $k => $v) {
              if ($v->getName() == 'collapse') {
                  $v->setText('<span class="visually-hidden">Toggle collapsed</span>');
              }
              if ($v->getName() == 'delete') {
                  $v->setText('<span class="visually-hidden">' . elgg_echo('widget:delete', array($params['entity']->getTitle())) . '</span>' . elgg_view_icon('delete-alt'));
              }
              if ($v->getName() == 'settings') {
                  $v->setText('<span class="visually-hidden">' . elgg_echo('widget:edit') . '</span>' . elgg_view_icon('settings-alt'));
              }
          }
          return $value;
      }

      function modify_annotation_menu($hook, $type, $value, $params) {
          foreach ($value as $k => $v) {
              if ($v->getName() == 'delete') {
                  $v->setText('<span class="visually-hidden">' . elgg_echo('delete') . '</span><span class="elgg-icon elgg-icon-delete"></span>');
              }
          }
          return $value;
      }

      function modify_topbar_menu($hook, $type, $value, $params) {
          foreach ($value as $k => $v) {
              if ($v->getName() == 'elgg_logo') {
                  $logo_url = elgg_get_site_url() . "_graphics/elgg_toolbar_logo.gif";
                  $v->setText('<img src="'.$logo_url.'" alt="Elgg" width="38" height="20">');
              }
              if ($v->getName() == 'profile') {
                  $viewer = elgg_get_logged_in_user_entity();
                  $v->setText(elgg_view('output/img', array(
                      'src' => $viewer->getIconURL('topbar'),
                      'alt' => 'My profile',
                      'title' => 'My profile',
                      'class' => 'elgg-border-plain elgg-transition',
                  )));
              }
              if ($v->getName() == 'friends') {
                  $v->setText('<span class="visually-hidden">My friends</span>' . elgg_view_icon('users'));
                  $v->setTooltip('My friends');
              }
              if ($v->getName() == 'messages') {
                  $v->setText('<span class="visually-hidden">My messages</span>' . elgg_view_icon('mail'));
                  $v->setTooltip('My messages');
              }
          }
          return $value;
      }

      ?>

    • Oh, man, I feel like crying!

      I wish everyone would take prods as well as you :)

      For the record, that's exactly the answer.  Well done!

    • Yay! Prods and props :)

  • Kek joined the group Beginning Developers