GetAuthorTypes() public static method

Get all the author types.
public static GetAuthorTypes ( ) : array
return array An array of AuthorType objects.
 function drawComboContent($id = 0) {
     $types = AuthorType::GetAuthorTypes();
     foreach ($types as $xtype) {
         $combo .=  '<option value="' . $xtype->getId() . '"';
         if ($id == $xtype->getId()) {
             $combo.= ' selected="selected" ';
         }
         $combo .= '>' . $xtype->getName() . '</option>';
     }
     return $combo;
 }
示例#2
0
          <a href="#" class="filter-button"><?php 
echo $translator->trans('Filters', array(), 'users');
?>
</a>
        </div>
        <div class="container">
          <ul class="check-list padded">
            <li>
              <input type="checkbox" name="all_authors" id="all_authors" class="input_checkbox"  checked="checked" onclick="typeFilter(0)" />
              <label for="all_authors"><?php 
echo $translator->trans('All Author Types', array(), 'users');
?>
</label>
            </li>
            <?php 
$types = AuthorType::GetAuthorTypes();
foreach ($types as $type) {
    echo '<li>
                    <input type="checkbox" name="One" value="' . $type->getName() . '" id="author_' . $type->getId() . '" class="input_checkbox checkbox_filter" onclick="typeFilter(' . $type->getId() . ')" />
                    <label for="One">' . $type->getName() . '</label>';
    echo '<a href="?del_id_type=' . $type->getId() . '" onclick="return deleteAuthorType(' . $type->getId() . ')" style="float:right"><img
                  src="' . $Campsite['ADMIN_STYLE_URL'] . '/images/delete.png" border="0" alt="' . $translator->trans('Delete author type', array(), 'users') . '" title="' . $translator->trans('Delete author type', array(), 'users') . '" /></a>';
    echo '</li>';
}
?>
            <li><?php 
echo $translator->trans('Add author type', array(), 'users');
?>
:</li>
            <li>
              <form onsubmit="return addAuthorType()" method="post">
示例#3
0
 private function __getDefaultType()
 {
     $types = AuthorType::GetAuthorTypes();
     foreach ((array) $types as $type) {
         if (strtoupper($type->getName()) === self::DEFAULT_TYPE) {
             return $type->getId();
         }
     }
     return (int) $types[0]->getId();
 }