public function init() { //load module settings $module_d2messages = Yii::app()->getModule('d2messages'); if ($module_d2messages->write) { if (isset($module_d2messages->write['recipient'])) { $this->recipient = $module_d2messages->write['recipient']; } } //load recipient names if ($this->recipient && $this->recipient_names === false) { $this->recipient_names = array(); if (in_array('person_user', $this->recipient)) { $persons = PprsPerson::getPersonsUsers(); foreach ($persons as $row) { $this->recipient_names[] = $row['full_name']; } } if (in_array('roles', $this->recipient)) { $roles = Yii::app()->getModule('user')->UserAdminRoles; $this->recipient_names = array_merge($this->recipient_names, $roles); } } $this->initCss(); $this->initJs(); }
public function init() { $persons = array(); if (in_array('person_user', $this->recipient)) { $persons = PprsPerson::getPersonsUsers(); } $roles = array(); if (in_array('roles', $this->recipient)) { $roles = Yii::app()->getModule('user')->UserAdminRoles; } }