コード例 #1
0
 public function save($args)
 {
     parent::save();
     $db = Loader::db();
     $db->Execute('delete from PagePermissionThemeAccessList where paID = ?', array($this->getPermissionAccessID()));
     $db->Execute('delete from PagePermissionThemeAccessListCustom where paID = ?', array($this->getPermissionAccessID()));
     if (is_array($args['themesIncluded'])) {
         foreach ($args['themesIncluded'] as $peID => $permission) {
             $v = array($this->getPermissionAccessID(), $peID, $permission);
             $db->Execute('insert into PagePermissionThemeAccessList (paID, peID, permission) values (?, ?, ?)', $v);
         }
     }
     if (is_array($args['themesExcluded'])) {
         foreach ($args['themesExcluded'] as $peID => $permission) {
             $v = array($this->getPermissionAccessID(), $peID, $permission);
             $db->Execute('insert into PagePermissionThemeAccessList (paID, peID, permission) values (?, ?, ?)', $v);
         }
     }
     if (is_array($args['pThemeIDInclude'])) {
         foreach ($args['pThemeIDInclude'] as $peID => $pThemeIDs) {
             foreach ($pThemeIDs as $pThemeID) {
                 $v = array($this->getPermissionAccessID(), $peID, $pThemeID);
                 $db->Execute('insert into PagePermissionThemeAccessListCustom (paID, peID, pThemeID) values (?, ?, ?)', $v);
             }
         }
     }
     if (is_array($args['pThemeIDExclude'])) {
         foreach ($args['pThemeIDExclude'] as $peID => $pThemeIDs) {
             foreach ($pThemeIDs as $pThemeID) {
                 $v = array($this->getPermissionAccessID(), $peID, $pThemeID);
                 $db->Execute('insert into PagePermissionThemeAccessListCustom (paID, peID, pThemeID) values (?, ?, ?)', $v);
             }
         }
     }
 }
コード例 #2
0
 public function save($args = [])
 {
     parent::save();
     $db = Database::connection();
     $db->executeQuery('delete from PagePermissionThemeAccessList where paID = ?', [$this->getPermissionAccessID()]);
     $db->executeQuery('delete from PagePermissionThemeAccessListCustom where paID = ?', [$this->getPermissionAccessID()]);
     if (is_array($args['themesIncluded'])) {
         foreach ($args['themesIncluded'] as $peID => $permission) {
             $v = [$this->getPermissionAccessID(), $peID, $permission];
             $db->executeQuery('insert into PagePermissionThemeAccessList (paID, peID, permission) values (?, ?, ?)', $v);
         }
     }
     if (is_array($args['themesExcluded'])) {
         foreach ($args['themesExcluded'] as $peID => $permission) {
             $v = [$this->getPermissionAccessID(), $peID, $permission];
             $db->executeQuery('insert into PagePermissionThemeAccessList (paID, peID, permission) values (?, ?, ?)', $v);
         }
     }
     if (is_array($args['pThemeIDInclude'])) {
         foreach ($args['pThemeIDInclude'] as $peID => $pThemeIDs) {
             foreach ($pThemeIDs as $pThemeID) {
                 $v = [$this->getPermissionAccessID(), $peID, $pThemeID];
                 $db->executeQuery('insert into PagePermissionThemeAccessListCustom (paID, peID, pThemeID) values (?, ?, ?)', $v);
             }
         }
     }
     if (is_array($args['pThemeIDExclude'])) {
         foreach ($args['pThemeIDExclude'] as $peID => $pThemeIDs) {
             foreach ($pThemeIDs as $pThemeID) {
                 $v = [$this->getPermissionAccessID(), $peID, $pThemeID];
                 $db->executeQuery('insert into PagePermissionThemeAccessListCustom (paID, peID, pThemeID) values (?, ?, ?)', $v);
             }
         }
     }
 }
コード例 #3
0
 public function save($args)
 {
     parent::save();
     $db = Loader::db();
     $db->Execute('delete from PagePermissionPageTypeAccessList where paID = ?', array($this->getPermissionAccessID()));
     $db->Execute('delete from PagePermissionPageTypeAccessListCustom where paID = ?', array($this->getPermissionAccessID()));
     if (is_array($args['pageTypesIncluded'])) {
         foreach ($args['pageTypesIncluded'] as $peID => $permission) {
             $ext = 0;
             if (!empty($args['allowExternalLinksIncluded'][$peID])) {
                 $ext = $args['allowExternalLinksIncluded'][$peID];
             }
             $v = array($this->getPermissionAccessID(), $peID, $permission, $ext);
             $db->Execute('insert into PagePermissionPageTypeAccessList (paID, peID, permission, externalLink) values (?, ?, ?, ?)', $v);
         }
     }
     if (is_array($args['pageTypesExcluded'])) {
         foreach ($args['pageTypesExcluded'] as $peID => $permission) {
             $ext = 0;
             if (!empty($args['allowExternalLinksExcluded'][$peID])) {
                 $ext = $args['allowExternalLinksExcluded'][$peID];
             }
             $v = array($this->getPermissionAccessID(), $peID, $permission, $ext);
             $db->Execute('insert into PagePermissionPageTypeAccessList (paID, peID, permission, externalLink) values (?, ?, ?, ?)', $v);
         }
     }
     if (is_array($args['ptIDInclude'])) {
         foreach ($args['ptIDInclude'] as $peID => $ptIDs) {
             foreach ($ptIDs as $ptID) {
                 $v = array($this->getPermissionAccessID(), $peID, $ptID);
                 $db->Execute('insert into PagePermissionPageTypeAccessListCustom (paID, peID, ptID) values (?, ?, ?)', $v);
             }
         }
     }
     if (is_array($args['ptIDExclude'])) {
         foreach ($args['ptIDExclude'] as $peID => $ptIDs) {
             foreach ($ptIDs as $ptID) {
                 $v = array($this->getPermissionAccessID(), $peID, $ptID);
                 $db->Execute('insert into PagePermissionPageTypeAccessListCustom (paID, peID, ptID) values (?, ?, ?)', $v);
             }
         }
     }
 }
コード例 #4
0
 public function save($args = array())
 {
     parent::save();
     $db = Database::connection();
     $db->executeQuery('delete from PagePermissionPropertyAccessList where paID = ?', array($this->getPermissionAccessID()));
     $db->executeQuery('delete from PagePermissionPropertyAttributeAccessListCustom where paID = ?', array($this->getPermissionAccessID()));
     if (is_array($args['propertiesIncluded'])) {
         foreach ($args['propertiesIncluded'] as $peID => $attributePermission) {
             $allowEditName = 0;
             $allowEditDateTime = 0;
             $allowEditUID = 0;
             $allowEditDescription = 0;
             $allowEditPaths = 0;
             if (!empty($args['allowEditName'][$peID])) {
                 $allowEditName = $args['allowEditName'][$peID];
             }
             if (!empty($args['allowEditDateTime'][$peID])) {
                 $allowEditDateTime = $args['allowEditDateTime'][$peID];
             }
             if (!empty($args['allowEditUID'][$peID])) {
                 $allowEditUID = $args['allowEditUID'][$peID];
             }
             if (!empty($args['allowEditDescription'][$peID])) {
                 $allowEditDescription = $args['allowEditDescription'][$peID];
             }
             if (!empty($args['allowEditPaths'][$peID])) {
                 $allowEditPaths = $args['allowEditPaths'][$peID];
             }
             $v = array($this->getPermissionAccessID(), $peID, $attributePermission, $allowEditName, $allowEditDateTime, $allowEditUID, $allowEditDescription, $allowEditPaths);
             $db->executeQuery('insert into PagePermissionPropertyAccessList (paID, peID, attributePermission, name, publicDateTime, uID, description, paths) values (?, ?, ?, ?, ?, ?, ?, ?)', $v);
         }
     }
     if (is_array($args['propertiesExcluded'])) {
         foreach ($args['propertiesExcluded'] as $peID => $attributePermission) {
             $allowEditNameExcluded = 0;
             $allowEditDateTimeExcluded = 0;
             $allowEditUIDExcluded = 0;
             $allowEditDescriptionExcluded = 0;
             $allowEditPathsExcluded = 0;
             if (!empty($args['allowEditNameExcluded'][$peID])) {
                 $allowEditNameExcluded = $args['allowEditNameExcluded'][$peID];
             }
             if (!empty($args['allowEditDateTimeExcluded'][$peID])) {
                 $allowEditDateTimeExcluded = $args['allowEditDateTimeExcluded'][$peID];
             }
             if (!empty($args['allowEditUIDExcluded'][$peID])) {
                 $allowEditUIDExcluded = $args['allowEditUIDExcluded'][$peID];
             }
             if (!empty($args['allowEditDescriptionExcluded'][$peID])) {
                 $allowEditDescriptionExcluded = $args['allowEditDescriptionExcluded'][$peID];
             }
             if (!empty($args['allowEditPathsExcluded'][$peID])) {
                 $allowEditPathsExcluded = $args['allowEditPathsExcluded'][$peID];
             }
             $v = array($this->getPermissionAccessID(), $peID, $attributePermission, $allowEditNameExcluded, $allowEditDateTimeExcluded, $allowEditUIDExcluded, $allowEditDescriptionExcluded, $allowEditPathsExcluded);
             $db->executeQuery('insert into PagePermissionPropertyAccessList (paID, peID, attributePermission, name, publicDateTime, uID, description, paths) values (?, ?, ?, ?, ?, ?, ?, ?)', $v);
         }
     }
     if (is_array($args['akIDInclude'])) {
         foreach ($args['akIDInclude'] as $peID => $akIDs) {
             foreach ($akIDs as $akID) {
                 $v = array($this->getPermissionAccessID(), $peID, $akID);
                 $db->executeQuery('insert into PagePermissionPropertyAttributeAccessListCustom (paID, peID, akID) values (?, ?, ?)', $v);
             }
         }
     }
     if (is_array($args['akIDExclude'])) {
         foreach ($args['akIDExclude'] as $peID => $akIDs) {
             foreach ($akIDs as $akID) {
                 $v = array($this->getPermissionAccessID(), $peID, $akID);
                 $db->executeQuery('insert into PagePermissionPropertyAttributeAccessListCustom (paID, peID, akID) values (?, ?, ?)', $v);
             }
         }
     }
 }