Forums | Mahara Community

Developers /
Developig the new plugin


anonymous profile picture
Account deleted
Posts: 92

09 May 2010, 23:17

How to create new  plugin in mahara.

I already see the technical documentation but i can't find much more information.

so please suggest me the step for creating a new plugin.

anonymous profile picture
Account deleted
Posts: 92

09 May 2010, 23:21

What are the function we have to create in new plugin file lib.php.

please Suggest me help.

anonymous profile picture
Account deleted
Posts: 808

10 May 2010, 0:40

Hi,

We don't really have adequate documentation yet I'm afraid; the easiest thing at the moment is probably to copy another plugin's lib.php and remove the functions you don't need.

Here are a couple of examples of contributed artefact plugins which might be useful:

http://wiki.mahara.org/Plugins

http://gitorious.org/mahara-contrib/artefact-pc

anonymous profile picture
Account deleted
Posts: 92

10 May 2010, 1:56

Hello Richard

I already did those thing. i  already install  but  when i click on my personal development plan menu.

there are no fields to display.

so if you have a idea  so you check the lib.php

Here is a code for lib.php.

<?php
/**
 * Mahara: Electronic portfolio, weblog, resume builder and social networking
 * Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
 *                         http://wiki.mahara.org/Contributors
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    mahara
 * @subpackage artefact-internal
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @copyright  (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
 *
 */

defined('INTERNAL') || die();

class PluginArtefactPersonal extends PluginArtefact {

    public static function get_artefact_types() {
        return array(
             'personalplan',
             'plandate',
            'cdate',
            'strength',
            'weakness',
            'opportunities',
            'threats',
            'books',
            'training',
            'weblinks',
            'electronic',
            'others',
            'reflection',
             );
    }

   
    
    public static function get_block_types() {
        return array();
    }

    public static function get_plugin_name() {
        return 'personal';
    }

    public static function menu_items() {
        return array(
                 array(
                'path' => 'myportfolio/mydevelopmentplan',
                'title' => get_string('mydevelopmentplan', 'artefact.personal'),
                'url' => 'artefact/personal/personaldevelopmentplan.php',
                'weight' => 22,
            ),
            
        );
    }
    public static function get_artefact_type_content_types() {
        return array(
            'personalplan'   => array('wysiwyg'),
            'plandate'       => array('text'),
            'cdate'          => array('text'),
            'strength'      => array('wysiwyg'),
            'weakness'      => array('wysiwyg'),
            'opportunities' => array('wysiwyg'),
            'threats'       => array('wysiwyg'),
            'books'         => array('wysiwyg'),
            'training'      => array('wysiwyg'),
            'weblinks'      => array('wysiwyg'),
            'electronic'    => array('wysiwyg'),
            'others'        => array('wysiwyg'),
            'reflection'    => array('wysiwyg'),
        );
    }
    }

   ?>

please reply me.

4 results