Example #1
0
 protected function getNameWithoutTrashCanSuffix()
 {
     return Ui\Text::cleanTrashCanSuffix($this->name);
 }
Example #2
0
 public static function onSearchIndex($userField)
 {
     $values = $userField['VALUE'];
     if (!is_array($values)) {
         $values = array($userField['VALUE']);
     }
     $searchData = array();
     $fileIdsForLoad = array();
     $attachedIdsForLoad = array();
     foreach ($values as $value) {
         list($type, $realValue) = self::detectType($value);
         if ($type == self::TYPE_NEW_OBJECT) {
             if (self::isLoadedFile($realValue)) {
                 $searchData[] = self::getFileById($realValue)->getName();
             } else {
                 $fileIdsForLoad[] = $realValue;
             }
         } else {
             $attachedIdsForLoad[] = $realValue;
         }
     }
     unset($value);
     if ($attachedIdsForLoad) {
         $query = AttachedObject::getList(array('select' => array('NAME' => 'OBJECT.NAME'), 'filter' => array('ID' => $attachedIdsForLoad)));
         while ($attachedItem = $query->fetch()) {
             $searchData[] = Ui\Text::cleanTrashCanSuffix($attachedItem['NAME']);
         }
         unset($attachedItem, $attachedIdsForLoad);
     }
     if ($fileIdsForLoad) {
         $query = File::getList(array('select' => array('NAME'), 'filter' => array('ID' => $fileIdsForLoad)));
         while ($fileItem = $query->fetch()) {
             $searchData[] = Ui\Text::cleanTrashCanSuffix($fileItem['NAME']);
         }
         unset($fileItem, $fileIdsForLoad);
     }
     return implode("\r\n", $searchData);
 }
Example #3
0
 protected function getBreadcrumbs()
 {
     $crumbs = array();
     $parts = explode('/', trim($this->arParams['RELATIVE_PATH'], '/'));
     foreach ($this->arParams['RELATIVE_ITEMS'] as $i => $item) {
         if (empty($item)) {
             continue;
         }
         $crumbs[] = array('ID' => $item['ID'], 'NAME' => Ui\Text::cleanTrashCanSuffix($item['NAME']), 'LINK' => rtrim(CComponentEngine::MakePathFromTemplate($this->arParams['PATH_TO_TRASHCAN_LIST'], array('TRASH_PATH' => implode('/', array_slice($parts, 0, $i + 1)) ?: '')), '/') . '/');
     }
     unset($i, $part);
     return $crumbs;
 }