CMS  Version 3.9
LinkLibrary Class Reference

Inherits DataItem.

Public Member Functions

 Owner ()
 
 isOwner ()
 
 Links ($constraint="")
 
 getOwnerName ()
 
 countLinks ($published=false)
 
 allowReadAccess ()
 
 allowWriteAccess ()
 

Static Public Member Functions

static findByIdentifier ($identifier)
 

Public Attributes

 $table = "link_library"
 
 $primary_key = "link_library_id"
 
 $default_format = "{name}"
 
 $fields
 
 $relations
 

Detailed Description

Definition at line 40 of file link_library.inc.

Member Function Documentation

◆ allowReadAccess()

LinkLibrary::allowReadAccess ( )

Definition at line 117 of file link_library.inc.

118  {
119  global $user;
120 
121  if(!$user)
122  $user = FileshareManager::setVisitor();
123 
124  if($this->isOwner() || checkRole($this->read_access))
125  {
126  return true;
127  }
128  return false;
129  }
global $user

◆ allowWriteAccess()

LinkLibrary::allowWriteAccess ( )

Definition at line 131 of file link_library.inc.

132  {
133  global $user;
134 
135  if(!$user)
136  return false;
137 
138  if($this->isOwner() || checkRole($this->write_access))
139  {
140  return true;
141  }
142  return false;
143 
144  }

◆ countLinks()

LinkLibrary::countLinks (   $published = false)

Definition at line 98 of file link_library.inc.

99  {
100  $constraint = $published ? " AND published=1" : "";
101 
102  return queryValue(LinkRecord, "COUNT(1)", "WHERE link_library_id={$this->link_library_id}$constraint");
103  }
$constraint
$published
Definition: update.inc:38

◆ findByIdentifier()

static LinkLibrary::findByIdentifier (   $identifier)
static

Definition at line 105 of file link_library.inc.

106  {
107  $match = Query::create(LinkLibrary, "WHERE identifier=:id")
108  ->bind(":id", $identifier)
109  ->executeSingle();
110 
111  return $match;
112  }
$identifier
Definition: rss.inc:37

◆ getOwnerName()

LinkLibrary::getOwnerName ( )

Definition at line 91 of file link_library.inc.

92  {
93  $owner = $this->Owner();
94 
95  return ($owner) ? $owner->getFullName() : "";
96  }

◆ isOwner()

LinkLibrary::isOwner ( )

Definition at line 73 of file link_library.inc.

74  {
75  global $user;
76 
77  if(!$user)
78  return false;
79 
80  $owner = $this->Owner();
81 
82  return ($owner->user_id == $user->user_id) ? true : false;
83  }
$table column("Redirect From", "<a href='redirect_form?redirect_id={redirect_id}'>{redirect_from}</a>", true, "width: 30%") -> column("Redirect To", "<a href='{redirect_to}' target='_blank'>{redirect_to}</a>", true, "width: 30%") ->column("Last Modified", "{last_modified}", true, "width: 20%; text-align: center") ->column("Override", "{ override true
Definition: redirects.inc:9

◆ Links()

LinkLibrary::Links (   $constraint = "")

Definition at line 86 of file link_library.inc.

87  {
88  return $this->getRelatedList(LinkRecord, "", $constraint);
89  }

◆ Owner()

LinkLibrary::Owner ( )

Definition at line 64 of file link_library.inc.

65  {
66  if(!$this->owner_id)
67  return null;
68 
69  $mgr = new UserManager();
70  return $mgr->getUser($this->owner_id);
71  }
$calendar owner_id
Provides the interface to the user model for the application.

Member Data Documentation

◆ $default_format

LinkLibrary::$default_format = "{name}"

Definition at line 44 of file link_library.inc.

◆ $fields

LinkLibrary::$fields
Initial value:
= array("link_library_id" => Number,
"name" => String,
"identifier" => String,
"description" => HTML,
"hidden" => Boolean,
"owner_id" => Number,
"read_access" => String,
"write_access" => String,
"create_date" => DateTime,
"last_modified" => Timestamp,
"enabled" => Boolean)

Definition at line 48 of file link_library.inc.

◆ $primary_key

LinkLibrary::$primary_key = "link_library_id"

Definition at line 43 of file link_library.inc.

◆ $relations

LinkLibrary::$relations
Initial value:
= array( "Owner" => "",
"Links" => LinkRecord)

Definition at line 60 of file link_library.inc.

◆ $table

LinkLibrary::$table = "link_library"

Definition at line 42 of file link_library.inc.


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