Esempio n. 1
0
 /**
  * @brief Returns the label of this relationship as a singular term.  This uses the 
  * action:singular_label directive from the relationships.ini file if available.  Otherwise
  * it will attempt to singularize the label as recieved from getLabel().
  *
  * @return string
  *
  * @see df_singularize()
  */
 function getSingularLabel()
 {
     $action = $this->_sourceTable->getRelationshipsAsActions(array(), $this->_name);
     if (!isset($action['singular_label'])) {
         $label = $this->getLabel();
         $action['singular_label'] = df_singularize($label);
         $action['singular_label'] = df_translate('tables.' . $this->_sourceTable->tablename . '.relationships.' . $this->_name . '.singular_label', $action['singular_label']);
     }
     return $action['singular_label'];
 }
Esempio n. 2
0
 /**
  * @brief Returns the label for this table as a singular.  Often tables are named as plurals of the 
  * entities they contain.  This will attempt to get the name of the singular entity for
  * use in UI items where referring to the items of the table in singular is more appropriate
  * e.g. New Person.
  *
  * This will use the singular_label directive of the fields.ini file if it is defined.  Otherwise
  * it will try to determine the singular of the label on its own.
  *
  * @return string
  */
 function getSingularLabel()
 {
     if (!@$this->_atts['singular_label']) {
         $this->_atts['singular_label'] = df_singularize($this->getLabel());
     }
     if (!@$this->_atts['singular_label__translated']) {
         $this->_atts['singular_label__translated'] = true;
         $this->_atts['singular_label'] = df_translate('tables.' . $this->tablename . '.singular_label', $this->_atts['singular_label']);
     }
     return $this->_atts['singular_label'];
 }