ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilBibliographicSetting Class Reference

Class ilBibliographicSetting. More...

+ Inheritance diagram for ilBibliographicSetting:
+ Collaboration diagram for ilBibliographicSetting:

Public Member Functions

 getConnectorContainerName ()
 
 generateLibraryLink (ilBibliographicEntry $entry, $type)
 
 getButton (ilObjBibliographic $bibl_obj, ilBibliographicEntry $entry)
 
 getId ()
 
 setId ($id)
 
 getImg ()
 
 setImg ($img)
 
 getName ()
 
 setName ($name)
 
 getShowInList ()
 
 setShowInList ($show_in_list)
 
 getUrl ()
 
 setUrl ($url)
 
- Public Member Functions inherited from ActiveRecord
 getArConnector ()
 
 getArFieldList ()
 
 getConnectorContainerName ()
 
 setConnectorContainerName ($connector_container_name)
 
 getPrimaryFieldValue ()
 
 setPrimaryFieldValue ($value)
 
 __construct ($primary_key=0, arConnector $connector=NULL)
 
 storeObjectToCache ()
 
 __getConvertedDateFieldsAsArray ($format=NULL)
 
 __asCsv ($separator=';', $header=false)
 
 __asArray ()
 
 __asStdClass ()
 
 __asSerializedObject ()
 
 buildFromArray (array $array)
 
 sleep ($field_name)
 
 wakeUp ($field_name, $field_value)
 
 getArrayForDb ()
 
 getArrayForConnector ()
 
 installConnector ()
 
 store ()
 
 save ()
 
 create ()
 
 copy ($new_id=0)
 
 afterObjectLoad ()
 
 read ()
 
 update ()
 
 delete ()
 
 __call ($name, $arguments)
 

Static Public Member Functions

static returnDbTableName ()
 
static getAll ()
 
- Static Public Member Functions inherited from ActiveRecord
static returnDbTableName ()
 
static installDB ()
 
static renameDBField ($old_name, $new_name)
 
static tableExists ()
 
static fieldExists ($field_name)
 
static removeDBField ($field_name)
 
static updateDB ()
 
static resetDB ()
 
static truncateDB ()
 
static flushDB ()
 
static preloadObjects ()
 
static additionalParams (array $additional_params)
 
static findOrFail ($primary_key, array $add_constructor_args=array())
 Tries to find the object and throws an Exception if object is not found, instead of returning null. More...
 
static findOrGetInstance ($primary_key, array $add_constructor_args=array())
 
static where ($where, $operator=NULL)
 
static innerjoinAR (ActiveRecord $ar, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static innerjoin ($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static leftjoin ($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static orderBy ($orderBy, $orderDirection='ASC')
 
static dateFormat ($date_format='d.m.Y - H:i:s')
 
static limit ($start, $end)
 
static affectedRows ()
 
static count ()
 
static get ()
 
static debug ()
 
static first ()
 
static getCollection ()
 
static last ()
 
static getFirstFromLastQuery ()
 
static connector (arConnector $connector)
 
static raw ($set_raw=true)
 
static getArray ($key=NULL, $values=NULL)
 
static _toCamelCase ($str, $capitalise_first_char=false)
 

Data Fields

const TABLE_NAME = 'il_bibl_settings'
 
- Data Fields inherited from ActiveRecord
const ACTIVE_RECORD_VERSION = '2.0.7'
 

Protected Attributes

 $id
 
 $name
 
 $url
 
 $img
 
 $show_in_list
 
- Protected Attributes inherited from ActiveRecord
 $ar_safe_read = true
 
 $connector_container_name = ''
 

Private Member Functions

 formatAttribute ($a, $type, $attributes, $prefix)
 

Additional Inherited Members

- Protected Member Functions inherited from ActiveRecord
 serializeToCSV ($field)
 This method is called for every field of your instance if you use __asCsv. More...
 
 installDatabase ()
 
- Static Protected Member Functions inherited from ActiveRecord
static getCalledClass ()
 
static fromCamelCase ($str)
 

Detailed Description

Member Function Documentation

◆ formatAttribute()

ilBibliographicSetting::formatAttribute (   $a,
  $type,
  $attributes,
  $prefix 
)
private
Parameters
String$a
String$type
Array$attributes
String$prefix
Returns
String

Definition at line 176 of file class.ilBibliographicSetting.php.

Referenced by generateLibraryLink().

176  {
177  if ($type = 'ris') {
178  switch ($a) {
179  case 'ti':
180  $a = "title";
181  break;
182  case 't1':
183  $a = "title";
184  break;
185  case 'au':
186  $a = "author";
187  break;
188  case 'sn':
189  if (strlen($attributes[$prefix . "sn"]) <= 9) {
190  $a = "issn";
191  } else {
192  $a = "isbn";
193  }
194  break;
195  case 'py':
196  $a = "date";
197  break;
198  case 'is':
199  $a = "issue";
200  break;
201  case 'vl':
202  $a = "volume";
203  break;
204  }
205  } elseif ($type = 'bib') {
206  switch ($a) {
207  case "number":
208  $a = "issue";
209  break;
210  case "year":
211  $a = "date";
212  break;
213  }
214  }
215 
216  return $a;
217  }
+ Here is the caller graph for this function:

◆ generateLibraryLink()

ilBibliographicSetting::generateLibraryLink ( ilBibliographicEntry  $entry,
  $type 
)
Parameters
ilBibliographicEntry$entry
string$type(bib|ris)
Returns
string

Definition at line 98 of file class.ilBibliographicSetting.php.

References formatAttribute(), ilBibliographicEntry\getAttributes(), ilBibliographicEntry\getType(), and getUrl().

Referenced by getButton().

98  {
99  $attributes = $entry->getAttributes();
100  switch ($type) {
101  case 'bib':
102  $prefix = "bib_default_";
103  if (!empty($attributes[$prefix . "isbn"])) {
104  $attr = Array( "isbn" );
105  } elseif (!empty($attributes[$prefix . "issn"])) {
106  $attr = Array( "issn" );
107  } else {
108  $attr = Array( "title", "author", "year", "number", "volume" );
109  }
110  break;
111  case 'ris':
112  $prefix = "ris_" . strtolower($entry->getType()) . "_";
113  if (!empty($attributes[$prefix . "sn"])) {
114  $attr = Array( "sn" );
115  } else {
116  $attr = Array( "ti", "t1", "au", "py", "is", "vl" );
117  }
118  break;
119  }
120 
121  $url_params = "?";
122  if (sizeof($attr) == 1) {
123  $url_params .= $this->formatAttribute($attr[0], $type, $attributes, $prefix) . "=" . urlencode($attributes[$prefix . $attr[0]]);
124  } else {
125  foreach ($attr as $a) {
126  if (array_key_exists($prefix . $a, $attributes)) {
127  if (strlen($url_params) > 1) {
128  $url_params .= "&";
129  }
130  $url_params .= $this->formatAttribute($a, $type, $attributes, $prefix) . "=" . urlencode($attributes[$prefix . $a]);
131  }
132  }
133  }
134 
135  // return full link
136  $full_link = $this->getUrl() . $url_params;
137 
138  return $full_link;
139  }
formatAttribute($a, $type, $attributes, $prefix)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAll()

static ilBibliographicSetting::getAll ( )
static
Returns
ilBibliographicSetting[]

Definition at line 87 of file class.ilBibliographicSetting.php.

Referenced by ilDataBibliographicRecordListTableGUI\fillRow(), ilBibliographicDetailsGUI\getInstance(), and ilObjBibliographicAdminLibrariesGUI\initTable().

87  {
88  return self::get();
89  }
+ Here is the caller graph for this function:

◆ getButton()

ilBibliographicSetting::getButton ( ilObjBibliographic  $bibl_obj,
ilBibliographicEntry  $entry 
)
Parameters
ilObjBibliographic$bibl_obj
ilBibliographicEntry$entry
Returns
string

Definition at line 148 of file class.ilBibliographicSetting.php.

References generateLibraryLink(), ilObjBibliographic\getFiletype(), getImg(), ilImageLinkButton\getInstance(), and ilLinkButton\getInstance().

148  {
149  if ($this->getImg()) {
150  require_once('./Services/UIComponent/Button/classes/class.ilImageLinkButton.php');
151  $button = ilImageLinkButton::getInstance();
152  $button->setUrl($this->generateLibraryLink($entry, $bibl_obj->getFiletype()));
153  $button->setImage($this->getImg(), false);
154  $button->setTarget('_blank');
155  return $button->render();
156  } else {
157  require_once('./Services/UIComponent/Button/classes/class.ilLinkButton.php');
158  $button = ilLinkButton::getInstance();
159  $button->setUrl($this->generateLibraryLink($entry, $bibl_obj->getFiletype()));
160  $button->setTarget('_blank');
161  $button->setCaption('bibl_link_online');
162 
163  return $button->render();
164  }
165  }
generateLibraryLink(ilBibliographicEntry $entry, $type)
+ Here is the call graph for this function:

◆ getConnectorContainerName()

ilBibliographicSetting::getConnectorContainerName ( )
Returns
string

Definition at line 31 of file class.ilBibliographicSetting.php.

31  {
32  return self::TABLE_NAME;
33  }

◆ getId()

ilBibliographicSetting::getId ( )
Returns
mixed

Definition at line 223 of file class.ilBibliographicSetting.php.

References $id.

223  {
224  return $this->id;
225  }

◆ getImg()

ilBibliographicSetting::getImg ( )
Returns
mixed

Definition at line 239 of file class.ilBibliographicSetting.php.

References $img.

Referenced by getButton().

239  {
240  return $this->img;
241  }
+ Here is the caller graph for this function:

◆ getName()

ilBibliographicSetting::getName ( )
Returns
mixed

Definition at line 255 of file class.ilBibliographicSetting.php.

References $name.

◆ getShowInList()

ilBibliographicSetting::getShowInList ( )
Returns
mixed

Definition at line 271 of file class.ilBibliographicSetting.php.

References $show_in_list.

◆ getUrl()

ilBibliographicSetting::getUrl ( )
Returns
mixed

Definition at line 287 of file class.ilBibliographicSetting.php.

References $url.

Referenced by generateLibraryLink().

287  {
288  return $this->url;
289  }
+ Here is the caller graph for this function:

◆ returnDbTableName()

static ilBibliographicSetting::returnDbTableName ( )
static
Returns
string
Deprecated:

Definition at line 23 of file class.ilBibliographicSetting.php.

23  {
24  return self::TABLE_NAME;
25  }

◆ setId()

ilBibliographicSetting::setId (   $id)
Parameters
mixed$id

Definition at line 231 of file class.ilBibliographicSetting.php.

References $id.

231  {
232  $this->id = $id;
233  }

◆ setImg()

ilBibliographicSetting::setImg (   $img)
Parameters
mixed$img

Definition at line 247 of file class.ilBibliographicSetting.php.

References $img.

247  {
248  $this->img = $img;
249  }

◆ setName()

ilBibliographicSetting::setName (   $name)
Parameters
mixed$name

Definition at line 263 of file class.ilBibliographicSetting.php.

References $name.

263  {
264  $this->name = $name;
265  }

◆ setShowInList()

ilBibliographicSetting::setShowInList (   $show_in_list)
Parameters
mixed$show_in_list

Definition at line 279 of file class.ilBibliographicSetting.php.

References $show_in_list.

279  {
280  $this->show_in_list = $show_in_list;
281  }

◆ setUrl()

ilBibliographicSetting::setUrl (   $url)
Parameters
mixed$url

Definition at line 295 of file class.ilBibliographicSetting.php.

References $url.

295  {
296  $this->url = $url;
297  }

Field Documentation

◆ $id

ilBibliographicSetting::$id
protected

Definition at line 47 of file class.ilBibliographicSetting.php.

Referenced by getId(), and setId().

◆ $img

ilBibliographicSetting::$img
protected

Definition at line 73 of file class.ilBibliographicSetting.php.

Referenced by getImg(), and setImg().

◆ $name

ilBibliographicSetting::$name
protected

Definition at line 56 of file class.ilBibliographicSetting.php.

Referenced by getName(), and setName().

◆ $show_in_list

ilBibliographicSetting::$show_in_list
protected

Definition at line 81 of file class.ilBibliographicSetting.php.

Referenced by getShowInList(), and setShowInList().

◆ $url

ilBibliographicSetting::$url
protected

Definition at line 65 of file class.ilBibliographicSetting.php.

Referenced by getUrl(), and setUrl().

◆ TABLE_NAME

const ilBibliographicSetting::TABLE_NAME = 'il_bibl_settings'

Definition at line 16 of file class.ilBibliographicSetting.php.


The documentation for this class was generated from the following file: