We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New module development

Development and Programming

TrevorNet's avatar
TrevorNet
30 posts
15 years ago
TrevorNet's avatar TrevorNet

I am trying to orient myself towards the creation of new EE2 modules. Right off the bat, I am getting the error “Unable to locate the files needed to install this module”. I was using the emoticon module as my class/method name template. I have set-up:

system/expressionengine/language/english/lang.trevor.php

<?php

$lang = array(

'trevor_module_name' =>
'Trevor',

'trevor_module_description' =>
'Trevor module',

''=>''
);

system/expressionengine/third_party/trevor/mcp.trevor.php

<?php
if ( ! defined('EXT')) {
    exit('Invalid file request');
}

class Trevor_mcp {
    function Trevor_mcp() {
        $this->EE =& get_instance();
    }
}

system/expressionengine/third_party/trevor/mod.trevor.php

<?php
if ( ! defined('EXT')) {
    exit('Invalid file request');
}

class Trevor {
    var $return_data = '';
    function Trevor() {
        $this->EE =& get_instance();
        
    }
}

system/expressionengine/third_party/trevor/udp.trevor.php

<?php
if ( ! defined('EXT')) {
    exit('Invalid file request');
}


class Trevor_upd {

    var $version = '1.0';

    function Trevor_upd() {
        $this->EE =& get_instance();
    }

    function install() {
        $data = array(
                    'module_name' => 'Trevor',
                    'module_version' => $this->version,
                    'has_cp_backend' => 'y'
                    );
        $this->EE->db->insert('modules', $data);
        return TRUE;
    }

    function uninstall()
    {
        $this->EE->db->select('module_id');
        $query = $this->EE->db->get_where('modules', array('module_name' => 'Trevor'));

        $this->EE->db->where('module_id', $query->row('module_id'));
        $this->EE->db->delete('module_member_groups');
        $this->EE->db->where('module_name', 'Trevor');
        $this->EE->db->delete('modules');
        $this->EE->db->where('class', 'Trevor');
        $this->EE->db->delete('actions');
        $this->EE->db->where('class', 'Trevor_mcp');
        $this->EE->db->delete('actions');

        return TRUE;
    }

    function update($current='')
    {
        return FALSE;
    }
}

Am I missing a file? Perhaps in another location?

[Mod Edit: Moved to the Modules forum]

       
TrevorNet's avatar
TrevorNet
30 posts
15 years ago
TrevorNet's avatar TrevorNet

Please! With an EE cherry on top… I’ll head back in and see if I can figure something out.

On a related note, I also find myself neck deep in Joomla development. It would be nice to see an EE tool similar to the Alphaplug’s MVC generator. I would have provided the URL but it was blacklisted.

       
iain's avatar
iain
317 posts
15 years ago
iain's avatar iain

Take a look at Devkit, it’s a module that’ll spit out a base framework for building EE2 addons.

http://github.com/bjornbjorn/devkit.ee_addon

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.