/** * getUploadTypesNavigation * * @param string $currentType * * @return string */ protected function getUploadTypesNavigation($currentType) { $nav = ''; $types = array('upload', 'facebook', 'picasa', 'instagram'); foreach ($types as $type) { $url = ''; $class = $currentType == $type ? 'current' : ''; $text = ''; if ($type == 'upload') { $type = getUploaderType($this->fcmsUser->id); $url = '?action=upload&type=' . $type; $text = T_('Computer'); } elseif ($type == 'instagram') { $config = getInstagramConfigData(); if (empty($config['instagram_client_id']) || empty($config['instagram_client_secret'])) { continue; } $url = '?action=upload&type=instagram'; $text = 'Instagram'; } elseif ($type == 'picasa') { $url = '?action=upload&type=picasa'; $text = 'Picasa'; } elseif ($type == 'facebook') { $config = getFacebookConfigData(); if (empty($config['fb_app_id']) && empty($config['fb_secret'])) { continue; } $url = '?action=upload&type=facebook'; $text = 'Facebook'; } else { die('Invalid upload type.'); } $nav .= ' <li class="' . $class . '"><a href="' . $url . '">' . $text . '</a></li>'; } return $nav; }
/** * getFamilyTreeClassName * * Returns the name of the appropriate family tree * avatar upload class name. * * @return string */ function getFamilyTreeClassName() { $fcmsError = FCMS_Error::getInstance(); $fcmsDatabase = Database::getInstance($fcmsError); $fcmsUser = User::getInstance($fcmsError, $fcmsDatabase); $type = getUploaderType($fcmsUser->id); if ($type == 'plupload') { $className = 'PluploadUploadFamilyTree'; } else { if ($type == 'java') { $className = 'JavaUploadFamilyTree'; } else { $className = 'UploadFamilyTree'; } } return $className; }