ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)
 
 fixDateField ($field_name, $value)
 
 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 184 of file class.ilBibliographicSetting.php.

184 {
185 if ($type = 'ris') {
186 switch ($a) {
187 case 'ti':
188 $a = "title";
189 break;
190 case 't1':
191 $a = "title";
192 break;
193 case 'au':
194 $a = "author";
195 break;
196 case 'sn':
197 if (strlen($attributes[$prefix . "sn"]) <= 9) {
198 $a = "issn";
199 } else {
200 $a = "isbn";
201 }
202 break;
203 case 'py':
204 $a = "date";
205 break;
206 case 'is':
207 $a = "issue";
208 break;
209 case 'vl':
210 $a = "volume";
211 break;
212 }
213 } elseif ($type = 'bib') {
214 switch ($a) {
215 case 'number':
216 $a = "issue";
217 break;
218 case 'year':
219 $a = "date";
220 break;
221 }
222 }
223
224 return $a;
225 }

Referenced by generateLibraryLink().

+ 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 96 of file class.ilBibliographicSetting.php.

96 {
97 $attributes = $entry->getAttributes();
98 switch ($type) {
99 case 'bib':
100 $prefix = "bib_default_";
101 if (!empty($attributes[$prefix . "isbn"])) {
102 $attr = array( "isbn" );
103 } elseif (!empty($attributes[$prefix . "pmid"])) {
104 $attr = array( "pmid" );
105 } elseif (!empty($attributes[$prefix . "doi"])) {
106 $attr = array( "doi" );
107 } elseif (!empty($attributes[$prefix . "issn"])) {
108 $attr = array( "issn" );
109 } else {
110 $attr = array( "title", "author", "year", "number", "volume" );
111 }
112 break;
113 case 'ris':
114 $prefix = "ris_" . strtolower($entry->getType()) . "_";
115 if (!empty($attributes[$prefix . "sn"])) {
116 $attr = array( "sn" );
117 } elseif (!empty($attributes[$prefix . "do"])) {
118 $attr = array( "do" );
119 } else {
120 $attr = array( "ti", "t1", "au", "py", "is", "vl" );
121 }
122 break;
123 }
124
125 $url_params = "?";
126 if (sizeof($attr) == 1) {
127 if (($attr[0] == "doi") || ($attr[0] == "pmid")) {
128 $url_params .= "id=" . $this->formatAttribute($attr[0], $type, $attributes, $prefix) . "%3A" . $attributes[$prefix . $attr[0]];
129 } elseif ($attr[0] == "do") {
130 $url_params .= "id=" . $this->formatAttribute($attr[0], $type, $attributes, $prefix) . "i%3A" . $attributes[$prefix . $attr[0]];
131 } else {
132 $url_params .= $this->formatAttribute($attr[0], $type, $attributes, $prefix) . "=" . urlencode($attributes[$prefix . $attr[0]]);
133 }} else {
134 foreach ($attr as $a) {
135 if (array_key_exists($prefix . $a, $attributes)) {
136 if (strlen($url_params) > 1) {
137 $url_params .= "&";
138 }
139 $url_params .= $this->formatAttribute($a, $type, $attributes, $prefix) . "=" . urlencode($attributes[$prefix . $a]);
140 }
141 }
142 }
143
144 // return full link
145 $full_link = $this->getUrl() . $url_params;
146
147 return $full_link;
148 }
formatAttribute($a, $type, $attributes, $prefix)

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

Referenced by getButton().

+ 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 85 of file class.ilBibliographicSetting.php.

85 {
86 return self::get();
87 }

References ActiveRecord\get().

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

+ Here is the call graph for this function:
+ 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 157 of file class.ilBibliographicSetting.php.

157 {
158 if ($this->getImg()) {
159 require_once('./Services/UIComponent/Button/classes/class.ilImageLinkButton.php');
161 $button->setUrl($this->generateLibraryLink($entry, $bibl_obj->getFiletype()));
162 $button->setImage($this->getImg(), false);
163 } else {
164 require_once('./Services/UIComponent/Button/classes/class.ilLinkButton.php');
165 $button = ilLinkButton::getInstance();
166 $button->setUrl($this->generateLibraryLink($entry, $bibl_obj->getFiletype()));
167 $button->setCaption('bibl_link_online');
168 }
169
170 $button->setTarget('_blank');
171
172 return $button->render();
173 }
generateLibraryLink(ilBibliographicEntry $entry, $type)
static getInstance()
Factory.
static getInstance()
Factory.

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

+ Here is the call graph for this function:

◆ getConnectorContainerName()

ilBibliographicSetting::getConnectorContainerName ( )
Returns
string

Reimplemented from ActiveRecord.

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

References TABLE_NAME.

◆ getId()

ilBibliographicSetting::getId ( )
Returns
mixed

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

References $id.

◆ getImg()

ilBibliographicSetting::getImg ( )
Returns
mixed

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

References $img.

Referenced by getButton().

+ Here is the caller graph for this function:

◆ getName()

ilBibliographicSetting::getName ( )
Returns
mixed

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

References $name.

◆ getShowInList()

ilBibliographicSetting::getShowInList ( )
Returns
mixed

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

References $show_in_list.

◆ getUrl()

ilBibliographicSetting::getUrl ( )
Returns
mixed

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

References $url.

Referenced by generateLibraryLink().

+ Here is the caller graph for this function:

◆ returnDbTableName()

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

Reimplemented from ActiveRecord.

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

21 {
22 return self::TABLE_NAME;
23 }

References TABLE_NAME.

◆ setId()

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

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

239 {
240 $this->id = $id;
241 }

References $id.

◆ setImg()

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

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

255 {
256 $this->img = $img;
257 }

References $img.

◆ setName()

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

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

271 {
272 $this->name = $name;
273 }

References $name.

◆ setShowInList()

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

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

287 {
288 $this->show_in_list = $show_in_list;
289 }

References $show_in_list.

◆ setUrl()

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

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

303 {
304 $this->url = $url;
305 }

References $url.

Field Documentation

◆ $id

ilBibliographicSetting::$id
protected

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

Referenced by getId(), and setId().

◆ $img

ilBibliographicSetting::$img
protected

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

Referenced by getImg(), and setImg().

◆ $name

ilBibliographicSetting::$name
protected

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

Referenced by getName(), and setName().

◆ $show_in_list

ilBibliographicSetting::$show_in_list
protected

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

Referenced by getShowInList(), and setShowInList().

◆ $url

ilBibliographicSetting::$url
protected

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

Referenced by getUrl(), and setUrl().

◆ TABLE_NAME

const ilBibliographicSetting::TABLE_NAME = 'il_bibl_settings'

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