<?php

$Depts = array();
foreach($Departments as $Dept)
{
    if(!(bool)$Dept->disabled)
        $Depts[] = $Dept->name;
}

$this->Admin->section(__('Departments', 'awesome-live-chat'))
->add('textbox', array(
    'x' => 2,
    'title' => __('Chat Departments', 'awesome-live-chat'),
    'id'    => 'alc_settings_departments',
    'name'  => 'alc_settings[departments]',
    'help'  => __('To add a department, type a name and hit return.<br> Note: You will have to assign the department to operators in their respective user profile page as well.', 'awesome-live-chat'),
    'value' => implode(',', $Depts)
));
