Skip to content

Commit

Permalink
fixed translations support for modules
Browse files Browse the repository at this point in the history
  • Loading branch information
rdiaztushman committed Jun 29, 2015
1 parent 0f04e95 commit 1383cac
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/Modules/Models/Modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,26 @@ public function translationExists( $lang )
return $item;
}

/**
*
*
* @param string $slug
* @return unknown|boolean
*/
public function slugExists( $slug )
{
$clone = (new static)->load(array('slug'=>$slug, 'type'=>$this->type(), 'language' => $this->lang() ));

if (!empty($clone->id)) {
return $clone;
}

return false;
}

public function getItems($refresh=false)
{
$this->__skip_translatable = true;
$this->__translatable = false;

$items = parent::getItems($refresh);
$lang = \Base::instance()->get('lang');
Expand Down

0 comments on commit 1383cac

Please sign in to comment.