示例#1
0
 function modify($tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$value, $namedParameters, $placement)
 {
     switch ($operatorName) {
         case $this->Alphabet:
             $alphabet = eZAlphabetOperator::fetchAlphabet();
             $value = $alphabet;
             break;
     }
 }
 /**
  * Creates an SQL part to match objects with a name starting with $filter
  *
  * If $filter is "others", the SQL part will match only names which do NOT start with a letter from the
  * alphabet.
  *
  * @see eZAlphabetOperator::fetchAlphabet()
  *
  * @param string $filter
  * @return string
  */
 static function createObjectNameFilterConditionSQLString($filter)
 {
     if (!$filter) {
         return '';
     }
     $db = eZDB::instance();
     if ($filter == 'others') {
         $alphabet = eZAlphabetOperator::fetchAlphabet();
         $sql = '';
         foreach ($alphabet as $letter) {
             $sql .= " AND ezcontentobject_name.name NOT LIKE '" . $db->escapeString($letter) . "%' ";
         }
         return $sql;
     }
     $objectNameFilterSQL = " AND ezcontentobject_name.name LIKE '" . $db->escapeString($filter) . "%'";
     return $objectNameFilterSQL;
 }