Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Badges

Try Vanilla Forums Cloud product

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Update for critical security issue in PHPMailer included in release Vanilla 2.3.1

terabytefrelance New

About

Username
terabytefrelance
Joined
Visits
5
Last Active
Roles
Member
Points
21
Badges
3
  • Re: Pockets Panel Position Index

    @vrijvlinder @r_j

    It is extremely simple, with the widgets module, and this we can have all the modules in an orderly way and with the permissions as if it were a plugin

    Config Widget Plugin: default.php:

    $PluginInfo['Widgets'] = array(
         'Name' => 'Widgets',
         'Description' => "This plugin adds modules/widgets you create to the panel . ",
         'Version' => '1.1',
         'RegisterPermissions' => array('Plugins.Widgets.Twitter.View', 'Plugins.Widgets.Facebook.View', 
         'Plugins.Widgets.Youtube.View'), ---> Permissions Modules Widgets.
         'Author' => "VrijVlinder",
         'AuthorEmail' => 'contact@vrijvlinder.com',
         'AuthorUrl' => "http://www.vrijvlinder.com"
    );
    

    // Check Permissions: class.twittermodule.php

    public function AssetTarget() {
        $Session = Gdn::Session();
        if ($Session->CheckPermission('Plugins.Widgets.Twitter.View')) {
            return 'Panel';
        }
    } 
    

    Thank you very much indeed, I hope you can modify your plugin so that more people can see it and learn more about Vanilla Forum, that's what makes free software really powerful when they are well thought out.

    vrijvlinder
  • Re: Pockets Panel Position Index

    @vrijvlinder I have created the function to see for the widgets addon, in a simple way, so that they are seen by roles, of course it would be interesting to do it by module:

    Code:

    Modify default.php --> addon widget

    $PluginInfo['Widgets'] = array(
         'Name' => 'Widgets',
         'Description' => "This plugin adds modules/widgets you create to the panel . ",
         'Version' => '1.1',
         'RegisterPermissions' => array('Plugins.Widgets.View'), ---> Add Permission for Role.
         'Author' => "VrijVlinder",
         'AuthorEmail' => 'contact@vrijvlinder.com',
         'AuthorUrl' => "http://www.vrijvlinder.com"
    );
    

    Modify class.twittermodule ---> Widget Twetter Feed.

    <?php if (!defined('APPLICATION')) exit();
    
        class TwitterModule extends Gdn_Module {
    
        public function AssetTarget() {
            $Session = Gdn::Session();
            if ($Session->CheckPermission('Plugins.Widgets.View')) { ---> Check Permission for Role.
                return 'Panel';
             }
         } 
    
         public function ToString() {
    
             echo '<div class="Box" id="Twitter"><h4>Twitter Feed</h4>
                 <a class="twitter-timeline" data-lang="es" data-dnt="true" data-theme="dark" data-tweet-limit="1" 
                  href="https://twitter.com/UserTwitter">Tweets by UserTwitter</a> 
                 <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
             </div>';
         }
    }
    

    Any suggestions, I have tried and it works well,

    Regards,

    vrijvlinder