Jump to content

Solved please remove.


devilsown

Recommended Posts

Having issues creating a module. I am trying to get rid of core files that i have hard coded things in and make module that run the code. So i thought i would try with cufon. cufon-yui.js i need this to be in the js area on each page.

 

When i click on install i get the messge module not found

I have this in a foldler called cufon/cufon.php

 

No idea where i goofed.

 

<?php
/*
* 2007-2011 PrestaShop
*
*shortened
*/
if (!defined('_CAN_LOAD_FILES_'))
exit;
class BlockSearch extends Module
{
public function __construct()
{
 $this->name = 'cufon';
 $this->tab = 'front_office_features';
 $this->version = 1.0;
 $this->author = 'DevilsOwn';
 $this->need_instance = 0;
 parent::__construct();

 $this->displayName = $this->l('Cufon Fonts');
 $this->description = $this->l('Adds a cufon to website');
}
public function install()
{
 if (!parent::install() OR !$this->registerHook('top')

  )
  return false;
 return true;
}
public function hookTop($params)
{
 $this->_hookCommon($params);
 return $this->display(__FILE__, 'cufon.tpl');
}
/**
 * _hookAll has to be called in each hookXXX methods. This is made to avoid code duplication.
 *
 * @param mixed $params
 * @return void
 */
private function _hookCommon($params)
{
// Tools::addCSS(_THEME_CSS_DIR_.'cufon.css');
  Tools::addJS(_THEME_JS_DIR_.'cufon-yui.js');
 return true;
}
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...