Chanaka,
about your question on long lines, I agree with you that this could be put on two lines. Suggestion:
if ((PMA_strlen($wktval) > $GLOBALS['cfg']['LimitChars']) && ($_SESSION['tmp_user_values']['display_text'] == self::DISPLAY_PARTIAL_TEXT) ) {