Jump to content

nghi

Members
  • Posts

    57
  • Joined

  • Last visited

Community Answers

  1. nghi's post in Custom Module not appearing under setup was marked as the answer   
    I figured out my problem. 
    I had to uninstall and install my module again and my admin page seem to have been setup improperly in the __install(). Very weird, all I did was move a few lines. Not sure if the ordering matter but the below code work for me. When creating an admin page.
    $p = new Page(); $p->template = $this->templates->get("admin"); $p->name = self::PAGE_NAME; $p->parent = $this->pages->get($this->config->adminRootPageID)->child('name=setup'); $p->process = $this; $p->title = 'Variable Settings'; $p->save();
  2. nghi's post in Cant delete images? was marked as the answer   
    One of my co-workers found the cause for my problem. The suhosin.ini on our server had a max length of 64 characters and we had to increased it to 128. 
  3. nghi's post in Shop-for-processWire - Manage who has access to which modules was marked as the answer   
    Oh figure it out =D!
    I added the permission in the installer and uninstaller function. Then on my client role I gave it the shop_orders permission. (You can also do it manually in the back end)
    public function install() { $permission = $this->permissions->get('shop_orders'); if (!$permission->id) { $p = new Permission(); $p->name = 'shop_orders'; $p->title = $this->_('view Order mangement'); $p->save(); } } public function uninstall() { $permission = $this->permissions->get('shop_orders'); if ($permission->id) { $permission->delete(); } } //Also needed to modified this line and added check_access $orders = $this->pages->find('template=sc-order,limit=20,sort=-created, check_access=0'); I didn't realize that you can set permission in modules in the getModuleInfo()
    public static function getModuleInfo() { return array(   'title' => 'Orders Management',   'summary' => 'Manage Shop orders',   'version' => 002,   'permanent' => false,   'singular' => true,   'permission' => 'shop_orders', <-------   'requires' => array(    "ShoppingCart",    "ShoppingCheckout"   )  );} 
  4. nghi's post in upload bug with image field using inputfield-dependencies? was marked as the answer   
    Ah I see thanks for the link Adrian, it's been 7 months since the last post. =(
    However, I did find a work around =D!

    I remove the dependency off my image field and created a fieldsettab and wrap it around my image field and added the dependency on my fieldsettab.
×
×
  • Create New...