ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 187 of file class.ilBibliographicSetting.php.

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

References $attributes, and $type.

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

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

References $attributes, $type, 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 86 of file class.ilBibliographicSetting.php.

87 {
88 return self::get();
89 }

References ActiveRecord\get().

Referenced by ilBibliographicRecordListTableGUI\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 161 of file class.ilBibliographicSetting.php.

162 {
163 if ($this->getImg()) {
165 $button->setUrl($this->generateLibraryLink($entry, $bibl_obj->getFiletype()));
166 $button->setImage($this->getImg(), false);
167 } else {
168 $button = ilLinkButton::getInstance();
169 $button->setUrl($this->generateLibraryLink($entry, $bibl_obj->getFiletype()));
170 $button->setCaption('bibl_link_online');
171 }
172
173 $button->setTarget('_blank');
174
175 return $button->render();
176 }
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 235 of file class.ilBibliographicSetting.php.

References $id.

◆ getImg()

ilBibliographicSetting::getImg ( )
Returns
mixed

Definition at line 253 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 271 of file class.ilBibliographicSetting.php.

References $name.

◆ getShowInList()

ilBibliographicSetting::getShowInList ( )
Returns
mixed

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

References $show_in_list.

◆ getUrl()

ilBibliographicSetting::getUrl ( )
Returns
mixed

Definition at line 307 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 20 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 244 of file class.ilBibliographicSetting.php.

245 {
246 $this->id = $id;
247 }

References $id.

◆ setImg()

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

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

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

References $img.

◆ setName()

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

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

281 {
282 $this->name = $name;
283 }

References $name.

◆ setShowInList()

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

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

299 {
300 $this->show_in_list = $show_in_list;
301 }

References $show_in_list.

◆ setUrl()

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

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

317 {
318 $this->url = $url;
319 }

References $url.

Field Documentation

◆ $id

ilBibliographicSetting::$id
protected

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

Referenced by getId(), and setId().

◆ $img

ilBibliographicSetting::$img
protected

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

Referenced by getImg(), and setImg().

◆ $name

ilBibliographicSetting::$name
protected

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

Referenced by getName(), and setName().

◆ $show_in_list

ilBibliographicSetting::$show_in_list
protected

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

Referenced by getShowInList(), and setShowInList().

◆ $url

ilBibliographicSetting::$url
protected

Definition at line 64 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: