<?php

class Zend_View_Helper_GetCategoriasAgendas extends Zend_View_Helper_Abstract {
  

  /**
   *
   * @param integer $language_id
   * @return Array
   */
  public function getCategoriasAgendas($obra_id = 0,$minus = null){
    // index all languages
    $model = new Model_Agendas_Categorias();
      $tags = $model->getAll();
      $txt = '';
      foreach ($tags as $key => $value) {
        $selected = "";
        if ( $value->id == $obra_id) {          
          $selected = " selected='selected' ";
        }
        if (!empty($minus) &&  in_array($value->id, $minus)) {
          
        }else{
          $txt .="<option value='".$value->id."' ".$selected.">".$value->title."</option>";
          
        }
      }
    
    if ($txt=='' && !empty($minus)) {
      $txt .="<option value=''>Todos os livros ja foram adicionados</option>";
    }
    return $txt;
  }

}