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]
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.
Take a look at Devkit, it’s a module that’ll spit out a base framework for building EE2 addons.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.