public function onCCK_Storage_LocationPrepareContent(&$field, &$storage, $pk = 0, &$config = array(), &$row = null)
 {
     if (self::$type != $field->storage_location) {
         return;
     }
     // Init
     $table = $field->storage_table;
     // Set
     if ($table == self::$table) {
         $storage = self::_getTable($pk, true);
         $storage->slug = $storage->alias ? $storage->id . ':' . $storage->alias : $storage->id;
         $config['author'] = $storage->{self::$author};
     } else {
         $storage = parent::g_onCCK_Storage_LocationPrepareContent($table, $pk);
         if (!isset($config['storages'][self::$table])) {
             $config['storages'][self::$table] = self::_getTable($pk, true);
             $config['storages'][self::$table]->slug = $config['storages'][self::$table]->alias ? $config['storages'][self::$table]->id . ':' . $config['storages'][self::$table]->alias : $config['storages'][self::$table]->id;
             $config['author'] = $config['storages'][self::$table]->{self::$author};
         }
     }
     if ($config['doSEF'] && isset($row->readmore_link)) {
         $row->readmore_link = self::getRouteByStorage($config['storages'], $config['doSEF'], $config['Itemid'], $config);
         $config['doSEF'] = 0;
     }
 }
Beispiel #2
0
 public function onCCK_Storage_LocationPrepareContent(&$field, &$storage, $pk = 0, &$config = array(), &$row = null)
 {
     if (self::$type != $field->storage_location) {
         return;
     }
     // Init
     $table = $field->storage_table;
     // Set
     if ($table == self::$table) {
         $storage = self::_getTable($pk, true);
         $storage->slug = $storage->alias ? $storage->id . ':' . $storage->alias : $storage->id;
         if (1 == 1) {
             $storage->author_alias = JCckDatabaseCache::loadResult('SELECT b.alias as author_alias FROM #__cck_core AS a' . ' LEFT JOIN #__content AS b ON b.id = a.pkb' . ' WHERE a.storage_location = "joomla_user" AND a.pk = ' . (int) $storage->{self::$author});
         }
         $config['author'] = $storage->{self::$author};
     } else {
         $storage = parent::g_onCCK_Storage_LocationPrepareContent($table, $pk);
         if (!isset($config['storages'][self::$table])) {
             $config['storages'][self::$table] = self::_getTable($pk, true);
             $config['storages'][self::$table]->slug = $config['storages'][self::$table]->alias ? $config['storages'][self::$table]->id . ':' . $config['storages'][self::$table]->alias : $config['storages'][self::$table]->id;
             $config['author'] = $config['storages'][self::$table]->{self::$author};
         }
     }
     if ($config['doSEF'] && isset($row->readmore_link)) {
         $row->readmore_link = self::getRouteByStorage($config['storages'], $config['doSEF'], $config['Itemid'], $config);
     }
 }
Beispiel #3
0
 public function onCCK_Storage_LocationPrepareDelete(&$field, &$storage, $pk = 0, &$config = array())
 {
     if (self::$type != $field->storage_location) {
         return;
     }
     // Init
     $table = $field->storage_table;
     // Set
     $storage = parent::g_onCCK_Storage_LocationPrepareContent($table, $table == '#__cck_core' ? $config['id'] : $pk);
 }
 public function onCCK_Storage_LocationPrepareContent(&$field, &$storage, $pk = 0, &$config = array(), &$row = null)
 {
     if (self::$type != $field->storage_location) {
         return;
     }
     // Init
     $table = $field->storage_table;
     // Set
     if ($table == self::$table) {
         $storage = self::_getTable($pk);
     } else {
         $storage = parent::g_onCCK_Storage_LocationPrepareContent($table, $pk);
         if (!isset($config['storages'][self::$table])) {
             $config['storages'][self::$table] = self::_getTable($pk);
         }
     }
 }