diff options
| author | Lester Caine ext:(%22) <lester@lsces.co.uk> | 2012-04-15 22:14:06 +0100 |
|---|---|---|
| committer | Lester Caine ext:(%22) <lester@lsces.co.uk> | 2012-04-15 22:14:06 +0100 |
| commit | db5b4ca3b928017e11c7a63d65e1e9b784a587d7 (patch) | |
| tree | 884d2f965b943b6472e5e7555008880ed802eb9a | |
| parent | f35583f7c089b9ca39d6a4e3bb05e30cf4b6363e (diff) | |
| download | contact-db5b4ca3b928017e11c7a63d65e1e9b784a587d7.tar.gz contact-db5b4ca3b928017e11c7a63d65e1e9b784a587d7.tar.bz2 contact-db5b4ca3b928017e11c7a63d65e1e9b784a587d7.zip | |
Tidy up to remove 'STRICT' warnings
Split static and dynamic use of getDisplayUrl
Create getContentUrl as the instantiated version
load parameters need to be identical across all classes
| -rw-r--r-- | Contact.php | 18 | ||||
| -rw-r--r-- | add_xref.php | 4 | ||||
| -rw-r--r-- | add_xref_address.php | 4 | ||||
| -rw-r--r-- | edit.php | 4 | ||||
| -rw-r--r-- | edit_key_break.php | 2 | ||||
| -rw-r--r-- | edit_xref.php | 6 | ||||
| -rw-r--r-- | import/ContactOld.php | 8 | ||||
| -rw-r--r-- | view_xref.php | 4 |
8 files changed, 25 insertions, 25 deletions
diff --git a/Contact.php b/Contact.php index d1fcb4a..ad1c017 100644 --- a/Contact.php +++ b/Contact.php @@ -67,7 +67,7 @@ class Contact extends LibertyContent { * * (Describe Contact object here ) */ - function load($pContentId = NULL) { + function load( $pContentId = NULL, $pPluginParams = NULL ) { if ( $pContentId ) $this->mContentId = (int)$pContentId; if( $this->verifyId( $this->mContentId ) ) { $query = "select con.*, lc.*, @@ -97,7 +97,7 @@ class Contact extends LibertyContent { $this->mContactName = $result->fields['title']; $this->mInfo['creator'] = (isset( $result->fields['creator_real_name'] ) ? $result->fields['creator_real_name'] : $result->fields['creator_user'] ); $this->mInfo['editor'] = (isset( $result->fields['modifier_real_name'] ) ? $result->fields['modifier_real_name'] : $result->fields['modifier_user'] ); - $this->mInfo['display_url'] = $this->getDisplayUrl(); + $this->mInfo['display_url'] = $this->getContactUrl(); $this->mInfo['organisation'] = trim($this->mInfo['organisation']); $name = explode( '|', $this->mInfo['name'] ); if ( isset( $name[0] ) ) { $this->mInfo['prefix'] = $name[0]; } else { $this->mInfo['prefix'] = ''; } @@ -261,9 +261,9 @@ class Contact extends LibertyContent { * @param array different possibilities depending on derived class * @return string the link to display the page. */ - function getDisplayUrl( $pContentId=NULL ) { + function getContactUrl( $pContentId=NULL ) { global $gBitSystem; - if( empty( $pContentId ) ) { + if( empty( $pContentId ) and isset($this) ) { $pContentId = $this->mContentId; } @@ -277,13 +277,13 @@ class Contact extends LibertyContent { * @param array mInfo style array of content information * @return the link to display the page. */ - function getDisplayLink( $pText, $aux ) { - if ( $this->mContentId != $aux['content_id'] ) $this->load($aux['content_id']); + function getDisplayLink( $pTitle=NULL, $pMixed=NULL, $pAnchor=NULL ) { + if ( $this->mContentId != $pMixed['content_id'] ) $this->load($pMixed['content_id']); if (empty($this->mInfo['content_id']) ) { - $ret = '<a href="'.$this->getDisplayUrl($aux['content_id']).'">'.$aux['title'].'</a>'; + $ret = '<a href="'.$this->getContactUrl($pMixed['content_id']).'">'.$pMixed['title'].'</a>'; } else { - $ret = '<a href="'.$this->getDisplayUrl($aux['content_id']).'">'."Contact - ".$this->mInfo['title'].'</a>'; + $ret = '<a href="'.$this->getContactUrl($pMixed['content_id']).'">'."Contact - ".$this->mInfo['title'].'</a>'; } return $ret; } @@ -294,7 +294,7 @@ class Contact extends LibertyContent { * @param array mInfo style array of content information * @return string Text for the title description */ - function getTitle( $pHash = NULL ) { + function getTitle( $pHash = NULL, $pDefault=TRUE ) { $ret = NULL; if( empty( $pHash ) ) { $pHash = &$this->mInfo; diff --git a/add_xref.php b/add_xref.php index 95d6d30..09bd7a9 100644 --- a/add_xref.php +++ b/add_xref.php @@ -22,7 +22,7 @@ include_once( CONTACT_PKG_PATH.'lookup_contact_inc.php' ); if (isset($_REQUEST["fCancel"])) { if( !empty( $gContent->mContentId ) ) { - header("Location: ".$gContent->getDisplayUrl( $gContent->mContentId ) ); + header("Location: ".$gContent->getContactUrl( $gContent->mContentId ) ); } else { header("Location: ".CONTACT_PKG_URL ); } @@ -36,7 +36,7 @@ if (isset($_REQUEST["fCancel"])) { if ( isset( $_REQUEST[$format."xkey_ext"] ) ) { $_REQUEST["xkey_ext"] = $_REQUEST[$format."xkey_ext"]; } } if( $gContent->storeXref( $_REQUEST ) ) { - header("Location: ".$gContent->getDisplayUrl( $gContent->mContentId ) ); + header("Location: ".$gContent->getContactUrl( $gContent->mContentId ) ); die; } else { $xrefInfo = $_REQUEST; diff --git a/add_xref_address.php b/add_xref_address.php index 6f4ed21..e059db1 100644 --- a/add_xref_address.php +++ b/add_xref_address.php @@ -22,14 +22,14 @@ include_once( CONTACT_PKG_PATH.'lookup_contact_inc.php' ); if (isset($_REQUEST["fCancel"])) { if( !empty( $gContent->mContentId ) ) { - header("Location: ".$gContent->getDisplayUrl() ); + header("Location: ".$gContent->getContactUrl() ); } else { header("Location: ".CONTACT_PKG_URL ); } die; } elseif (isset($_REQUEST["fAddXref"])) { if( $gContent->storeXref( $_REQUEST ) ) { - header("Location: ".$gContent->getDisplayUrl() ); + header("Location: ".$gContent->getContactUrl() ); } else { $xrefInfo = $_REQUEST; $xrefInfo['data'] = &$_REQUEST['edit']; @@ -49,14 +49,14 @@ if(isset($_REQUEST["preview"])) { // Pro if (isset($_REQUEST["fCancel"])) { if( !empty( $gContent->mContentId ) ) { - header("Location: ".$gContent->getDisplayUrl() ); + header("Location: ".$gContent->getContactUrl() ); } else { header("Location: ".CONTACT_PKG_URL ); } die; } elseif (isset($_REQUEST["fSaveContact"])) { if( $gContent->store( $_REQUEST ) ) { - header("Location: ".$gContent->getDisplayUrl() ); + header("Location: ".$gContent->getContactUrl() ); } else { $formInfo = $_REQUEST; $formInfo['data'] = &$_REQUEST['edit']; diff --git a/edit_key_break.php b/edit_key_break.php index 49c10fa..f274c33 100644 --- a/edit_key_break.php +++ b/edit_key_break.php @@ -29,7 +29,7 @@ if( !empty( $_REQUEST['xref_id'] ) ) { $gContent->stepXref( $_REQUEST ); if(isset($_REQUEST["fSaveXref"])) { - header("Location: ".$gContent->getDisplayUrl() ); + header("Location: ".$gContent->getContactUrl() ); die; } diff --git a/edit_xref.php b/edit_xref.php index 5b56ce1..596d60a 100644 --- a/edit_xref.php +++ b/edit_xref.php @@ -29,14 +29,14 @@ if( !empty( $_REQUEST['xref_id'] ) ) { if (isset($_REQUEST["fCancel"])) { if( !empty( $gContent->mContentId ) ) { - header("Location: ".$gContent->getDisplayUrl( $gContent->mContentId ) ); + header("Location: ".$gContent->getContactUrl( $gContent->mContentId ) ); } else { header("Location: ".CONTACT_PKG_URL ); } die; } else if(isset($_REQUEST["fSaveXref"])) { if( $gContent->storeXref( $_REQUEST ) ) { - header("Location: ".$gContent->getDisplayUrl( $gContent->mContentId ) ); + header("Location: ".$gContent->getContactUrl( $gContent->mContentId ) ); die; } else { $xrefInfo = $_REQUEST; @@ -45,7 +45,7 @@ if (isset($_REQUEST["fCancel"])) { } else if(isset( $_REQUEST["expunge"] ) ) { if( $gContent->stepXref( $_REQUEST ) ) { // if ( $_REQUEST['expunge'] > 2) { - header("Location: ".$gContent->getDisplayUrl() ); + header("Location: ".$gContent->getContactUrl() ); die; // } } diff --git a/import/ContactOld.php b/import/ContactOld.php index e22384c..a8fc8eb 100644 --- a/import/ContactOld.php +++ b/import/ContactOld.php @@ -59,7 +59,7 @@ class Contact extends LibertyBase { $this->mContactName = $result->fields['title']; $this->mInfo['creator'] = (isset( $result->fields['creator_real_name'] ) ? $result->fields['creator_real_name'] : $result->fields['creator_user'] ); $this->mInfo['editor'] = (isset( $result->fields['modifier_real_name'] ) ? $result->fields['modifier_real_name'] : $result->fields['modifier_user'] ); - $this->mInfo['display_url'] = $this->getDisplayUrl(); + $this->mInfo['display_url'] = $this->getContactUrl(); $os1 = new OSRef($this->mInfo['x_coordinate'], $this->mInfo['y_coordinate']); $ll1 = $os1->toLatLng(); $this->mInfo['prop_lat'] = $ll1->lat; @@ -211,9 +211,9 @@ class Contact extends LibertyBase { if ( $this->mContactId != $aux['contact_id'] ) $this->load($aux['contact_id']); if (empty($this->mInfo['contact_id']) ) { - $ret = '<a href="'.$this->getDisplayUrl($aux['contact_id']).'">'.$aux['title'].'</a>'; + $ret = '<a href="'.$this->getContactUrl($aux['contact_id']).'">'.$aux['title'].'</a>'; } else { - $ret = '<a href="'.$this->getDisplayUrl($aux['contact_id']).'">'."Contact - ".$this->mInfo['title'].'</a>'; + $ret = '<a href="'.$this->getContactUrl($aux['contact_id']).'">'."Contact - ".$this->mInfo['title'].'</a>'; } return $ret; } @@ -283,7 +283,7 @@ class Contact extends LibertyBase { $this->mDb->CompleteTrans(); while ($res = $result->fetchRow()) { - $res['contact_url'] = $this->getDisplayUrl( $res['contact_id'] ); + $res['contact_url'] = $this->getContactUrl( $res['contact_id'] ); $ret[] = $res; } diff --git a/view_xref.php b/view_xref.php index 57871ec..5e5f72b 100644 --- a/view_xref.php +++ b/view_xref.php @@ -26,14 +26,14 @@ if( !empty( $_REQUEST['xref_id'] ) ) { if (isset($_REQUEST["fCancel"])) { if( !empty( $gContent->mContentId ) ) { - header("Location: ".$gContent->getDisplayUrl() ); + header("Location: ".$gContent->getContactUrl() ); } else { header("Location: ".CONTACT_PKG_URL ); } die; } elseif (isset($_REQUEST["fSaveXref"])) { if( $gContent->storeXref( $_REQUEST ) ) { - header("Location: ".$gContent->getDisplayUrl() ); + header("Location: ".$gContent->getContactUrl() ); die; } else { $xrefInfo = $_REQUEST; |
