Exemplo n.º 1
0
 public function buildLinks($fileid)
 {
     $user = new Users();
     $rowSetUsers = $this->getLinkOnAvatar($fileid);
     foreach ($rowSetUsers as $rowUser) {
         $user->set($rowUser);
         Sydney_Search_Files_Result::init($user->getModule(), 'Avatar', $user->get()->id);
         Sydney_Search_Files_Result::add('label', $user->__toString());
         Sydney_Search_Files_Result::add('link', '/adminpeople/index/editindex/id/' . $user->get()->id);
     }
 }
Exemplo n.º 2
0
 public function buildLinks($fileid)
 {
     // links in text bloc
     $rowSetContent = $this->getLinkOnTextBlock($fileid);
     foreach ($rowSetContent as $rowContent) {
         if ($myparent = $this->getParent($rowContent->id)) {
             Sydney_Search_Files_Result::init($myparent->getModule(), 'Text block', $myparent->get()->id);
             Sydney_Search_Files_Result::add('label', $myparent->__toString());
             Sydney_Search_Files_Result::add('link', '/adminpages/pages/edit/id/' . $myparent->get()->id . ($myparent->getModule() == 'adminnews' ? '/emodule/news' : ''));
         }
     }
     // links in content file
     $rowSetContent = $this->getLinkOnContentFile($fileid);
     foreach ($rowSetContent as $rowContent) {
         if ($myparent = $this->getParent($rowContent->id)) {
             Sydney_Search_Files_Result::init($myparent->getModule(), 'File', $myparent->get()->id);
             Sydney_Search_Files_Result::add('label', $myparent->__toString());
             Sydney_Search_Files_Result::add('link', '/adminpages/pages/edit/id/' . $myparent->get()->id . ($myparent->getModule() == 'adminnews' ? '/emodule/news' : ''));
         }
     }
     // links on categories
     $listLinkedFiles = $this->getLinkOnFolder($fileid);
     if (count($listLinkedFiles) > 0) {
         // search if the folder has linked to content
         foreach ($listLinkedFiles as $linkId) {
             $rowSetContent = $this->getLinkOnContentFile($linkId);
             foreach ($rowSetContent as $rowContent) {
                 if ($myparent = $this->getParent($rowContent->id)) {
                     Sydney_Search_Files_Result::init($myparent->getModule(), 'File by category', $myparent->get()->id);
                     Sydney_Search_Files_Result::add('label', $myparent->__toString());
                     Sydney_Search_Files_Result::add('link', '/adminpages/pages/edit/id/' . $myparent->get()->id . ($myparent->getModule() == 'adminnews' ? '/emodule/news' : ''));
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 /**
  * Buils a list of content/resource where a link to the file are found
  * @param $fileid
  * @return array
  */
 public function getLinks($fileid)
 {
     Sydney_Search_Files_Pages_Links::getInstance()->buildLinks($fileid);
     Sydney_Search_Files_Users_Links::getInstance()->buildLinks($fileid);
     return Sydney_Search_Files_Result::get();
 }
Exemplo n.º 4
0
 public static function init($module, $contentType, $key)
 {
     self::$currentModule = $module;
     self::$currentContentType = $contentType;
     self::$currentKey = $key;
 }