diff --git a/.gitignore b/.gitignore index 0001f5d..139ccf9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ !/.gitignore !/.htaccess !/README.md +!plugins/**/* \ No newline at end of file diff --git a/plugins/authentication/cookie/cookie.php b/plugins/authentication/cookie/cookie.php new file mode 100644 index 0000000..9a611ec --- /dev/null +++ b/plugins/authentication/cookie/cookie.php @@ -0,0 +1,404 @@ +app->isClient('administrator')) + { + return false; + } + + // Get cookie + $cookieName = 'joomla_remember_me_' . JUserHelper::getShortHashedUserAgent(); + $cookieValue = $this->app->input->cookie->get($cookieName); + + // Try with old cookieName (pre 3.6.0) if not found + if (!$cookieValue) + { + $cookieName = JUserHelper::getShortHashedUserAgent(); + $cookieValue = $this->app->input->cookie->get($cookieName); + } + + if (!$cookieValue) + { + return false; + } + + $cookieArray = explode('.', $cookieValue); + + // Check for valid cookie value + if (count($cookieArray) !== 2) + { + // Destroy the cookie in the browser. + $this->app->input->cookie->set($cookieName, '', 1, $this->app->get('cookie_path', '/'), $this->app->get('cookie_domain', '')); + JLog::add('Invalid cookie detected.', JLog::WARNING, 'error'); + + return false; + } + + $response->type = 'Cookie'; + + // Filter series since we're going to use it in the query + $filter = new JFilterInput; + $series = $filter->clean($cookieArray[1], 'ALNUM'); + + // Remove expired tokens + $query = $this->db->getQuery(true) + ->delete('#__user_keys') + ->where($this->db->quoteName('time') . ' < ' . $this->db->quote(time())); + + try + { + $this->db->setQuery($query)->execute(); + } + catch (RuntimeException $e) + { + // We aren't concerned with errors from this query, carry on + } + + // Find the matching record if it exists. + $query = $this->db->getQuery(true) + ->select($this->db->quoteName(array('user_id', 'token', 'series', 'time'))) + ->from($this->db->quoteName('#__user_keys')) + ->where($this->db->quoteName('series') . ' = ' . $this->db->quote($series)) + ->where($this->db->quoteName('uastring') . ' = ' . $this->db->quote($cookieName)) + ->order($this->db->quoteName('time') . ' DESC'); + + try + { + $results = $this->db->setQuery($query)->loadObjectList(); + } + catch (RuntimeException $e) + { + $response->status = JAuthentication::STATUS_FAILURE; + + return false; + } + + if (count($results) !== 1) + { + // Destroy the cookie in the browser. + $this->app->input->cookie->set($cookieName, '', 1, $this->app->get('cookie_path', '/'), $this->app->get('cookie_domain', '')); + $response->status = JAuthentication::STATUS_FAILURE; + + return false; + } + + // We have a user with one cookie with a valid series and a corresponding record in the database. + if (!JUserHelper::verifyPassword($cookieArray[0], $results[0]->token)) + { + /* + * This is a real attack! Either the series was guessed correctly or a cookie was stolen and used twice (once by attacker and once by victim). + * Delete all tokens for this user! + */ + $query = $this->db->getQuery(true) + ->delete('#__user_keys') + ->where($this->db->quoteName('user_id') . ' = ' . $this->db->quote($results[0]->user_id)); + + try + { + $this->db->setQuery($query)->execute(); + } + catch (RuntimeException $e) + { + // Log an alert for the site admin + JLog::add( + sprintf('Failed to delete cookie token for user %s with the following error: %s', $results[0]->user_id, $e->getMessage()), + JLog::WARNING, + 'security' + ); + } + + // Destroy the cookie in the browser. + $this->app->input->cookie->set($cookieName, '', 1, $this->app->get('cookie_path', '/'), $this->app->get('cookie_domain', '')); + + // Issue warning by email to user and/or admin? + JLog::add(JText::sprintf('PLG_AUTH_COOKIE_ERROR_LOG_LOGIN_FAILED', $results[0]->user_id), JLog::WARNING, 'security'); + $response->status = JAuthentication::STATUS_FAILURE; + + return false; + } + + // Make sure there really is a user with this name and get the data for the session. + $query = $this->db->getQuery(true) + ->select($this->db->quoteName(array('id', 'username', 'password'))) + ->from($this->db->quoteName('#__users')) + ->where($this->db->quoteName('username') . ' = ' . $this->db->quote($results[0]->user_id)) + ->where($this->db->quoteName('requireReset') . ' = 0'); + + try + { + $result = $this->db->setQuery($query)->loadObject(); + } + catch (RuntimeException $e) + { + $response->status = JAuthentication::STATUS_FAILURE; + + return false; + } + + if ($result) + { + // Bring this in line with the rest of the system + $user = JUser::getInstance($result->id); + + // Set response data. + $response->username = $result->username; + $response->email = $user->email; + $response->fullname = $user->name; + $response->password = $result->password; + $response->language = $user->getParam('language'); + + // Set response status. + $response->status = JAuthentication::STATUS_SUCCESS; + $response->error_message = ''; + } + else + { + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::_('JGLOBAL_AUTH_NO_USER'); + } + } + + /** + * We set the authentication cookie only after login is successfullly finished. + * We set a new cookie either for a user with no cookies or one + * where the user used a cookie to authenticate. + * + * @param array $options Array holding options + * + * @return boolean True on success + * + * @since 3.2 + */ + public function onUserAfterLogin($options) + { + // No remember me for admin + if ($this->app->isClient('administrator')) + { + return false; + } + + if (isset($options['responseType']) && $options['responseType'] === 'Cookie') + { + // Logged in using a cookie + $cookieName = 'joomla_remember_me_' . JUserHelper::getShortHashedUserAgent(); + + // We need the old data to get the existing series + $cookieValue = $this->app->input->cookie->get($cookieName); + + // Try with old cookieName (pre 3.6.0) if not found + if (!$cookieValue) + { + $oldCookieName = JUserHelper::getShortHashedUserAgent(); + $cookieValue = $this->app->input->cookie->get($oldCookieName); + + // Destroy the old cookie in the browser + $this->app->input->cookie->set($oldCookieName, '', 1, $this->app->get('cookie_path', '/'), $this->app->get('cookie_domain', '')); + } + + $cookieArray = explode('.', $cookieValue); + + // Filter series since we're going to use it in the query + $filter = new JFilterInput; + $series = $filter->clean($cookieArray[1], 'ALNUM'); + } + elseif (!empty($options['remember'])) + { + // Remember checkbox is set + $cookieName = 'joomla_remember_me_' . JUserHelper::getShortHashedUserAgent(); + + // Create a unique series which will be used over the lifespan of the cookie + $unique = false; + $errorCount = 0; + + do + { + $series = JUserHelper::genRandomPassword(20); + $query = $this->db->getQuery(true) + ->select($this->db->quoteName('series')) + ->from($this->db->quoteName('#__user_keys')) + ->where($this->db->quoteName('series') . ' = ' . $this->db->quote($series)); + + try + { + $results = $this->db->setQuery($query)->loadResult(); + + if ($results === null) + { + $unique = true; + } + } + catch (RuntimeException $e) + { + $errorCount++; + + // We'll let this query fail up to 5 times before giving up, there's probably a bigger issue at this point + if ($errorCount === 5) + { + return false; + } + } + } + + while ($unique === false); + } + else + { + return false; + } + + // Get the parameter values + $lifetime = $this->params->get('cookie_lifetime', '60') * 24 * 60 * 60; + $length = $this->params->get('key_length', '16'); + + // Generate new cookie + $token = JUserHelper::genRandomPassword($length); + $cookieValue = $token . '.' . $series; + + // Overwrite existing cookie with new value + $this->app->input->cookie->set( + $cookieName, + $cookieValue, + time() + $lifetime, + $this->app->get('cookie_path', '/'), + $this->app->get('cookie_domain', ''), + $this->app->isHttpsForced(), + true + ); + + $query = $this->db->getQuery(true); + + if (!empty($options['remember'])) + { + // Create new record + $query + ->insert($this->db->quoteName('#__user_keys')) + ->set($this->db->quoteName('user_id') . ' = ' . $this->db->quote($options['user']->username)) + ->set($this->db->quoteName('series') . ' = ' . $this->db->quote($series)) + ->set($this->db->quoteName('uastring') . ' = ' . $this->db->quote($cookieName)) + ->set($this->db->quoteName('time') . ' = ' . (time() + $lifetime)); + } + else + { + // Update existing record with new token + $query + ->update($this->db->quoteName('#__user_keys')) + ->where($this->db->quoteName('user_id') . ' = ' . $this->db->quote($options['user']->username)) + ->where($this->db->quoteName('series') . ' = ' . $this->db->quote($series)) + ->where($this->db->quoteName('uastring') . ' = ' . $this->db->quote($cookieName)); + } + + $hashed_token = JUserHelper::hashPassword($token); + + $query->set($this->db->quoteName('token') . ' = ' . $this->db->quote($hashed_token)); + + try + { + $this->db->setQuery($query)->execute(); + } + catch (RuntimeException $e) + { + return false; + } + + return true; + } + + /** + * This is where we delete any authentication cookie when a user logs out + * + * @param array $options Array holding options (length, timeToExpiration) + * + * @return boolean True on success + * + * @since 3.2 + */ + public function onUserAfterLogout($options) + { + // No remember me for admin + if ($this->app->isClient('administrator')) + { + return false; + } + + $cookieName = 'joomla_remember_me_' . JUserHelper::getShortHashedUserAgent(); + $cookieValue = $this->app->input->cookie->get($cookieName); + + // There are no cookies to delete. + if (!$cookieValue) + { + return true; + } + + $cookieArray = explode('.', $cookieValue); + + // Filter series since we're going to use it in the query + $filter = new JFilterInput; + $series = $filter->clean($cookieArray[1], 'ALNUM'); + + // Remove the record from the database + $query = $this->db->getQuery(true) + ->delete('#__user_keys') + ->where($this->db->quoteName('series') . ' = ' . $this->db->quote($series)); + + try + { + $this->db->setQuery($query)->execute(); + } + catch (RuntimeException $e) + { + // We aren't concerned with errors from this query, carry on + } + + // Destroy the cookie + $this->app->input->cookie->set($cookieName, '', 1, $this->app->get('cookie_path', '/'), $this->app->get('cookie_domain', '')); + + return true; + } +} diff --git a/plugins/authentication/cookie/cookie.xml b/plugins/authentication/cookie/cookie.xml new file mode 100644 index 0000000..f6a50be --- /dev/null +++ b/plugins/authentication/cookie/cookie.xml @@ -0,0 +1,50 @@ + + + plg_authentication_cookie + Joomla! Project + July 2013 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_AUTH_COOKIE_XML_DESCRIPTION + + cookie.php + + + en-GB.plg_authentication_cookie.ini + en-GB.plg_authentication_cookie.sys.ini + + + +
+ + + + + + + + + +
+
+
+
diff --git a/plugins/authentication/cookie/index.html b/plugins/authentication/cookie/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/authentication/cookie/index.html @@ -0,0 +1 @@ + diff --git a/plugins/authentication/gmail/gmail.php b/plugins/authentication/gmail/gmail.php new file mode 100644 index 0000000..edca445 --- /dev/null +++ b/plugins/authentication/gmail/gmail.php @@ -0,0 +1,236 @@ +loadLanguage(); + + // No backend authentication + if (JFactory::getApplication()->isClient('administrator') && !$this->params->get('backendLogin', 0)) + { + return; + } + + $success = false; + + $curlParams = array( + 'follow_location' => true, + 'transport.curl' => array( + CURLOPT_SSL_VERIFYPEER => $this->params->get('verifypeer', 1) + ), + ); + + $transportParams = new Registry($curlParams); + + try + { + $http = JHttpFactory::getHttp($transportParams, 'curl'); + } + catch (RuntimeException $e) + { + $response->status = JAuthentication::STATUS_FAILURE; + $response->type = 'GMail'; + $response->error_message = JText::sprintf('JGLOBAL_AUTH_FAILED', JText::_('JGLOBAL_AUTH_CURL_NOT_INSTALLED')); + + return; + } + + // Check if we have a username and password + if ($credentials['username'] === '' || $credentials['password'] === '') + { + $response->type = 'GMail'; + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::sprintf('JGLOBAL_AUTH_FAILED', JText::_('JGLOBAL_AUTH_USER_BLACKLISTED')); + + return; + } + + $blacklist = explode(',', $this->params->get('user_blacklist', '')); + + // Check if the username isn't blacklisted + if (in_array($credentials['username'], $blacklist)) + { + $response->type = 'GMail'; + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::sprintf('JGLOBAL_AUTH_FAILED', JText::_('JGLOBAL_AUTH_USER_BLACKLISTED')); + + return; + } + + $suffix = $this->params->get('suffix', ''); + $applysuffix = $this->params->get('applysuffix', 0); + $offset = strpos($credentials['username'], '@'); + + // Check if we want to do suffix stuff, typically for Google Apps for Your Domain + if ($suffix && $applysuffix) + { + if ($applysuffix == 1 && $offset === false) + { + // Apply suffix if missing + $credentials['username'] .= '@' . $suffix; + } + elseif ($applysuffix == 2) + { + // Always use suffix + if ($offset) + { + // If we already have an @, get rid of it and replace it + $credentials['username'] = substr($credentials['username'], 0, $offset); + } + + $credentials['username'] .= '@' . $suffix; + } + } + + $headers = array( + 'Authorization' => 'Basic ' . base64_encode($credentials['username'] . ':' . $credentials['password']) + ); + + try + { + $result = $http->get('https://mail.google.com/mail/feed/atom', $headers); + } + catch (Exception $e) + { + // If there was an error in the request then create a 'false' dummy response. + $result = new JHttpResponse; + $result->code = false; + } + + $code = $result->code; + + switch ($code) + { + case 200 : + $message = JText::_('JGLOBAL_AUTH_ACCESS_GRANTED'); + $success = true; + break; + + case 401 : + $message = JText::_('JGLOBAL_AUTH_ACCESS_DENIED'); + break; + + default : + $message = JText::_('JGLOBAL_AUTH_UNKNOWN_ACCESS_DENIED'); + break; + } + + $response->type = 'GMail'; + + if (!$success) + { + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::sprintf('JGLOBAL_AUTH_FAILED', $message); + + return; + } + + if (strpos($credentials['username'], '@') === false) + { + if ($suffix) + { + // If there is a suffix then we want to apply it + $email = $credentials['username'] . '@' . $suffix; + } + else + { + // If there isn't a suffix just use the default gmail one + $email = $credentials['username'] . '@gmail.com'; + } + } + else + { + // The username looks like an email address (probably is) so use that + $email = $credentials['username']; + } + + // Extra security checks with existing local accounts + $db = JFactory::getDbo(); + $localUsernameChecks = array(strstr($email, '@', true), $email); + + $query = $db->getQuery(true) + ->select('id, activation, username, email, block') + ->from('#__users') + ->where('username IN(' . implode(',', array_map(array($db, 'quote'), $localUsernameChecks)) . ')' + . ' OR email = ' . $db->quote($email) + ); + + $db->setQuery($query); + + if ($localUsers = $db->loadObjectList()) + { + foreach ($localUsers as $localUser) + { + // Local user exists with same username but different email address + if ($email !== $localUser->email) + { + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::sprintf('JGLOBAL_AUTH_FAILED', JText::_('PLG_GMAIL_ERROR_LOCAL_USERNAME_CONFLICT')); + + return; + } + else + { + // Existing user disabled locally + if ($localUser->block || !empty($localUser->activation)) + { + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::_('JGLOBAL_AUTH_ACCESS_DENIED'); + + return; + } + + // We will always keep the local username for existing accounts + $credentials['username'] = $localUser->username; + + break; + } + } + } + elseif (JFactory::getApplication()->isClient('administrator')) + { + // We wont' allow backend access without local account + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::_('JERROR_LOGIN_DENIED'); + + return; + } + + $response->status = JAuthentication::STATUS_SUCCESS; + $response->error_message = ''; + $response->email = $email; + + // Reset the username to what we ended up using + $response->username = $credentials['username']; + $response->fullname = $credentials['username']; + } +} diff --git a/plugins/authentication/gmail/gmail.xml b/plugins/authentication/gmail/gmail.xml new file mode 100644 index 0000000..8fc5dbf --- /dev/null +++ b/plugins/authentication/gmail/gmail.xml @@ -0,0 +1,77 @@ + + + plg_authentication_gmail + Joomla! Project + February 2006 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_GMAIL_XML_DESCRIPTION + + gmail.php + + + en-GB.plg_authentication_gmail.ini + en-GB.plg_authentication_gmail.sys.ini + + + +
+ + + + + + + + + + + + + + + + + + + +
+
+
+
diff --git a/plugins/authentication/gmail/index.html b/plugins/authentication/gmail/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/authentication/gmail/index.html @@ -0,0 +1 @@ + diff --git a/plugins/authentication/index.html b/plugins/authentication/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/authentication/index.html @@ -0,0 +1 @@ + diff --git a/plugins/authentication/joomla/index.html b/plugins/authentication/joomla/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/authentication/joomla/index.html @@ -0,0 +1 @@ + diff --git a/plugins/authentication/joomla/joomla.php b/plugins/authentication/joomla/joomla.php new file mode 100644 index 0000000..19970d0 --- /dev/null +++ b/plugins/authentication/joomla/joomla.php @@ -0,0 +1,221 @@ +type = 'Joomla'; + + // Joomla does not like blank passwords + if (empty($credentials['password'])) + { + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::_('JGLOBAL_AUTH_EMPTY_PASS_NOT_ALLOWED'); + + return; + } + + // Get a database object + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('id, password') + ->from('#__users') + ->where('username=' . $db->quote($credentials['username'])); + + $db->setQuery($query); + $result = $db->loadObject(); + + if ($result) + { + $match = JUserHelper::verifyPassword($credentials['password'], $result->password, $result->id); + + if ($match === true) + { + // Bring this in line with the rest of the system + $user = JUser::getInstance($result->id); + $response->email = $user->email; + $response->fullname = $user->name; + + if (JFactory::getApplication()->isClient('administrator')) + { + $response->language = $user->getParam('admin_language'); + } + else + { + $response->language = $user->getParam('language'); + } + + $response->status = JAuthentication::STATUS_SUCCESS; + $response->error_message = ''; + } + else + { + // Invalid password + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::_('JGLOBAL_AUTH_INVALID_PASS'); + } + } + else + { + // Let's hash the entered password even if we don't have a matching user for some extra response time + // By doing so, we mitigate side channel user enumeration attacks + JUserHelper::hashPassword($credentials['password']); + + // Invalid user + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::_('JGLOBAL_AUTH_NO_USER'); + } + + // Check the two factor authentication + if ($response->status === JAuthentication::STATUS_SUCCESS) + { + $methods = JAuthenticationHelper::getTwoFactorMethods(); + + if (count($methods) <= 1) + { + // No two factor authentication method is enabled + return; + } + + JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_users/models', 'UsersModel'); + + /** @var UsersModelUser $model */ + $model = JModelLegacy::getInstance('User', 'UsersModel', array('ignore_request' => true)); + + // Load the user's OTP (one time password, a.k.a. two factor auth) configuration + if (!array_key_exists('otp_config', $options)) + { + $otpConfig = $model->getOtpConfig($result->id); + $options['otp_config'] = $otpConfig; + } + else + { + $otpConfig = $options['otp_config']; + } + + // Check if the user has enabled two factor authentication + if (empty($otpConfig->method) || ($otpConfig->method === 'none')) + { + // Warn the user if they are using a secret code but they have not + // enabled two factor auth in their account. + if (!empty($credentials['secretkey'])) + { + try + { + $app = JFactory::getApplication(); + + $this->loadLanguage(); + + $app->enqueueMessage(JText::_('PLG_AUTH_JOOMLA_ERR_SECRET_CODE_WITHOUT_TFA'), 'warning'); + } + catch (Exception $exc) + { + // This happens when we are in CLI mode. In this case + // no warning is issued + return; + } + } + + return; + } + + // Try to validate the OTP + FOFPlatform::getInstance()->importPlugin('twofactorauth'); + + $otpAuthReplies = FOFPlatform::getInstance()->runPlugins('onUserTwofactorAuthenticate', array($credentials, $options)); + + $check = false; + + /* + * This looks like noob code but DO NOT TOUCH IT and do not convert + * to in_array(). During testing in_array() inexplicably returned + * null when the OTEP begins with a zero! o_O + */ + if (!empty($otpAuthReplies)) + { + foreach ($otpAuthReplies as $authReply) + { + $check = $check || $authReply; + } + } + + // Fall back to one time emergency passwords + if (!$check) + { + // Did the user use an OTEP instead? + if (empty($otpConfig->otep)) + { + if (empty($otpConfig->method) || ($otpConfig->method === 'none')) + { + // Two factor authentication is not enabled on this account. + // Any string is assumed to be a valid OTEP. + + return; + } + else + { + /* + * Two factor authentication enabled and no OTEPs defined. The + * user has used them all up. Therefore anything they enter is + * an invalid OTEP. + */ + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::_('JGLOBAL_AUTH_INVALID_SECRETKEY'); + + return; + } + } + + // Clean up the OTEP (remove dashes, spaces and other funny stuff + // our beloved users may have unwittingly stuffed in it) + $otep = $credentials['secretkey']; + $otep = filter_var($otep, FILTER_SANITIZE_NUMBER_INT); + $otep = str_replace('-', '', $otep); + $check = false; + + // Did we find a valid OTEP? + if (in_array($otep, $otpConfig->otep)) + { + // Remove the OTEP from the array + $otpConfig->otep = array_diff($otpConfig->otep, array($otep)); + + $model->setOtpConfig($result->id, $otpConfig); + + // Return true; the OTEP was a valid one + $check = true; + } + } + + if (!$check) + { + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::_('JGLOBAL_AUTH_INVALID_SECRETKEY'); + } + } + } +} diff --git a/plugins/authentication/joomla/joomla.xml b/plugins/authentication/joomla/joomla.xml new file mode 100644 index 0000000..da4b7ad --- /dev/null +++ b/plugins/authentication/joomla/joomla.xml @@ -0,0 +1,19 @@ + + + plg_authentication_joomla + Joomla! Project + November 2005 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_AUTH_JOOMLA_XML_DESCRIPTION + + joomla.php + + + en-GB.plg_authentication_joomla.ini + en-GB.plg_authentication_joomla.sys.ini + + diff --git a/plugins/authentication/ldap/index.html b/plugins/authentication/ldap/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/authentication/ldap/index.html @@ -0,0 +1 @@ + diff --git a/plugins/authentication/ldap/ldap.php b/plugins/authentication/ldap/ldap.php new file mode 100644 index 0000000..ddea754 --- /dev/null +++ b/plugins/authentication/ldap/ldap.php @@ -0,0 +1,204 @@ +type = 'LDAP'; + + // Strip null bytes from the password + $credentials['password'] = str_replace(chr(0), '', $credentials['password']); + + // LDAP does not like Blank passwords (tries to Anon Bind which is bad) + if (empty($credentials['password'])) + { + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::_('JGLOBAL_AUTH_EMPTY_PASS_NOT_ALLOWED'); + + return false; + } + + // Load plugin params info + $ldap_email = $this->params->get('ldap_email'); + $ldap_fullname = $this->params->get('ldap_fullname'); + $ldap_uid = $this->params->get('ldap_uid'); + $auth_method = $this->params->get('auth_method'); + + $ldap = new LdapClient($this->params); + + if (!$ldap->connect()) + { + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::_('JGLOBAL_AUTH_NO_CONNECT'); + + return; + } + + switch ($auth_method) + { + case 'search': + { + // Bind using Connect Username/password + // Force anon bind to mitigate misconfiguration like [#7119] + if ($this->params->get('username', '') !== '') + { + $bindtest = $ldap->bind(); + } + else + { + $bindtest = $ldap->anonymous_bind(); + } + + if ($bindtest) + { + // Search for users DN + $binddata = $this->searchByString( + str_replace( + '[search]', + str_replace(';', '\3b', $ldap->escape($credentials['username'], null, LDAP_ESCAPE_FILTER)), + $this->params->get('search_string') + ), + $ldap + ); + + if (isset($binddata[0], $binddata[0]['dn'])) + { + // Verify Users Credentials + $success = $ldap->bind($binddata[0]['dn'], $credentials['password'], 1); + + // Get users details + $userdetails = $binddata; + } + else + { + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::_('JGLOBAL_AUTH_NO_USER'); + } + } + else + { + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::_('JGLOBAL_AUTH_NO_BIND'); + } + } break; + + case 'bind': + { + // We just accept the result here + $success = $ldap->bind($ldap->escape($credentials['username'], null, LDAP_ESCAPE_DN), $credentials['password']); + + if ($success) + { + $userdetails = $this->searchByString( + str_replace( + '[search]', + str_replace(';', '\3b', $ldap->escape($credentials['username'], null, LDAP_ESCAPE_FILTER)), + $this->params->get('search_string') + ), + $ldap + ); + } + else + { + $response->status = JAuthentication::STATUS_FAILURE; + $response->error_message = JText::_('JGLOBAL_AUTH_INVALID_PASS'); + } + } break; + } + + if (!$success) + { + $response->status = JAuthentication::STATUS_FAILURE; + + if ($response->error_message === '') + { + $response->error_message = JText::_('JGLOBAL_AUTH_INVALID_PASS'); + } + } + else + { + // Grab some details from LDAP and return them + if (isset($userdetails[0][$ldap_uid][0])) + { + $response->username = $userdetails[0][$ldap_uid][0]; + } + + if (isset($userdetails[0][$ldap_email][0])) + { + $response->email = $userdetails[0][$ldap_email][0]; + } + + if (isset($userdetails[0][$ldap_fullname][0])) + { + $response->fullname = $userdetails[0][$ldap_fullname][0]; + } + else + { + $response->fullname = $credentials['username']; + } + + // Were good - So say so. + $response->status = JAuthentication::STATUS_SUCCESS; + $response->error_message = ''; + } + + $ldap->close(); + } + + /** + * Shortcut method to build a LDAP search based on a semicolon separated string + * + * Note that this method requires that semicolons which should be part of the search term to be escaped + * to correctly split the search string into separate lookups + * + * @param string $search search string of search values + * @param LdapClient $ldap The LDAP client + * + * @return array Search results + * + * @since 3.8.2 + */ + private function searchByString($search, LdapClient $ldap) + { + $results = explode(';', $search); + + foreach ($results as $key => $result) + { + $results[$key] = '(' . str_replace('\3b', ';', $result) . ')'; + } + + return $ldap->search($results); + } +} diff --git a/plugins/authentication/ldap/ldap.xml b/plugins/authentication/ldap/ldap.xml new file mode 100644 index 0000000..facf4ed --- /dev/null +++ b/plugins/authentication/ldap/ldap.xml @@ -0,0 +1,160 @@ + + + plg_authentication_ldap + Joomla! Project + November 2005 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_LDAP_XML_DESCRIPTION + + ldap.php + + + en-GB.plg_authentication_ldap.ini + en-GB.plg_authentication_ldap.sys.ini + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
diff --git a/plugins/captcha/index.html b/plugins/captcha/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/captcha/index.html @@ -0,0 +1 @@ + diff --git a/plugins/captcha/recaptcha/index.html b/plugins/captcha/recaptcha/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/captcha/recaptcha/index.html @@ -0,0 +1 @@ + diff --git a/plugins/captcha/recaptcha/recaptcha.php b/plugins/captcha/recaptcha/recaptcha.php new file mode 100644 index 0000000..6aae275 --- /dev/null +++ b/plugins/captcha/recaptcha/recaptcha.php @@ -0,0 +1,332 @@ +params->get('public_key', ''); + + if ($pubkey === '') + { + throw new Exception(JText::_('PLG_RECAPTCHA_ERROR_NO_PUBLIC_KEY')); + } + + if ($this->params->get('version', '1.0') === '1.0') + { + JHtml::_('jquery.framework'); + + $theme = $this->params->get('theme', 'clean'); + $file = 'https://www.google.com/recaptcha/api/js/recaptcha_ajax.js'; + + JHtml::_('script', $file); + JFactory::getDocument()->addScriptDeclaration('jQuery( document ).ready(function() + {Recaptcha.create("' . $pubkey . '", "' . $id . '", {theme: "' . $theme . '",' . $this->_getLanguage() . 'tabindex: 0});});'); + } + else + { + // Load callback first for browser compatibility + JHtml::_('script', 'plg_captcha_recaptcha/recaptcha.min.js', array('version' => 'auto', 'relative' => true)); + + $file = 'https://www.google.com/recaptcha/api.js?onload=JoomlaInitReCaptcha2&render=explicit&hl=' . JFactory::getLanguage()->getTag(); + JHtml::_('script', $file); + } + + return true; + } + + /** + * Gets the challenge HTML + * + * @param string $name The name of the field. Not Used. + * @param string $id The id of the field. + * @param string $class The class of the field. This should be passed as + * e.g. 'class="required"'. + * + * @return string The HTML to be embedded in the form. + * + * @since 2.5 + */ + public function onDisplay($name = null, $id = 'dynamic_recaptcha_1', $class = '') + { + if ($this->params->get('version', '1.0') === '1.0') + { + return '
'; + } + else + { + return '
'; + } + } + + /** + * Calls an HTTP POST function to verify if the user's guess was correct + * + * @param string $code Answer provided by user. Not needed for the Recaptcha implementation + * + * @return True if the answer is correct, false otherwise + * + * @since 2.5 + */ + public function onCheckAnswer($code = null) + { + $input = JFactory::getApplication()->input; + $privatekey = $this->params->get('private_key'); + $version = $this->params->get('version', '1.0'); + $remoteip = $input->server->get('REMOTE_ADDR', '', 'string'); + + switch ($version) + { + case '1.0': + $challenge = $input->get('recaptcha_challenge_field', '', 'string'); + $response = $input->get('recaptcha_response_field', '', 'string'); + $spam = ($challenge === '' || $response === ''); + break; + case '2.0': + // Challenge Not needed in 2.0 but needed for getResponse call + $challenge = null; + $response = $input->get('g-recaptcha-response', '', 'string'); + $spam = ($response === ''); + break; + } + + // Check for Private Key + if (empty($privatekey)) + { + $this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_NO_PRIVATE_KEY')); + + return false; + } + + // Check for IP + if (empty($remoteip)) + { + $this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_NO_IP')); + + return false; + } + + // Discard spam submissions + if ($spam) + { + $this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_EMPTY_SOLUTION')); + + return false; + } + + return $this->getResponse($privatekey, $remoteip, $response, $challenge); + } + + /** + * Get the reCaptcha response. + * + * @param string $privatekey The private key for authentication. + * @param string $remoteip The remote IP of the visitor. + * @param string $response The response received from Google. + * @param string $challenge The challenge field from the reCaptcha. Only for 1.0. + * + * @return bool True if response is good | False if response is bad. + * + * @since 3.4 + */ + private function getResponse($privatekey, $remoteip, $response, $challenge = null) + { + $version = $this->params->get('version', '1.0'); + + switch ($version) + { + case '1.0': + $response = $this->_recaptcha_http_post( + 'www.google.com', '/recaptcha/api/verify', + array( + 'privatekey' => $privatekey, + 'remoteip' => $remoteip, + 'challenge' => $challenge, + 'response' => $response + ) + ); + + $answers = explode("\n", $response[1]); + + if (trim($answers[0]) !== 'true') + { + // @todo use exceptions here + $this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_' . strtoupper(str_replace('-', '_', $answers[1])))); + + return false; + } + break; + case '2.0': + require_once 'recaptchalib.php'; + + $reCaptcha = new JReCaptcha($privatekey); + $response = $reCaptcha->verifyResponse($remoteip, $response); + + if (!isset($response->success) || !$response->success) + { + // @todo use exceptions here + if (is_array($response->errorCodes)) + { + foreach ($response->errorCodes as $error) + { + $this->_subject->setError($error); + } + } + + return false; + } + break; + } + + return true; + } + + /** + * Encodes the given data into a query string format. + * + * @param array $data Array of string elements to be encoded + * + * @return string Encoded request + * + * @since 2.5 + */ + private function _recaptcha_qsencode($data) + { + $req = ''; + + foreach ($data as $key => $value) + { + $req .= $key . '=' . urlencode(stripslashes($value)) . '&'; + } + + // Cut the last '&' + $req = rtrim($req, '&'); + + return $req; + } + + /** + * Submits an HTTP POST to a reCAPTCHA server. + * + * @param string $host Host name to POST to. + * @param string $path Path on host to POST to. + * @param array $data Data to be POSTed. + * @param int $port Optional port number on host. + * + * @return array Response + * + * @since 2.5 + */ + private function _recaptcha_http_post($host, $path, $data, $port = 80) + { + $req = $this->_recaptcha_qsencode($data); + + $http_request = "POST $path HTTP/1.0\r\n"; + $http_request .= "Host: $host\r\n"; + $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n"; + $http_request .= "Content-Length: " . strlen($req) . "\r\n"; + $http_request .= "User-Agent: reCAPTCHA/PHP\r\n"; + $http_request .= "\r\n"; + $http_request .= $req; + + $response = ''; + + if (($fs = @fsockopen($host, $port, $errno, $errstr, 10)) === false) + { + die('Could not open socket'); + } + + fwrite($fs, $http_request); + + while (!feof($fs)) + { + // One TCP-IP packet + $response .= fgets($fs, 1160); + } + + fclose($fs); + $response = explode("\r\n\r\n", $response, 2); + + return $response; + } + + /** + * Get the language tag or a custom translation + * + * @return string + * + * @since 2.5 + */ + private function _getLanguage() + { + $language = JFactory::getLanguage(); + + $tag = explode('-', $language->getTag()); + $tag = $tag[0]; + $available = array('en', 'pt', 'fr', 'de', 'nl', 'ru', 'es', 'tr'); + + if (in_array($tag, $available)) + { + return "lang : '" . $tag . "',"; + } + + // If the default language is not available, let's search for a custom translation + if ($language->hasKey('PLG_RECAPTCHA_CUSTOM_LANG')) + { + $custom[] = 'custom_translations : {'; + $custom[] = "\t" . 'instructions_visual : "' . JText::_('PLG_RECAPTCHA_INSTRUCTIONS_VISUAL') . '",'; + $custom[] = "\t" . 'instructions_audio : "' . JText::_('PLG_RECAPTCHA_INSTRUCTIONS_AUDIO') . '",'; + $custom[] = "\t" . 'play_again : "' . JText::_('PLG_RECAPTCHA_PLAY_AGAIN') . '",'; + $custom[] = "\t" . 'cant_hear_this : "' . JText::_('PLG_RECAPTCHA_CANT_HEAR_THIS') . '",'; + $custom[] = "\t" . 'visual_challenge : "' . JText::_('PLG_RECAPTCHA_VISUAL_CHALLENGE') . '",'; + $custom[] = "\t" . 'audio_challenge : "' . JText::_('PLG_RECAPTCHA_AUDIO_CHALLENGE') . '",'; + $custom[] = "\t" . 'refresh_btn : "' . JText::_('PLG_RECAPTCHA_REFRESH_BTN') . '",'; + $custom[] = "\t" . 'help_btn : "' . JText::_('PLG_RECAPTCHA_HELP_BTN') . '",'; + $custom[] = "\t" . 'incorrect_try_again : "' . JText::_('PLG_RECAPTCHA_INCORRECT_TRY_AGAIN') . '",'; + $custom[] = '},'; + $custom[] = "lang : '" . $tag . "',"; + + return implode("\n", $custom); + } + + // If nothing helps fall back to english + return ''; + } +} diff --git a/plugins/captcha/recaptcha/recaptcha.xml b/plugins/captcha/recaptcha/recaptcha.xml new file mode 100644 index 0000000..1325c6f --- /dev/null +++ b/plugins/captcha/recaptcha/recaptcha.xml @@ -0,0 +1,103 @@ + + + plg_captcha_recaptcha + 3.4.0 + December 2011 + Joomla! Project + admin@joomla.org + www.joomla.org + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + PLG_CAPTCHA_RECAPTCHA_XML_DESCRIPTION + + recaptcha.php + recaptchalib.php + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
diff --git a/plugins/captcha/recaptcha/recaptchalib.php b/plugins/captcha/recaptcha/recaptchalib.php new file mode 100644 index 0000000..ee969b7 --- /dev/null +++ b/plugins/captcha/recaptcha/recaptchalib.php @@ -0,0 +1,162 @@ +" . self::$_signupUrl . ""); + } + + $this->_secret = $secret; + } + + /** + * Encodes the given data into a query string format. + * + * @param array $data array of string elements to be encoded. + * + * @return string - encoded request. + */ + private function _encodeQS($data) + { + $req = ''; + + foreach ($data as $key => $value) + { + $req .= $key . '=' . urlencode(stripslashes($value)) . '&'; + } + + // Cut the last '&' + return substr($req, 0, strlen($req) - 1); + } + + /** + * Submits an HTTP GET to a reCAPTCHA server. + * + * @param string $path URL path to recaptcha server. + * @param array $data array of parameters to be sent. + * + * @return mixed JSON string or false on error + */ + private function _submitHTTPGet($path, $data) + { + $req = $this->_encodeQS($data); + + try + { + $http = JHttpFactory::getHttp(); + $result = $http->get($path . '?' . $req)->body; + } + catch (RuntimeException $e) + { + return false; + } + + return $result; + } + + /** + * Calls the reCAPTCHA siteverify API to verify whether the user passes + * CAPTCHA test. + * + * @param string $remoteIp IP address of end user. + * @param string $response response string from recaptcha verification. + * + * @return JReCaptchaResponse + */ + public function verifyResponse($remoteIp, $response) + { + // Discard empty solution submissions + if ($response === null || $response === '') + { + $recaptchaResponse = new JReCaptchaResponse(); + $recaptchaResponse->success = false; + $recaptchaResponse->errorCodes = 'missing-input'; + + return $recaptchaResponse; + } + + $getResponse = $this->_submitHttpGet( + self::$_siteVerifyUrl, + array( + 'secret' => $this->_secret, + 'remoteip' => $remoteIp, + 'v' => self::$_version, + 'response' => $response + ) + ); + + // Something is broken in submiting the http get request + if ($getResponse === false) + { + $recaptchaResponse->success = false; + } + + $answers = json_decode($getResponse, true); + $recaptchaResponse = new JReCaptchaResponse(); + + if (trim($answers['success']) !== '') + { + $recaptchaResponse->success = true; + } + else + { + $recaptchaResponse->success = false; + $recaptchaResponse->errorCodes = isset($answers['error-codes']) ? $answers['error-codes'] : ''; + } + + return $recaptchaResponse; + } +} \ No newline at end of file diff --git a/plugins/community/cmc/cmc.php b/plugins/community/cmc/cmc.php new file mode 100644 index 0000000..b3bbea5 --- /dev/null +++ b/plugins/community/cmc/cmc.php @@ -0,0 +1,266 @@ + + * @date 2016-04-15 + * + * @copyright Copyright (C) 2008 - 2016 compojoom.com - Daniel Dimitrov, Yves Hoppe. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE + */ + +defined('_JEXEC') or die('Restricted access'); + +JLoader::discover('cmcHelper', JPATH_ADMINISTRATOR . '/components/com_cmc/helpers/'); + +// Load Compojoom library +require_once JPATH_LIBRARIES . '/compojoom/include.php'; + +/** + * Class PlgCommunityCmc + * + * @since 1.4 + */ +class PlgCommunityCmc extends JPlugin +{ + /** + * Constructor + * + * @param object &$subject - The object to observe + * @param array $config - An optional associative array of configuration settings. + */ + public function __construct(&$subject, $config = array()) + { + $jlang = JFactory::getLanguage(); + $jlang->load('com_cmc', JPATH_ADMINISTRATOR, 'en-GB', true); + $jlang->load('com_cmc', JPATH_ADMINISTRATOR, $jlang->getDefault(), true); + $jlang->load('com_cmc', JPATH_ADMINISTRATOR, null, true); + $jlang->load('com_cmc.sys', JPATH_ADMINISTRATOR, 'en-GB', true); + $jlang->load('com_cmc.sys', JPATH_ADMINISTRATOR, $jlang->getDefault(), true); + $jlang->load('com_cmc.sys', JPATH_ADMINISTRATOR, null, true); + + parent::__construct($subject, $config); + } + + /** + * Manupulates the registration form + * + * @param string &$data - registration form data + * + * @return mixed + */ + public function onUserRegisterFormDisplay(&$data) + { + // Load the funky stuff + CompojoomHtmlBehavior::jquery(); + JHtml::stylesheet('media/plg_community_cmc/css/style.css'); + JHtml::script('media/plg_community_cmc/js/cmc.js'); + + // Create the xml for JForm + $builder = CmcHelperXmlbuilder::getInstance($this->params); + $xml = $builder->build(); + + $form = new JForm('myform'); + $form->addFieldPath(JPATH_ADMINISTRATOR . '/components/com_cmc/models/fields'); + $form->load($xml); + + $displayData = new stdClass; + $displayData->form = $form; + + $layout = new CompojoomLayoutFile('newsletter.form', JPATH_BASE . '/plugins/community/cmc/layouts'); + $html = $layout->render($displayData); + + $pos = strrpos($data, '
'); + $data = substr($data, 0, $pos) . $html . substr($data, $pos); + } + + /** + * Saves a temporary subscription if necessary + * + * @param array $data - post data + * + * @return bool + */ + public function onRegisterValidate($data) + { + // If newsletter was selected - save the user data! + if (isset($data['cmc']) && ((int) $data['cmc']['newsletter'] === 1)) + { + // Jomsocial doesn't create a user_id until the very last step + // that's why we will save the user token for referrence later on + $token = $this->getUserToken($data['authkey']); + $user = new stdClass; + $user->id = $token; + $postData = array(); + + $mappedData = $this->getMapping($this->params->get('mapfields'), $data); + + if (count($mappedData)) + { + $mergedGroups = array_merge($mappedData, $data['cmc_groups']); + $data = array_merge($data, array('cmc_groups' => $mergedGroups)); + } + + $postData['cmc']['listid'] = $data['cmc']['listid']; + $postData['cmc_groups'] = $data['cmc_groups']; + $postData['cmc_interests'] = $data['cmc_interests']; + CmcHelperRegistration::saveTempUser( + $user, + $postData, + _CPLG_JOMSOCIAL + ); + } + } + + /** + * Checks if we have a subscription and then does what is necessary - either activating it + * on the fly + * + * @param array $data - the user data + * @param boolean $isNew - true if the user is new + * @param boolean $result - the result of the save + * @param object $error - the error if any + * + * @return void + */ + public function onUserAfterSave($data, $isNew, $result, $error) + { + /** + * Jomsocial is calling the onUserAfterSave function around 3 times + * During the registration process. Because of that we end up sending 3 + * Emails telling the user to subscribe. Since this is stupid, we'll mark + * if we've sent a mail and won't try to do it over and over again + */ + static $mailSent = false; + + // If we have a token, let us check if we have a subscription + // And if we do, set the correct user_id + if (isset($data['token'])) + { + $subscription = $this->getSubscription($data['token']); + + if ($subscription) + { + $this->updateUserId($data['id'], $data['token']); + } + } + + // Now let us check if we have a subscription for the user id, this time using the user id + $subscription = $this->getSubscription($data['id']); + + if ($subscription && !$mailSent) + { + if ($data["block"] == 0) + { + $json = json_decode($subscription->params, true); + + // Directly activate user + CmcHelperRegistration::activateDirectUser( + JFactory::getUser($data["id"]), $json, _CPLG_JOMSOCIAL + ); + + $mailSent = true; + } + } + } + + /** + * Gets a user subscription + * + * @param string $token - the user token + * + * @return mixed + */ + private function getSubscription($token) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + + $query->select('*')->from('#__cmc_register') + ->where($db->qn('user_id') . '=' . $db->q($token)); + + $db->setQuery($query); + + return $db->loadObject(); + } + + /** + * Updates the user id and changes the token to a real id + * + * @param int $id - the user id + * @param string $token - the user token + * + * @return void + */ + private function updateUserId($id, $token) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + $query->update($db->qn('#__cmc_register'))->set( + $db->qn('user_id') . '=' . $db->q($id) + ) + ->where($db->qn('user_id') . '=' . $db->q($token)); + $db->setQuery($query); + + $db->execute(); + } + + /** + * Gets the user token by using the user auth_key + * + * @param string $key - the key + * + * @return bool + */ + private function getUserToken($key) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + $query->select($db->qn('token'))->from($db->qn('#__community_register_auth_token')) + ->where($db->qn('auth_key') . '=' . $db->q($key)); + $db->setQuery($query); + + $result = $db->loadObject(); + + return $result ? $result->token : false; + } + + /** + * Creates an array with the mapped data + * + * @param string $raw - the raw mapping definition as taken out of the params + * @param array $user - array with the user data + * + * @return array + */ + public static function getMapping($raw, $user) + { + if (!$raw) + { + return array(); + } + + $lines = explode("\n", trim($raw)); + $groups = array(); + + foreach ($lines as $line) + { + $map = explode('=', $line); + + if (strstr($map[1], ':')) + { + $parts = explode(':', $map[1]); + $field = explode(' ', $user[$parts[0]]); + + $value = trim($field[(int) $parts[1]]); + } + else + { + $value = $user[trim($map[1])]; + } + + $groups[$map[0]] = $value; + } + + return $groups; + } +} diff --git a/plugins/community/cmc/cmc.xml b/plugins/community/cmc/cmc.xml new file mode 100644 index 0000000..4301d07 --- /dev/null +++ b/plugins/community/cmc/cmc.xml @@ -0,0 +1,53 @@ + + + Community - CMC Registration plugin + compojoom.com + 2019-01-13 + Copyright (C) 2013 - 2019 compojoom.com. All rights reserved. + GNU/GPL http://www.gnu.org/licenses/gpl-3.0.html + https://compojoom.com + 4.1.2 + PLG_COMMUNITY_USER_REGISTRATION_DESCRIPTION + + cmc.xml +cmc.php +layouts + + + css +js + + + + + + +
+
+
+
+
\ No newline at end of file diff --git a/plugins/community/cmc/layouts/newsletter/form.php b/plugins/community/cmc/layouts/newsletter/form.php new file mode 100644 index 0000000..47908fb --- /dev/null +++ b/plugins/community/cmc/layouts/newsletter/form.php @@ -0,0 +1,37 @@ + + * @date 2016-04-15 + * + * @copyright Copyright (C) 2008 - 2016 compojoom.com - Daniel Dimitrov, Yves Hoppe. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE + */ + +defined('_JEXEC') or die('Restricted access'); + +$form = $displayData->form; + +$fieldsets = $form->getFieldsets(); + +foreach ($fieldsets as $key => $value) : + $fields = $form->getFieldset($key); + + foreach ($fields as $field) : ?> +
+ + label; ?> + + type) == 'list') + { + $field->class = $field->class . ' joms-select'; + } else { + $field->class = $field->class . ' joms-input'; + } + ?> + input; ?> + +
+ + \ No newline at end of file diff --git a/plugins/content/contact/contact.php b/plugins/content/contact/contact.php new file mode 100644 index 0000000..a22ddd1 --- /dev/null +++ b/plugins/content/contact/contact.php @@ -0,0 +1,112 @@ +get('link_author')) + { + return true; + } + + // Return if we don't have a valid article id + if (!isset($row->id) || !(int) $row->id) + { + return true; + } + + $contact = $this->getContactId($row->created_by); + $row->contactid = $contact->contactid; + + if ($row->contactid) + { + JLoader::register('ContactHelperRoute', JPATH_SITE . '/components/com_contact/helpers/route.php'); + $row->contact_link = JRoute::_(ContactHelperRoute::getContactRoute($contact->contactid . ':' . $contact->alias, $contact->catid)); + } + else + { + $row->contact_link = ''; + } + + return true; + } + + /** + * Retrieve Contact + * + * @param int $created_by Id of the user who created the contact + * + * @return mixed|null|integer + */ + protected function getContactId($created_by) + { + static $contacts = array(); + + if (isset($contacts[$created_by])) + { + return $contacts[$created_by]; + } + + $query = $this->db->getQuery(true); + + $query->select('MAX(contact.id) AS contactid, contact.alias, contact.catid'); + $query->from($this->db->quoteName('#__contact_details', 'contact')); + $query->where('contact.published = 1'); + $query->where('contact.user_id = ' . (int) $created_by); + + if (JLanguageMultilang::isEnabled() === true) + { + $query->where('(contact.language in ' + . '(' . $this->db->quote(JFactory::getLanguage()->getTag()) . ',' . $this->db->quote('*') . ') ' + . ' OR contact.language IS NULL)'); + } + + $this->db->setQuery($query); + + $contacts[$created_by] = $this->db->loadObject(); + + return $contacts[$created_by]; + } +} diff --git a/plugins/content/contact/contact.xml b/plugins/content/contact/contact.xml new file mode 100644 index 0000000..fe5aac1 --- /dev/null +++ b/plugins/content/contact/contact.xml @@ -0,0 +1,23 @@ + + + plg_content_contact + Joomla! Project + January 2014 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.2.2 + PLG_CONTENT_CONTACT_XML_DESCRIPTION + + contact.php + + + en-GB.plg_content_contact.ini + en-GB.plg_content_contact.sys.ini + + + + + + diff --git a/plugins/content/contact/index.html b/plugins/content/contact/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/content/contact/index.html @@ -0,0 +1 @@ + diff --git a/plugins/content/emailcloak/emailcloak.php b/plugins/content/emailcloak/emailcloak.php new file mode 100644 index 0000000..a6ed5f1 --- /dev/null +++ b/plugins/content/emailcloak/emailcloak.php @@ -0,0 +1,502 @@ +_cloak($row->text, $params); + } + + return $this->_cloak($row, $params); + } + + /** + * Generate a search pattern based on link and text. + * + * @param string $link The target of an email link. + * @param string $text The text enclosed by the link. + * + * @return string A regular expression that matches a link containing the parameters. + */ + protected function _getPattern ($link, $text) + { + $pattern = '~(?:]*)href\s*=\s*"mailto:' . $link . '"([^>]*))>' . $text . '~i'; + + return $pattern; + } + + /** + * Adds an attributes to the js cloaked email. + * + * @param string $jsEmail Js cloaked email. + * @param string $before Attributes before email. + * @param string $after Attributes after email. + * + * @return string Js cloaked email with attributes. + */ + protected function _addAttributesToEmail($jsEmail, $before, $after) + { + if ($before !== '') + { + $before = str_replace("'", "\'", $before); + $jsEmail = str_replace(".innerHTML += ''", "'\'{$after}>'", $jsEmail); + } + + return $jsEmail; + } + + /** + * Cloak all emails in text from spambots via Javascript. + * + * @param string &$text The string to be cloaked. + * @param mixed &$params Additional parameters. Parameter "mode" (integer, default 1) + * replaces addresses with "mailto:" links if nonzero. + * + * @return boolean True on success. + */ + protected function _cloak(&$text, &$params) + { + /* + * Check for presence of {emailcloak=off} which is explicits disables this + * bot for the item. + */ + if (StringHelper::strpos($text, '{emailcloak=off}') !== false) + { + $text = StringHelper::str_ireplace('{emailcloak=off}', '', $text); + + return true; + } + + // Simple performance check to determine whether bot should process further. + if (StringHelper::strpos($text, '@') === false) + { + return true; + } + + $mode = $this->params->def('mode', 1); + + // Example: any@example.org + $searchEmail = '([\w\.\'\-\+]+\@(?:[a-z0-9\.\-]+\.)+(?:[a-zA-Z0-9\-]{2,10}))'; + + // Example: any@example.org?subject=anyText + $searchEmailLink = $searchEmail . '([?&][\x20-\x7f][^"<>]+)'; + + // Any Text + $searchText = '((?:[\x20-\x7f]|[\xA1-\xFF]|[\xC2-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF4][\x80-\xBF]{3})[^<>]+)'; + + // Any Image link + $searchImage = '(]+>)'; + + // Any Text with ||)'; + + // Any address with ||)'; + + /* + * Search and fix derivatives of link code email@example.org. This happens when inserting an email in TinyMCE, cancelling its suggestion to add + * the mailto: prefix... + */ + $pattern = $this->_getPattern($searchEmail, $searchEmail); + $pattern = str_replace('"mailto:', '"http://mce_host([\x20-\x7f][^<>]+/)', $pattern); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[3][0]; + $mailText = $regs[5][0]; + + // Check to see if mail text is different from mail addy + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = $this->_addAttributesToEmail($replacement, $regs[1][0], $regs[4][0]); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search and fix derivatives of link code anytext. This happens when inserting an email in TinyMCE, cancelling its suggestion to add + * the mailto: prefix... + */ + $pattern = $this->_getPattern($searchEmail, $searchText); + $pattern = str_replace('"mailto:', '"http://mce_host([\x20-\x7f][^<>]+/)', $pattern); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[3][0]; + $mailText = $regs[5][0]; + + // Check to see if mail text is different from mail addy + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText, 0); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = $this->_addAttributesToEmail($replacement, $regs[1][0], $regs[4][0]); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for derivatives of link code email@example.org + */ + $pattern = $this->_getPattern($searchEmail, $searchEmail); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[2][0]; + $mailText = $regs[4][0]; + + // Check to see if mail text is different from mail addy + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = $this->_addAttributesToEmail($replacement, $regs[1][0], $regs[3][0]); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for derivatives of link code email@amail.com + */ + $pattern = $this->_getPattern($searchEmail, $searchEmailSpan); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[2][0]; + $mailText = $regs[4][0] . $regs[5][0] . $regs[6][0]; + + // Check to see if mail text is different from mail addy + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = html_entity_decode($this->_addAttributesToEmail($replacement, $regs[1][0], $regs[3][0])); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for derivatives of link code + * anytext + */ + $pattern = $this->_getPattern($searchEmail, $searchTextSpan); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[2][0]; + $mailText = $regs[4][0] . addslashes($regs[5][0]) . $regs[6][0]; + + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText, 0); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = html_entity_decode($this->_addAttributesToEmail($replacement, $regs[1][0], $regs[3][0])); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for derivatives of link code + * anytext + */ + $pattern = $this->_getPattern($searchEmail, $searchText); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[2][0]; + $mailText = addslashes($regs[4][0]); + + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText, 0); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = $this->_addAttributesToEmail($replacement, $regs[1][0], $regs[3][0]); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for derivatives of link code + * + */ + $pattern = $this->_getPattern($searchEmail, $searchImage); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[2][0]; + $mailText = $regs[4][0]; + + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText, 0); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = html_entity_decode($this->_addAttributesToEmail($replacement, $regs[1][0], $regs[3][0])); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for derivatives of link code + * email@example.org + */ + $pattern = $this->_getPattern($searchEmail, $searchImage . $searchEmail); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[2][0]; + $mailText = $regs[4][0] . $regs[5][0]; + + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = html_entity_decode($this->_addAttributesToEmail($replacement, $regs[1][0], $regs[3][0])); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for derivatives of link code + * any text + */ + $pattern = $this->_getPattern($searchEmail, $searchImage . $searchText); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[2][0]; + $mailText = $regs[4][0] . addslashes($regs[5][0]); + + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText, 0); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = html_entity_decode($this->_addAttributesToEmail($replacement, $regs[1][0], $regs[3][0])); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for derivatives of link code email@example.org + */ + $pattern = $this->_getPattern($searchEmailLink, $searchEmail); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[2][0] . $regs[3][0]; + $mailText = $regs[5][0]; + + // Needed for handling of Body parameter + $mail = str_replace('&', '&', $mail); + + // Check to see if mail text is different from mail addy + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = $this->_addAttributesToEmail($replacement, $regs[1][0], $regs[4][0]); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for derivatives of link code anytext + */ + $pattern = $this->_getPattern($searchEmailLink, $searchText); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[2][0] . $regs[3][0]; + $mailText = addslashes($regs[5][0]); + + // Needed for handling of Body parameter + $mail = str_replace('&', '&', $mail); + + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText, 0); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = $this->_addAttributesToEmail($replacement, $regs[1][0], $regs[4][0]); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for derivatives of link code email@amail.com + */ + $pattern = $this->_getPattern($searchEmailLink, $searchEmailSpan); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[2][0] . $regs[3][0]; + $mailText = $regs[5][0] . $regs[6][0] . $regs[7][0]; + + // Check to see if mail text is different from mail addy + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = html_entity_decode($this->_addAttributesToEmail($replacement, $regs[1][0], $regs[4][0])); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for derivatives of link code + * anytext + */ + $pattern = $this->_getPattern($searchEmailLink, $searchTextSpan); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[2][0] . $regs[3][0]; + $mailText = $regs[5][0] . addslashes($regs[6][0]) . $regs[7][0]; + + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText, 0); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = html_entity_decode($this->_addAttributesToEmail($replacement, $regs[1][0], $regs[4][0])); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for derivatives of link code + * + */ + $pattern = $this->_getPattern($searchEmailLink, $searchImage); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[1][0] . $regs[2][0] . $regs[3][0]; + $mailText = $regs[5][0]; + + // Needed for handling of Body parameter + $mail = str_replace('&', '&', $mail); + + // Check to see if mail text is different from mail addy + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText, 0); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = html_entity_decode($this->_addAttributesToEmail($replacement, $regs[1][0], $regs[4][0])); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for derivatives of link code + * email@amail.com + */ + $pattern = $this->_getPattern($searchEmailLink, $searchImage . $searchEmail); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[1][0] . $regs[2][0] . $regs[3][0]; + $mailText = $regs[4][0] . $regs[5][0] . $regs[6][0]; + + // Needed for handling of Body parameter + $mail = str_replace('&', '&', $mail); + + // Check to see if mail text is different from mail addy + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = html_entity_decode($this->_addAttributesToEmail($replacement, $regs[1][0], $regs[4][0])); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for derivatives of link code + * any text + */ + $pattern = $this->_getPattern($searchEmailLink, $searchImage . $searchText); + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[1][0] . $regs[2][0] . $regs[3][0]; + $mailText = $regs[4][0] . $regs[5][0] . addslashes($regs[6][0]); + + // Needed for handling of Body parameter + $mail = str_replace('&', '&', $mail); + + // Check to see if mail text is different from mail addy + $replacement = JHtml::_('email.cloak', $mail, $mode, $mailText, 0); + + // Ensure that attributes is not stripped out by email cloaking + $replacement = html_entity_decode($this->_addAttributesToEmail($replacement, $regs[1][0], $regs[4][0])); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[0][1], strlen($regs[0][0])); + } + + /* + * Search for plain text email addresses, such as email@example.org but not within HTML tags: + * or + * The negative lookahead '(?![^<]*>)' is used to exclude this kind of occurrences + */ + $pattern = '~(?![^<>]*>)' . $searchEmail . '~i'; + + while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) + { + $mail = $regs[1][0]; + $replacement = JHtml::_('email.cloak', $mail, $mode); + + // Replace the found address with the js cloaked email + $text = substr_replace($text, $replacement, $regs[1][1], strlen($mail)); + } + + return true; + } +} diff --git a/plugins/content/emailcloak/emailcloak.xml b/plugins/content/emailcloak/emailcloak.xml new file mode 100644 index 0000000..ac0ae63 --- /dev/null +++ b/plugins/content/emailcloak/emailcloak.xml @@ -0,0 +1,35 @@ + + + plg_content_emailcloak + Joomla! Project + November 2005 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_CONTENT_EMAILCLOAK_XML_DESCRIPTION + + emailcloak.php + + + en-GB.plg_content_emailcloak.ini + en-GB.plg_content_emailcloak.sys.ini + + + +
+ + + + +
+
+
+
diff --git a/plugins/content/emailcloak/index.html b/plugins/content/emailcloak/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/content/emailcloak/index.html @@ -0,0 +1 @@ + diff --git a/plugins/content/fields/fields.php b/plugins/content/fields/fields.php new file mode 100644 index 0000000..029c911 --- /dev/null +++ b/plugins/content/fields/fields.php @@ -0,0 +1,168 @@ +text is also available + * @param object &$params The article params + * @param int $page The 'page' number + * + * @return void + * + * @since 3.7.0 + */ + public function onContentPrepare($context, &$item, &$params, $page = 0) + { + // If the item has a context, overwrite the existing one + if ($context == 'com_finder.indexer' && !empty($item->context)) + { + $context = $item->context; + } + elseif ($context == 'com_finder.indexer') + { + // Don't run this plugin when the content is being indexed and we have no real context + return; + } + + // Don't run if there is no text property (in case of bad calls) or it is empty + if (empty($item->text)) + { + return; + } + + // Simple performance check to determine whether bot should process further + if (strpos($item->text, 'field') === false) + { + return; + } + + // Register FieldsHelper + JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php'); + + // Prepare the text + if (isset($item->text)) + { + $item->text = $this->prepare($item->text, $context, $item); + } + + // Prepare the intro text + if (isset($item->introtext)) + { + $item->introtext = $this->prepare($item->introtext, $context, $item); + } + } + + /** + * Prepares the given string by parsing {field} and {fieldgroup} groups and replacing them. + * + * @param string $string The text to prepare + * @param string $context The context of the content + * @param object $item The item object + * + * @return string + * + * @since 3.8.1 + */ + private function prepare($string, $context, $item) + { + // Search for {field ID} or {fieldgroup ID} tags and put the results into $matches. + $regex = '/{(field|fieldgroup)\s+(.*?)}/i'; + preg_match_all($regex, $string, $matches, PREG_SET_ORDER); + + if (!$matches) + { + return $string; + } + + $parts = FieldsHelper::extract($context); + + if (count($parts) < 2) + { + return $string; + } + + $context = $parts[0] . '.' . $parts[1]; + $fields = FieldsHelper::getFields($context, $item, true); + $fieldsById = array(); + $groups = array(); + + // Rearranging fields in arrays for easier lookup later. + foreach ($fields as $field) + { + $fieldsById[$field->id] = $field; + $groups[$field->group_id][] = $field; + } + + foreach ($matches as $i => $match) + { + // $match[0] is the full pattern match, $match[1] is the type (field or fieldgroup) and $match[2] the ID and optional the layout + $explode = explode(',', $match[2]); + $id = (int) $explode[0]; + $layout = !empty($explode[1]) ? trim($explode[1]) : 'render'; + $output = ''; + + if ($match[1] == 'field' && $id) + { + if (isset($fieldsById[$id])) + { + $output = FieldsHelper::render( + $context, + 'field.' . $layout, + array( + 'item' => $item, + 'context' => $context, + 'field' => $fieldsById[$id] + ) + ); + } + } + else + { + if ($match[2] === '*') + { + $match[0] = str_replace('*', '\*', $match[0]); + $renderFields = $fields; + } + else + { + $renderFields = isset($groups[$id]) ? $groups[$id] : ''; + } + + if ($renderFields) + { + $output = FieldsHelper::render( + $context, + 'fields.' . $layout, + array( + 'item' => $item, + 'context' => $context, + 'fields' => $renderFields + ) + ); + } + } + + $string = preg_replace("|$match[0]|", addcslashes($output, '\\$'), $string, 1); + } + + return $string; + } +} diff --git a/plugins/content/fields/fields.xml b/plugins/content/fields/fields.xml new file mode 100644 index 0000000..2ebcd27 --- /dev/null +++ b/plugins/content/fields/fields.xml @@ -0,0 +1,21 @@ + + + plg_content_fields + Joomla! Project + February 2017 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.7.0 + PLG_CONTENT_FIELDS_XML_DESCRIPTION + + fields.php + + + +
+
+
+
+
diff --git a/plugins/content/finder/finder.php b/plugins/content/finder/finder.php new file mode 100644 index 0000000..bf1bf43 --- /dev/null +++ b/plugins/content/finder/finder.php @@ -0,0 +1,126 @@ +trigger('onFinderAfterSave', array($context, $article, $isNew)); + } + + /** + * Smart Search before save content method. + * Content is passed by reference. Method is called before the content is saved. + * + * @param string $context The context of the content passed to the plugin (added in 1.6). + * @param object $article A JTableContent object. + * @param bool $isNew If the content is just about to be created. + * + * @return void + * + * @since 2.5 + */ + public function onContentBeforeSave($context, $article, $isNew) + { + $dispatcher = JEventDispatcher::getInstance(); + JPluginHelper::importPlugin('finder'); + + // Trigger the onFinderBeforeSave event. + $dispatcher->trigger('onFinderBeforeSave', array($context, $article, $isNew)); + } + + /** + * Smart Search after delete content method. + * Content is passed by reference, but after the deletion. + * + * @param string $context The context of the content passed to the plugin (added in 1.6). + * @param object $article A JTableContent object. + * + * @return void + * + * @since 2.5 + */ + public function onContentAfterDelete($context, $article) + { + $dispatcher = JEventDispatcher::getInstance(); + JPluginHelper::importPlugin('finder'); + + // Trigger the onFinderAfterDelete event. + $dispatcher->trigger('onFinderAfterDelete', array($context, $article)); + } + + /** + * Smart Search content state change method. + * Method to update the link information for items that have been changed + * from outside the edit screen. This is fired when the item is published, + * unpublished, archived, or unarchived from the list view. + * + * @param string $context The context for the content passed to the plugin. + * @param array $pks A list of primary key ids of the content that has changed state. + * @param integer $value The value of the state that the content has been changed to. + * + * @return void + * + * @since 2.5 + */ + public function onContentChangeState($context, $pks, $value) + { + $dispatcher = JEventDispatcher::getInstance(); + JPluginHelper::importPlugin('finder'); + + // Trigger the onFinderChangeState event. + $dispatcher->trigger('onFinderChangeState', array($context, $pks, $value)); + } + + /** + * Smart Search change category state content method. + * Method is called when the state of the category to which the + * content item belongs is changed. + * + * @param string $extension The extension whose category has been updated. + * @param array $pks A list of primary key ids of the content that has changed state. + * @param integer $value The value of the state that the content has been changed to. + * + * @return void + * + * @since 2.5 + */ + public function onCategoryChangeState($extension, $pks, $value) + { + $dispatcher = JEventDispatcher::getInstance(); + JPluginHelper::importPlugin('finder'); + + // Trigger the onFinderCategoryChangeState event. + $dispatcher->trigger('onFinderCategoryChangeState', array($extension, $pks, $value)); + } +} diff --git a/plugins/content/finder/finder.xml b/plugins/content/finder/finder.xml new file mode 100644 index 0000000..afd1963 --- /dev/null +++ b/plugins/content/finder/finder.xml @@ -0,0 +1,24 @@ + + + plg_content_finder + Joomla! Project + December 2011 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_CONTENT_FINDER_XML_DESCRIPTION + + + finder.php + + + en-GB.plg_content_finder.ini + en-GB.plg_content_finder.sys.ini + + + + + + diff --git a/plugins/content/finder/index.html b/plugins/content/finder/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/content/finder/index.html @@ -0,0 +1 @@ + diff --git a/plugins/content/index.html b/plugins/content/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/content/index.html @@ -0,0 +1 @@ + diff --git a/plugins/content/jce/css/index.html b/plugins/content/jce/css/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/plugins/content/jce/css/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/content/jce/css/media.css b/plugins/content/jce/css/media.css new file mode 100644 index 0000000..fcd4259 --- /dev/null +++ b/plugins/content/jce/css/media.css @@ -0,0 +1,2 @@ +/*JCE Editor - 2.5.30 | 17 October 2016 | http://www.joomlacontenteditor.net | Copyright (C) 2006 - 2016 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html*/ +.field-media-wrapper .modal{height:90vh;}.field-media-wrapper .modal .modal-body{max-height:100%!important;}.field-media-wrapper .modal .modal-body iframe{height:calc(90vh - 120px)!important;} \ No newline at end of file diff --git a/plugins/content/jce/jce.php b/plugins/content/jce/jce.php new file mode 100644 index 0000000..23ecb97 --- /dev/null +++ b/plugins/content/jce/jce.php @@ -0,0 +1,25 @@ +triggerEvent('onPlgSystemJceContentPrepareForm', array($form, $data)); + } +} diff --git a/plugins/content/jce/jce.xml b/plugins/content/jce/jce.xml new file mode 100644 index 0000000..dd07915 --- /dev/null +++ b/plugins/content/jce/jce.xml @@ -0,0 +1,16 @@ + + + plg_content_jce + 2.5.30 + 17 October 2016 + Ryan Demmer + info@joomlacontenteditor.net + http://www.joomlacontenteditor.net + Copyright (C) 2006 - 2016 Ryan Demmer. All rights reserved + GNU/GPL Version 2 - http://www.gnu.org/licenses/gpl-2.0.html + PLG_CONTENT_JCE_XML_DESCRIPTION + + jce.php + css + + diff --git a/plugins/content/joomla/index.html b/plugins/content/joomla/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/content/joomla/index.html @@ -0,0 +1 @@ + diff --git a/plugins/content/joomla/joomla.php b/plugins/content/joomla/joomla.php new file mode 100644 index 0000000..a6e624d --- /dev/null +++ b/plugins/content/joomla/joomla.php @@ -0,0 +1,302 @@ +params->def('email_new_fe', 1)) + { + return true; + } + + // Check this is a new article. + if (!$isNew) + { + return true; + } + + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__users')) + ->where($db->quoteName('sendEmail') . ' = 1') + ->where($db->quoteName('block') . ' = 0'); + $db->setQuery($query); + $users = (array) $db->loadColumn(); + + if (empty($users)) + { + return true; + } + + $user = JFactory::getUser(); + + // Messaging for new items + JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_messages/models', 'MessagesModel'); + JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_messages/tables'); + + $default_language = JComponentHelper::getParams('com_languages')->get('administrator'); + $debug = JFactory::getConfig()->get('debug_lang'); + $result = true; + + foreach ($users as $user_id) + { + if ($user_id != $user->id) + { + // Load language for messaging + $receiver = JUser::getInstance($user_id); + $lang = JLanguage::getInstance($receiver->getParam('admin_language', $default_language), $debug); + $lang->load('com_content'); + $message = array( + 'user_id_to' => $user_id, + 'subject' => $lang->_('COM_CONTENT_NEW_ARTICLE'), + 'message' => sprintf($lang->_('COM_CONTENT_ON_NEW_CONTENT'), $user->get('name'), $article->title) + ); + $model_message = JModelLegacy::getInstance('Message', 'MessagesModel'); + $result = $model_message->save($message); + } + } + + return $result; + } + + /** + * Don't allow categories to be deleted if they contain items or subcategories with items + * + * @param string $context The context for the content passed to the plugin. + * @param object $data The data relating to the content that was deleted. + * + * @return boolean + * + * @since 1.6 + */ + public function onContentBeforeDelete($context, $data) + { + // Skip plugin if we are deleting something other than categories + if ($context !== 'com_categories.category') + { + return true; + } + + // Check if this function is enabled. + if (!$this->params->def('check_categories', 1)) + { + return true; + } + + $extension = JFactory::getApplication()->input->getString('extension'); + + // Default to true if not a core extension + $result = true; + + $tableInfo = array( + 'com_banners' => array('table_name' => '#__banners'), + 'com_contact' => array('table_name' => '#__contact_details'), + 'com_content' => array('table_name' => '#__content'), + 'com_newsfeeds' => array('table_name' => '#__newsfeeds'), + 'com_weblinks' => array('table_name' => '#__weblinks') + ); + + // Now check to see if this is a known core extension + if (isset($tableInfo[$extension])) + { + // Get table name for known core extensions + $table = $tableInfo[$extension]['table_name']; + + // See if this category has any content items + $count = $this->_countItemsInCategory($table, $data->get('id')); + + // Return false if db error + if ($count === false) + { + $result = false; + } + else + { + // Show error if items are found in the category + if ($count > 0) + { + $msg = JText::sprintf('COM_CATEGORIES_DELETE_NOT_ALLOWED', $data->get('title')) + . JText::plural('COM_CATEGORIES_N_ITEMS_ASSIGNED', $count); + JError::raiseWarning(403, $msg); + $result = false; + } + + // Check for items in any child categories (if it is a leaf, there are no child categories) + if (!$data->isLeaf()) + { + $count = $this->_countItemsInChildren($table, $data->get('id'), $data); + + if ($count === false) + { + $result = false; + } + elseif ($count > 0) + { + $msg = JText::sprintf('COM_CATEGORIES_DELETE_NOT_ALLOWED', $data->get('title')) + . JText::plural('COM_CATEGORIES_HAS_SUBCATEGORY_ITEMS', $count); + JError::raiseWarning(403, $msg); + $result = false; + } + } + } + + return $result; + } + } + + /** + * Get count of items in a category + * + * @param string $table table name of component table (column is catid) + * @param integer $catid id of the category to check + * + * @return mixed count of items found or false if db error + * + * @since 1.6 + */ + private function _countItemsInCategory($table, $catid) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + + // Count the items in this category + $query->select('COUNT(id)') + ->from($table) + ->where('catid = ' . $catid); + $db->setQuery($query); + + try + { + $count = $db->loadResult(); + } + catch (RuntimeException $e) + { + JError::raiseWarning(500, $e->getMessage()); + + return false; + } + + return $count; + } + + /** + * Get count of items in a category's child categories + * + * @param string $table table name of component table (column is catid) + * @param integer $catid id of the category to check + * @param object $data The data relating to the content that was deleted. + * + * @return mixed count of items found or false if db error + * + * @since 1.6 + */ + private function _countItemsInChildren($table, $catid, $data) + { + $db = JFactory::getDbo(); + + // Create subquery for list of child categories + $childCategoryTree = $data->getTree(); + + // First element in tree is the current category, so we can skip that one + unset($childCategoryTree[0]); + $childCategoryIds = array(); + + foreach ($childCategoryTree as $node) + { + $childCategoryIds[] = $node->id; + } + + // Make sure we only do the query if we have some categories to look in + if (count($childCategoryIds)) + { + // Count the items in this category + $query = $db->getQuery(true) + ->select('COUNT(id)') + ->from($table) + ->where('catid IN (' . implode(',', $childCategoryIds) . ')'); + $db->setQuery($query); + + try + { + $count = $db->loadResult(); + } + catch (RuntimeException $e) + { + JError::raiseWarning(500, $e->getMessage()); + + return false; + } + + return $count; + } + else + // If we didn't have any categories to check, return 0 + { + return 0; + } + } + + /** + * Change the state in core_content if the state in a table is changed + * + * @param string $context The context for the content passed to the plugin. + * @param array $pks A list of primary key ids of the content that has changed state. + * @param integer $value The value of the state that the content has been changed to. + * + * @return boolean + * + * @since 3.1 + */ + public function onContentChangeState($context, $pks, $value) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('core_content_id')) + ->from($db->quoteName('#__ucm_content')) + ->where($db->quoteName('core_type_alias') . ' = ' . $db->quote($context)) + ->where($db->quoteName('core_content_item_id') . ' IN (' . $pksImploded = implode(',', $pks) . ')'); + $db->setQuery($query); + $ccIds = $db->loadColumn(); + + $cctable = new JTableCorecontent($db); + $cctable->publish($ccIds, $value); + + return true; + } +} diff --git a/plugins/content/joomla/joomla.xml b/plugins/content/joomla/joomla.xml new file mode 100644 index 0000000..f77f91a --- /dev/null +++ b/plugins/content/joomla/joomla.xml @@ -0,0 +1,49 @@ + + + plg_content_joomla + Joomla! Project + November 2010 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_CONTENT_JOOMLA_XML_DESCRIPTION + + joomla.php + + + en-GB.plg_content_joomla.ini + en-GB.plg_content_joomla.sys.ini + + + +
+ + + + + + + + + +
+
+
+ +
diff --git a/plugins/content/loadformmaker/index.html b/plugins/content/loadformmaker/index.html new file mode 100644 index 0000000..f8d8b0e --- /dev/null +++ b/plugins/content/loadformmaker/index.html @@ -0,0 +1 @@ + diff --git a/plugins/content/loadformmaker/loadformmaker.php b/plugins/content/loadformmaker/loadformmaker.php new file mode 100644 index 0000000..15c423c --- /dev/null +++ b/plugins/content/loadformmaker/loadformmaker.php @@ -0,0 +1,26139 @@ +load('com_formmaker',JPATH_BASE); + + + +//The Content plugin Loadmodule + +class plgContentLoadformmaker extends JPlugin + +{ + + /** + + * Plugin that loads module positions within content + + */ + +// onPrepareContent, meaning the plugin is rendered at the first stage in preparing content for output + + public function onContentPrepare($context, &$row, &$params, $page=0 ) + + { + + + + // A database connection is created + + $db = JFactory::getDBO(); + + // simple performance check to determine whether bot should process further + + if ( JString::strpos( $row->text, 'loadformmaker' ) === false ) { + + return true; + + } + + // expression to search for + + $regex = '/{loadformmaker\s*.*?}/i'; + + + + // check whether plugin has been unpublished + + if ( !$this->params->get( 'enabled', 1 ) ) { + + $row->text = preg_replace( $regex, '', $row->text ); + + return true; + + } + + + + // find all instances of plugin and put in $matches + + preg_match_all( $regex, $row->text, $matches ); + + //print_r($matches); + + // Number of plugins + + $count = count( $matches[0] ); + + // plugin only processes if there are any instances of the plugin in the text + + if ( $count ) { + + // Get plugin parameters + + $this->_process( $row, $matches, $count, $regex ); + + } + + // No return value + + } + +// The proccessing function + + protected function _process( &$row, &$matches, $count, $regex ) + + { + + + + for ( $i=0; $i < $count; $i++ ) + + { + + $load = str_replace( 'loadformmaker', '', $matches[0][$i] ); + + $load = str_replace( '{', '', $load ); + + $load = str_replace( '}', '', $load ); + + $load = trim( $load ); + + if(!$load) + + continue; + + + + $modules = $this->_load( $load ); + + + + $plugin = JPluginHelper::getPlugin('content', 'emailcloak'); + + if (isset($plugin->type)) + + { + + $modules="{emailcloak=off}".$modules; + + } + + + + $row->text = str_replace( $matches[0][$i] , $modules, $row->text ); + + } + + + + // removes tags without matching module positions + + $row->text = preg_replace( $regex, '', $row->text ); + + } + +// The function who takes care for the 'completing' of the plugins' actions : loading the module(s) + + protected function _load( $form ) + + { + + $result = $this->showform( $form); + + if(!$result) + + return; + + + + $ok = $this->savedata($form, $result[0] ); + + + + if(is_numeric($ok)) + + $this->remove($ok); + + + + $old = false; + + + + if(isset($result[0]->form) ) + + $old = true; + + + + + + + + $document = JFactory::getDocument(); + + + + $cmpnt_js_path = JURI::root(true).'/components/com_formmaker/views/formmaker/tmpl'; + + JHTML::_('behavior.tooltip'); + + JHTML::_('behavior.calendar'); + + + + $document->addStyleSheet($cmpnt_js_path.'/jquery-ui-spinner.css'); + + + + ?> + + + + + + + + + + + + + + form=='')) { ?> + + + + + + + + + + + + defaultphp($result[0], $result[1], $result[2], $result[3], $result[4], $form,$ok); + + + + } + + + + protected function showform($id) + + { + + $input_get = JFactory::getApplication()->input; + + + + $Itemid=$input_get->getString('Itemid'.$id); + + + + $db = JFactory::getDBO(); + + $db->setQuery("SELECT * FROM #__formmaker WHERE id=".$db->escape((int)$id) ); + + $row = $db->loadObject(); + + if ($db->getErrorNum()) {echo $db->stderr();return false;} + + + + if(!$row) + + return false; + + + + if($row->published!=1) + + return false; + + + + $test_theme = $input_get->getString('test_theme'); + + $row->theme = (isset($test_theme) ? $test_theme : $row->theme); + + $db->setQuery("SELECT css FROM #__formmaker_themes WHERE id=".$db->escape($row->theme) ); + + $form_theme = $db->loadResult(); + + if ($db->getErrorNum()) {echo $db->stderr(); return false;} + + + + $label_id= array(); + + $label_type= array(); + + + + $label_all = explode('#****#',$row->label_order); + + $label_all = array_slice($label_all,0, count($label_all)-1); + + + + foreach($label_all as $key => $label_each) + + { + + $label_id_each=explode('#**id**#',$label_each); + + array_push($label_id, $label_id_each[0]); + + + + $label_order_each=explode('#**label**#', $label_id_each[1]); + + + + array_push($label_type, $label_order_each[1]); + + } + + + + return array($row, $Itemid, $label_id, $label_type, $form_theme); + + } + + + + protected function savedata($id, $form) + + { + $mainframe = JFactory::getApplication(); + $input_get = JFactory::getApplication()->input; + + $all_files=array(); + + $correct=false; + + $db = JFactory::getDBO(); + + @session_start(); + + + + $captcha_input=$input_get->getString("captcha_input"); + + $recaptcha_response_field=$input_get->getString("recaptcha_response_field"); + + $counter=$input_get->getString("counter".$id); + + if(isset($counter)) + + { + + if (isset($captcha_input)) + + { + + $session_wd_captcha_code=isset($_SESSION[$id.'_wd_captcha_code'])?$_SESSION[$id.'_wd_captcha_code']:'-'; + + + + if($captcha_input==$session_wd_captcha_code) + + { + + $correct=true; + + } + + else + + { + + echo ""; + + } + + } + + + + else + + if(isset($recaptcha_response_field)) + + { + + $privatekey = $form->private_key; + + + + $resp = recaptcha_check_answer ($privatekey, + + $_SERVER["REMOTE_ADDR"], + + $_POST["recaptcha_challenge_field"], + + $recaptcha_response_field); + + if($resp->is_valid) + + { + + $correct=true; + + } + + else + + { + + echo ""; + + } + + } + + + + else + + + + $correct=true; + + + + + + + + if($correct) + + { + + + + $ip=$_SERVER['REMOTE_ADDR']; + + + + $db->setQuery("SELECT ip FROM #__formmaker_blocked WHERE ip LIKE '%".$ip."%'"); + $db->query(); + $blocked_ip = $db->loadResult(); + + if($blocked_ip) + $mainframe->redirect($_SERVER["REQUEST_URI"], addslashes(JText::_('WDF_BLOCKED_IP'))); + + + $result_temp=$this->save_db($counter, $id); + + + + + + $all_files=$result_temp[0]; + + if(is_numeric($all_files)) + + $this->remove($all_files); + + else + + if(isset($counter)) + + $this->gen_mail($counter, $all_files,$result_temp[1], $id); + + + + } + + + + + + return $all_files; + + } + + + + return $all_files; + + + + + + } + + + + protected function save_db($counter,$id) + + { + + $input_get = JFactory::getApplication()->input; + + $chgnac=true; + + $all_files=array(); + + $paypal=array(); + + + + $paypal['item_name']=array(); + + + + $paypal['quantity']=array(); + + + + $paypal['amount']=array(); + + $is_amount=false; + + + $paypal['on_os']=array(); + + + + $total=0; + + + + $form_currency='$'; + + + + $currency_code=array('USD', 'EUR', 'GBP', 'JPY', 'CAD', 'MXN', 'HKD', 'HUF', 'NOK', 'NZD', 'SGD', 'SEK', 'PLN', 'AUD', 'DKK', 'CHF', 'CZK', 'ILS', 'BRL', 'TWD', 'MYR', 'PHP', 'THB'); + + + + $currency_sign=array('$' , '€' , '£' , 'Â¥' , 'C$', 'Mex$', 'HK$', 'Ft' , 'kr' , 'NZ$', 'S$' , 'kr' , 'zÅ‚' , 'A$' , 'kr' , 'CHF' , 'KÄ', '₪' , 'R$' , 'NT$', 'RM' , '₱' , '฿' ); + + + + + + JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_formmaker'.DS.'tables'); + + $form = JTable::getInstance('formmaker', 'Table'); + + $form->load( $id); + + + + if($form->payment_currency) + + + + $form_currency= $currency_sign[array_search($form->payment_currency, $currency_code)]; + + + + $old = false; + + + + if(isset($form->form)) + + $old = true; + + + + $label_id= array(); + + $label_label= array(); + + $label_type= array(); + + $disabled_fields = explode(',',$input_get->getString("disabled_fields".$id)); + $disabled_fields = array_slice($disabled_fields,0, count($disabled_fields)-1); + + if($old == false || ($old == true && $form->form=='')) + + $label_all = explode('#****#',$form->label_order_current); + + else + + $label_all = explode('#****#',$form->label_order); + + $label_all = array_slice($label_all,0, count($label_all)-1); + + + + foreach($label_all as $key => $label_each) + + { + + $label_id_each=explode('#**id**#',$label_each); + + array_push($label_id, $label_id_each[0]); + + + + $label_order_each=explode('#**label**#', $label_id_each[1]); + + + + array_push($label_label, $label_order_each[0]); + + array_push($label_type, $label_order_each[1]); + + } + + + + + + + + $db = JFactory::getDBO(); + + $db->setQuery("SELECT MAX( group_id ) FROM #__formmaker_submits" ); + + $db->query(); + + $max = $db->loadResult(); + + $fvals=array(); + + + if($old == false || ($old == true && $form->form=='')) + + { + + + + + + foreach($label_type as $key => $type) + + { + + + + $value=''; + + if($type=="type_submit_reset" or $type=="type_map" or $type=="type_editor" or $type=="type_captcha" or $type=="type_recaptcha" or $type=="type_button" or $type=="type_paypal_total" or $type=="type_send_copy") + + continue; + + + + $i=$label_id[$key]; + + if(!in_array($i,$disabled_fields)) + { + switch ($type) + + { + + case 'type_text': + + case 'type_password': + + case 'type_textarea': + + case "type_submitter_mail": + + case "type_date": + + case "type_own_select": + + case "type_country": + + case "type_number": + + { + + $value=$input_get->getString('wdform_'.$i."_element".$id); + + break; + + } + + case "type_wdeditor": + + { + + $value=$input_get->getString( 'wdform_'.$i.'_wd_editor'.$id, '', 'post', 'string', JREQUEST_ALLOWRAW ); + + break; + + } + + case "type_mark_map": + + { + + $value=$input_get->getString('wdform_'.$i."_long".$id).'***map***'.$input_get->getString('wdform_'.$i."_lat".$id); + + break; + + } + + + + case "type_date_fields": + + { + + $value=$input_get->getString('wdform_'.$i."_day".$id).'-'.$input_get->getString('wdform_'.$i."_month".$id).'-'.$input_get->getString('wdform_'.$i."_year".$id); + + break; + + } + + + + case "type_time": + + { + + $ss=$input_get->getString('wdform_'.$i."_ss".$id); + + if(isset($ss)) + + $value=$input_get->getString('wdform_'.$i."_hh".$id).':'.$input_get->getString('wdform_'.$i."_mm".$id).':'.$input_get->getString('wdform_'.$i."_ss".$id); + + else + + $value=$input_get->getString('wdform_'.$i."_hh".$id).':'.$input_get->getString('wdform_'.$i."_mm".$id); + + + + $am_pm=$input_get->getString('wdform_'.$i."_am_pm".$id); + + if(isset($am_pm)) + + $value=$value.' '.$input_get->getString('wdform_'.$i."_am_pm".$id); + + + + break; + + } + + + + case "type_phone": + + { + + $value=$input_get->getString('wdform_'.$i."_element_first".$id).' '.$input_get->getString('wdform_'.$i."_element_last".$id); + + + + break; + + } + + + + case "type_name": + + { + + + + $element_title=$input_get->getString('wdform_'.$i."_element_title".$id); + + if(isset($element_title)) + + $value=$input_get->getString('wdform_'.$i."_element_title".$id).'@@@'.$input_get->getString('wdform_'.$i."_element_first".$id).'@@@'.$input_get->getString('wdform_'.$i."_element_last".$id).'@@@'.$input_get->getString('wdform_'.$i."_element_middle".$id); + + else + + $value=$input_get->getString('wdform_'.$i."_element_first".$id).'@@@'.$input_get->getString('wdform_'.$i."_element_last".$id); + + + + break; + + } + + + + case "type_file_upload": + + { + + $files = JRequest::getVar('wdform_'.$i.'_file'.$id, null, 'files', 'array'); + + foreach($files['name'] as $file_key => $file_name) + + if($file_name) + + { + + + + $untilupload = $form->form_fields; + + + + $untilupload = substr($untilupload, strpos($untilupload,$i.'*:*id*:*type_file_upload'), -1); + + $untilupload = substr($untilupload, 0, strpos($untilupload,'*:*new_field*:')); + + $untilupload = explode('*:*w_field_label_pos*:*',$untilupload); + + $untilupload = $untilupload[1]; + + $untilupload = explode('*:*w_destination*:*',$untilupload); + + $destination = $untilupload[0]; + + $untilupload = $untilupload[1]; + + $untilupload = explode('*:*w_extension*:*',$untilupload); + + $extension = $untilupload[0]; + + $untilupload = $untilupload[1]; + + $untilupload = explode('*:*w_max_size*:*',$untilupload); + + $max_size = $untilupload[0]; + + $untilupload = $untilupload[1]; + + + + $fileName = $files['name'][$file_key]; + + + + $fileSize = $files['size'][$file_key]; + + + + if($fileSize > $max_size*1024) + + { + + echo ""; + + return array($max+1); + + } + + + + $uploadedFileNameParts = explode('.',$fileName); + + $uploadedFileExtension = array_pop($uploadedFileNameParts); + + $to=strlen($fileName)-strlen($uploadedFileExtension)-1; + + + + $fileNameFree= substr($fileName,0, $to); + + $invalidFileExts = explode(',', $extension); + + $extOk = false; + + + + foreach($invalidFileExts as $key => $valuee) + + { + + if( is_numeric(strpos(strtolower($valuee), strtolower($uploadedFileExtension) )) ) + + { + + $extOk = true; + + } + + } + + + + if ($extOk == false) + + { + + echo ""; + + return array($max+1); + + } + + + + $fileTemp = $files['tmp_name'][$file_key]; + + $p=1; + + while(file_exists( $destination.DS.$fileName)) + + { + + $to=strlen($files['name'][$file_key])-strlen($uploadedFileExtension)-1; + + $fileName= substr($fileName,0, $to).'('.$p.').'.$uploadedFileExtension; + + $p++; + + } + + + + if(!JFile::upload($fileTemp, $destination.DS.$fileName)) + + { + + echo ""; + + return array($max+1); + + } + + + + $value.= JURI::root(true).'/'.$destination.'/'.$fileName.'*@@url@@*'; + + + + $files['tmp_name'][$file_key]=$destination.DS.$fileName; + + $temp_file=array( "name" => $files['name'][$file_key], "type" => $files['type'][$file_key], "tmp_name" => $files['tmp_name'][$file_key]); + array_push($all_files,$temp_file); + + + + } + + break; + + } + + + + case 'type_address': + + { + + $value='*#*#*#'; + + $element=$input_get->getString('wdform_'.$i."_street1".$id); + + if(isset($element)) + + { + + $value=$input_get->getString('wdform_'.$i."_street1".$id); + + break; + + } + + + + $element=$input_get->getString('wdform_'.$i."_street2".$id); + + if(isset($element)) + + { + + $value=$input_get->getString('wdform_'.$i."_street2".$id); + + break; + + } + + + + $element=$input_get->getString('wdform_'.$i."_city".$id); + + if(isset($element)) + + { + + $value=$input_get->getString('wdform_'.$i."_city".$id); + + break; + + } + + + + $element=$input_get->getString('wdform_'.$i."_state".$id); + + if(isset($element)) + + { + + $value=$input_get->getString('wdform_'.$i."_state".$id); + + break; + + } + + + + $element=$input_get->getString('wdform_'.$i."_postal".$id); + + if(isset($element)) + + { + + $value=$input_get->getString('wdform_'.$i."_postal".$id); + + break; + + } + + + + $element=$input_get->getString('wdform_'.$i."_country".$id); + + if(isset($element)) + + { + + $value=$input_get->getString('wdform_'.$i."_country".$id); + + break; + + } + + + + break; + + } + + + + case "type_hidden": + + { + + $value=$input_get->getString($label_label[$key]); + + break; + + } + + + + case "type_radio": + + { + + $element=$input_get->getString('wdform_'.$i."_other_input".$id); + + if(isset($element)) + + { + + $value=$element; + + break; + + } + + + + $value=$input_get->getString('wdform_'.$i."_element".$id); + + break; + + } + + + + case "type_checkbox": + + { + + $start=-1; + + $value=''; + + for($j=0; $j<100; $j++) + + { + + + + $element=$input_get->getString('wdform_'.$i."_element".$id.$j); + + + + if(isset($element)) + + { + + $start=$j; + + break; + + } + + } + + + + $other_element_id=-1; + + $is_other=$input_get->getString('wdform_'.$i."_allow_other".$id); + + if($is_other=="yes") + + { + + $other_element_id=$input_get->getString('wdform_'.$i."_allow_other_num".$id); + + } + + + + if($start!=-1) + + { + + for($j=$start; $j<100; $j++) + + { + + $element=$input_get->getString('wdform_'.$i."_element".$id.$j); + + if(isset($element)) + + if($j==$other_element_id) + + { + + $value=$value.$input_get->getString('wdform_'.$i."_other_input".$id).'***br***'; + + } + + else + + + + $value=$value.$input_get->getString('wdform_'.$i."_element".$id.$j).'***br***'; + + } + + } + + + + break; + + } + + + + case "type_paypal_price": + + { + + $value=0; + + if($input_get->getString('wdform_'.$i."_element_dollars".$id)) + + $value=$input_get->getString('wdform_'.$i."_element_dollars".$id); + + + + $value = (int) preg_replace('/\D/', '', $value); + + + + if($input_get->getString('wdform_'.$i."_element_cents".$id)) + + $value=$value.'.'.( preg_replace('/\D/', '', $input_get->getString('wdform_'.$i."_element_cents".$id)) ); + + + + $total+=(float)($value); + + + + $paypal_option=array(); + + + + if($value!=0) + + { + + array_push ($paypal['item_name'], $label_label[$key]); + + array_push ($paypal['quantity'], $input_get->getString('wdform_'.$i."_element_quantity".$id,1)); + + array_push ($paypal['amount'], $value); + $is_amount=true; + + array_push ($paypal['on_os'], $paypal_option); + + } + + $value=$value.$form_currency; + + break; + + } + + + + case "type_paypal_select": + + { + + + + if($input_get->getString('wdform_'.$i."_element_label".$id)) + + $value=$input_get->getString('wdform_'.$i."_element_label".$id).' : '.$input_get->getString('wdform_'.$i."_element".$id).$form_currency; + + else + + $value=''; + + $total+=(float)($input_get->getString('wdform_'.$i."_element".$id))*(float)($input_get->getString('wdform_'.$i."_element_quantity".$id,1)); + + array_push ($paypal['item_name'],$label_label[$key].' '.$input_get->getString('wdform_'.$i."_element_label".$id)); + + array_push ($paypal['quantity'], $input_get->getString('wdform_'.$i."_element_quantity".$id,1)); + + array_push ($paypal['amount'], $input_get->getString('wdform_'.$i."_element".$id)); + + if($input_get->getString('wdform_'.$i."_element".$id)) + $is_amount=true; + + + $element_quantity=$input_get->getString('wdform_'.$i."_element_quantity".$id); + + if(isset($element_quantity) && $value!='') + + $value.='***br***'.$input_get->getString('wdform_'.$i."_element_quantity_label".$id).': '.$input_get->getString('wdform_'.$i."_element_quantity".$id).'***quantity***'; + + + + $paypal_option=array(); + + $paypal_option['on']=array(); + + $paypal_option['os']=array(); + + + + for($k=0; $k<50; $k++) + + { + + $temp_val=$input_get->getString('wdform_'.$i."_property".$id.$k); + + if(isset($temp_val) && $value!='') + + { + + array_push ($paypal_option['on'], $input_get->getString('wdform_'.$i."_element_property_label".$id)); + + array_push ($paypal_option['os'], $input_get->getString('wdform_'.$i."_property".$id.$k)); + + $value.='***br***'.$input_get->getString('wdform_'.$i."_element_property_label".$id).': '.$input_get->getString('wdform_'.$i."_property".$id.$k).'***property***'; + + } + + } + + array_push ($paypal['on_os'], $paypal_option); + + break; + + } + + + + case "type_paypal_radio": + + { + + + + if($input_get->getString('wdform_'.$i."_element_label".$id)) + + $value=$input_get->getString('wdform_'.$i."_element_label".$id).' : '.$input_get->getString('wdform_'.$i."_element".$id).$form_currency; + + else + + $value=''; + + + + $total+=(float)($input_get->getString('wdform_'.$i."_element".$id))*(float)($input_get->getString('wdform_'.$i."_element_quantity".$id,1)); + + array_push ($paypal['item_name'], $label_label[$key].' '.$input_get->getString('wdform_'.$i."_element_label".$id)); + + array_push ($paypal['quantity'], $input_get->getString('wdform_'.$i."_element_quantity".$id,1)); + + array_push ($paypal['amount'], $input_get->getString('wdform_'.$i."_element".$id)); + + if($input_get->getString('wdform_'.$i."_element".$id)) + $is_amount=true; + + + + + $element_quantity=$input_get->getString('wdform_'.$i."_element_quantity".$id); + + if(isset($element_quantity) && $value!='') + + $value.='***br***'.$input_get->getString('wdform_'.$i."_element_quantity_label".$id).': '.$input_get->getString('wdform_'.$i."_element_quantity".$id).'***quantity***'; + + + + + + + + $paypal_option=array(); + + $paypal_option['on']=array(); + + $paypal_option['os']=array(); + + + + for($k=0; $k<50; $k++) + + { + + $temp_val=$input_get->getString('wdform_'.$i."_property".$id.$k); + + if(isset($temp_val) && $value!='') + + { + + array_push ($paypal_option['on'], $input_get->getString('wdform_'.$i."_element_property_label".$id)); + + array_push ($paypal_option['os'], $input_get->getString('wdform_'.$i."_property".$id.$k)); + + $value.='***br***'.$input_get->getString('wdform_'.$i."_element_property_label".$id).': '.$input_get->getString('wdform_'.$i."_property".$id.$k).'***property***'; + + } + + } + + array_push ($paypal['on_os'], $paypal_option); + + break; + + } + + + + case "type_paypal_shipping": + + { + + + + if($input_get->getString('wdform_'.$i."_element_label".$id)) + + $value=$input_get->getString('wdform_'.$i."_element_label".$id).' : '.$input_get->getString('wdform_'.$i."_element".$id).$form_currency; + + else + + $value=''; + + $value=$input_get->getString('wdform_'.$i."_element_label".$id).' - '.$input_get->getString('wdform_'.$i."_element".$id).$form_currency; + + + + $paypal['shipping']=$input_get->getString('wdform_'.$i."_element".$id); + + + + break; + + } + + + + case "type_paypal_checkbox": + + { + + $start=-1; + + $value=''; + + for($j=0; $j<100; $j++) + + { + + + + $element=$input_get->getString('wdform_'.$i."_element".$id.$j); + + + + if(isset($element)) + + { + + $start=$j; + + break; + + } + + } + + + + $other_element_id=-1; + + $is_other=$input_get->getString('wdform_'.$i."_allow_other".$id); + + if($is_other=="yes") + + { + + $other_element_id=$input_get->getString('wdform_'.$i."_allow_other_num".$id); + + } + + + + if($start!=-1) + + { + + for($j=$start; $j<100; $j++) + + { + + $element=$input_get->getString('wdform_'.$i."_element".$id.$j); + + if(isset($element)) + + if($j==$other_element_id) + + { + + $value=$value.$input_get->getString('wdform_'.$i."_other_input".$id).'***br***'; + + + + } + + else + + { + + + + $value=$value.$input_get->getString('wdform_'.$i."_element".$id.$j."_label").' - '.($input_get->getString('wdform_'.$i."_element".$id.$j)=='' ? '0' : $input_get->getString('wdform_'.$i."_element".$id.$j)).$form_currency.'***br***'; + + $total+=(float)($input_get->getString('wdform_'.$i."_element".$id.$j))*(float)($input_get->getString('wdform_'.$i."_element_quantity".$id,1)); + + array_push ($paypal['item_name'], $label_label[$key].' '.$input_get->getString('wdform_'.$i."_element".$id.$j."_label")); + + array_push ($paypal['quantity'], $input_get->getString('wdform_'.$i."_element_quantity".$id,1)); + + array_push ($paypal['amount'], $input_get->getString('wdform_'.$i."_element".$id.$j)=='' ? '0' : $input_get->getString('wdform_'.$i."_element".$id.$j)); + if($input_get->getString('wdform_'.$i."_element".$id.$j)) + $is_amount=true; + + $paypal_option=array(); + + $paypal_option['on']=array(); + + $paypal_option['os']=array(); + + + + for($k=0; $k<50; $k++) + + { + + $temp_val=$input_get->getString('wdform_'.$i."_property".$id.$k); + + if(isset($temp_val)) + + { + + array_push ($paypal_option['on'], $input_get->getString('wdform_'.$i."_element_property_label".$id)); + + array_push ($paypal_option['os'], $input_get->getString('wdform_'.$i."_property".$id.$k)); + + } + + } + + array_push ($paypal['on_os'], $paypal_option); + + } + + } + + + + $element_quantity=$input_get->getString('wdform_'.$i."_element_quantity".$id); + + if(isset($element_quantity)) + + $value.=$input_get->getString('wdform_'.$i."_element_quantity_label".$id).': '.$input_get->getString('wdform_'.$i."_element_quantity".$id).'***quantity***'; + + + + for($k=0; $k<50; $k++) + + { + + $temp_val=$input_get->getString('wdform_'.$i."_property".$id.$k); + + if(isset($temp_val)) + + { + + $value.='***br***'.$input_get->getString('wdform_'.$i."_element_property_label".$id).': '.$input_get->getString('wdform_'.$i."_property".$id.$k).'***property***'; + + } + + } + + + + } + + + + + + break; + + } + + + + case "type_star_rating": + + { + + + + if($input_get->getString('wdform_'.$i."_selected_star_amount".$id)=="") + + $selected_star_amount=0; + + else + + $selected_star_amount=$input_get->getString('wdform_'.$i."_selected_star_amount".$id); + + + + $value=$selected_star_amount.'/'.$input_get->getString('wdform_'.$i."_star_amount".$id); + + break; + + } + + + + case "type_scale_rating": + + { + + + + $value=$input_get->getString('wdform_'.$i."_scale_radio".$id,0).'/'.$input_get->getString('wdform_'.$i."_scale_amount".$id); + + break; + + } + + + + case "type_spinner": + + { + + $value=$input_get->getString('wdform_'.$i."_element".$id); + + + + break; + + } + + + + case "type_slider": + + { + + $value=$input_get->getString('wdform_'.$i."_slider_value".$id); + + + + break; + + } + + case "type_range": + + { + + $value = $input_get->getString('wdform_'.$i."_element".$id.'0').'-'.$input_get->getString('wdform_'.$i."_element".$id.'1'); + + + + break; + + } + + case "type_grading": + + { + + $value =""; + + $items = explode(":",$input_get->getString('wdform_'.$i."_hidden_item".$id)); + + for($k=0; $kgetString('wdform_'.$i."_element".$id.'_'.$k).':'; + + $value .= $input_get->getString('wdform_'.$i."_hidden_item".$id).'***grading***'; + + + + break; + + } + + + + case "type_matrix": + + { + + + + $rows_of_matrix=explode("***",$input_get->getString('wdform_'.$i."_hidden_row".$id)); + + $rows_count= sizeof($rows_of_matrix)-1; + + $column_of_matrix=explode("***",$input_get->getString('wdform_'.$i."_hidden_column".$id)); + + $columns_count= sizeof($column_of_matrix)-1; + + + + + + if($input_get->getString('wdform_'.$i."_input_type".$id)=="radio") + + { + + $input_value=""; + + + + for($k=1; $k<=$rows_count; $k++) + + $input_value.=$input_get->getString('wdform_'.$i."_input_element".$id.$k,0)."***"; + + + + } + + if($input_get->getString('wdform_'.$i."_input_type".$id)=="checkbox") + + { + + $input_value=""; + + + + for($k=1; $k<=$rows_count; $k++) + + for($j=1; $j<=$columns_count; $j++) + + $input_value.=$input_get->getString('wdform_'.$i."_input_element".$id.$k.'_'.$j,0)."***"; + + } + + + + if($input_get->getString('wdform_'.$i."_input_type".$id)=="text") + + { + + $input_value=""; + + for($k=1; $k<=$rows_count; $k++) + + for($j=1; $j<=$columns_count; $j++) + + $input_value.=$input_get->getString('wdform_'.$i."_input_element".$id.$k.'_'.$j)."***"; + + } + + + + if($input_get->getString('wdform_'.$i."_input_type".$id)=="select") + + { + + $input_value=""; + + for($k=1; $k<=$rows_count; $k++) + + for($j=1; $j<=$columns_count; $j++) + + $input_value.=$input_get->getString('wdform_'.$i."_select_yes_no".$id.$k.'_'.$j)."***"; + + } + + + + $value=$rows_count.$input_get->getString('wdform_'.$i."_hidden_row".$id).'***'.$columns_count.$input_get->getString('wdform_'.$i."_hidden_column".$id).'***'.$input_get->getString('wdform_'.$i."_input_type".$id).'***'.$input_value.'***matrix***'; + + + + break; + + } + + + + } + + + + if($type=="type_address") + + if( $value=='*#*#*#') + + continue; + + + + if($type=="type_text" or $type=="type_password" or $type=="type_textarea" or $type=="type_name" or $type=="type_submitter_mail" or $type=="type_number" or $type=="type_phone") + + { + + + + $untilupload = $form->form_fields; + + + + $untilupload = substr($untilupload, strpos($untilupload,$i.'*:*id*:*'.$type), -1); + + $untilupload = substr($untilupload, 0, strpos($untilupload,'*:*new_field*:')); + + $untilupload = explode('*:*w_required*:*',$untilupload); + + $untilupload = $untilupload[1]; + + $untilupload = explode('*:*w_unique*:*',$untilupload); + + $unique_element = $untilupload[0]; + + + + if($unique_element=='yes') + + { + + $db->setQuery("SELECT id FROM #__formmaker_submits WHERE form_id='".$db->escape($id)."' and element_label='".$db->escape($i)."' and element_value='".$db->escape($value)."'"); + + $unique = $db->loadResult(); + + if ($db->getErrorNum()){echo $db->stderr(); return false;} + + + + if ($unique) + + { + + echo ""; + + return array($max+1); + + } + + } + + } + + + + $ip=$_SERVER['REMOTE_ADDR']; + + $fvals['{'.$i.'}']=str_replace(array("***map***", "*@@url@@*", "@@@@@@@@@", "@@@", "***grading***", "***br***"), array(" ", "", " ", " ", " ", ", "),$db->escape($value)); + + if($form->savedb) + + { + + $db->setQuery("INSERT INTO #__formmaker_submits (form_id, element_label, element_value, group_id, date, ip) VALUES('".$id."', '".$i."', '".addslashes($value)."','".($max+1)."', now(), '".$ip."')" ); + + $rows = $db->query(); + + if ($db->getErrorNum()){echo $db->stderr(); return false;} + + } + + $chgnac=false; + } + } + + + + } + + else + + { + + foreach($label_type as $key => $type) + + { + + $value=''; + + if($type=="type_submit_reset" or $type=="type_map" or $type=="type_editor" or $type=="type_captcha" or $type=="type_recaptcha" or $type=="type_button" or $type=="type_paypal_total") + + continue; + + + + $i=$label_id[$key]; + + + + if($type!="type_address") + + { + + $deleted=$input_get->getString($i."_type".$id); + + if(!isset($deleted)) + + break; + + } + + + + switch ($type) + + { + + case 'type_text': + + case 'type_password': + + case 'type_textarea': + + case "type_submitter_mail": + + case "type_date": + + case "type_own_select": + + case "type_country": + + case "type_number": + + { + + $value=$input_get->getString($i."_element".$id); + + break; + + } + + + + case "type_mark_map": + + { + + $value=$input_get->getString($i."_long".$id).'***map***'.$input_get->getString($i."_lat".$id); + + break; + + } + + + + case "type_date_fields": + + { + + $value=$input_get->getString($i."_day".$id).'-'.$input_get->getString($i."_month".$id).'-'.$input_get->getString($i."_year".$id); + + break; + + } + + + + case "type_time": + + { + + $ss=$input_get->getString($i."_ss".$id); + + if(isset($ss)) + + $value=$input_get->getString($i."_hh".$id).':'.$input_get->getString($i."_mm".$id).':'.$input_get->getString($i."_ss".$id); + + else + + $value=$input_get->getString($i."_hh".$id).':'.$input_get->getString($i."_mm".$id); + + + + $am_pm=$input_get->getString($i."_am_pm".$id); + + if(isset($am_pm)) + + $value=$value.' '.$input_get->getString($i."_am_pm".$id); + + + + break; + + } + + + + case "type_phone": + + { + + $value=$input_get->getString($i."_element_first".$id).' '.$input_get->getString($i."_element_last".$id); + + + + break; + + } + + + + case "type_name": + + { + + $element_title=$input_get->getString($i."_element_title".$id); + + if(isset($element_title)) + + $value=$input_get->getString($i."_element_title".$id).' '.$input_get->getString($i."_element_first".$id).' '.$input_get->getString($i."_element_last".$id).' '.$input_get->getString($i."_element_middle".$id); + + else + + $value=$input_get->getString($i."_element_first".$id).' '.$input_get->getString($i."_element_last".$id); + + + + break; + + } + + + + case "type_file_upload": + + { + + $file = JRequest::getVar($i.'_file'.$id, null, 'files', 'array'); + + if($file['name']) + + { + + $untilupload = $form->form; + + + + $pos1 = strpos($untilupload, "***destinationskizb".$i."***"); + + $pos2 = strpos($untilupload, "***destinationverj".$i."***"); + + $destination = substr($untilupload, $pos1+(23+(strlen($i)-1)), $pos2-$pos1-(23+(strlen($i)-1))); + + $pos1 = strpos($untilupload, "***extensionskizb".$i."***"); + + $pos2 = strpos($untilupload, "***extensionverj".$i."***"); + + $extension = substr($untilupload, $pos1+(21+(strlen($i)-1)), $pos2-$pos1-(21+(strlen($i)-1))); + + $pos1 = strpos($untilupload, "***max_sizeskizb".$i."***"); + + $pos2 = strpos($untilupload, "***max_sizeverj".$i."***"); + + $max_size = substr($untilupload, $pos1+(20+(strlen($i)-1)), $pos2-$pos1-(20+(strlen($i)-1))); + + + + $fileName = $file['name']; + + /*$destination = JPATH_SITE.DS.$input_get->getString($i.'_destination'); + + $extension = $input_get->getString($i.'_extension'); + + $max_size = $input_get->getString($i.'_max_size');*/ + + + + $fileSize = $file['size']; + + + + if($fileSize > $max_size*1024) + + { + + echo ""; + + return array($max+1);; + + } + + + + $uploadedFileNameParts = explode('.',$fileName); + + $uploadedFileExtension = array_pop($uploadedFileNameParts); + + $to=strlen($fileName)-strlen($uploadedFileExtension)-1; + + + + $fileNameFree= substr($fileName,0, $to); + + $invalidFileExts = explode(',', $extension); + + $extOk = false; + + + + foreach($invalidFileExts as $key => $value) + + { + + if( is_numeric(strpos(strtolower($value), strtolower($uploadedFileExtension) )) ) + + { + + $extOk = true; + + } + + } + + + + if ($extOk == false) + + { + + echo ""; + + return array($max+1);; + + } + + + + $fileTemp = $file['tmp_name']; + + $p=1; + + while(file_exists( $destination.DS.$fileName)) + + { + + $to=strlen($file['name'])-strlen($uploadedFileExtension)-1; + + $fileName= substr($fileName,0, $to).'('.$p.').'.$uploadedFileExtension; + + $p++; + + } + + + + if(!JFile::upload($fileTemp, $destination.DS.$fileName)) + + { + + echo ""; + + return array($max+1);; + + } + + + + $value= JURI::root(true).'/'.$destination.'/'.$fileName.'*@@url@@*'; + + + + $file['tmp_name']=$destination.DS.$fileName; + + array_push($all_files,$file); + + + + } + + break; + + } + + + + case 'type_address': + + { + + $value='*#*#*#'; + + $element=$input_get->getString($i."_street1".$id); + + if(isset($element)) + + { + + $value=$input_get->getString($i."_street1".$id); + + break; + + } + + + + $element=$input_get->getString($i."_street2".$id); + + if(isset($element)) + + { + + $value=$input_get->getString($i."_street2".$id); + + break; + + } + + + + $element=$input_get->getString($i."_city".$id); + + if(isset($element)) + + { + + $value=$input_get->getString($i."_city".$id); + + break; + + } + + + + $element=$input_get->getString($i."_state".$id); + + if(isset($element)) + + { + + $value=$input_get->getString($i."_state".$id); + + break; + + } + + + + $element=$input_get->getString($i."_postal".$id); + + if(isset($element)) + + { + + $value=$input_get->getString($i."_postal".$id); + + break; + + } + + + + $element=$input_get->getString($i."_country".$id); + + if(isset($element)) + + { + + $value=$input_get->getString($i."_country".$id); + + break; + + } + + + + break; + + } + + + + case "type_hidden": + + { + + $value=$input_get->getString($label_label[$key]); + + break; + + } + + + + case "type_radio": + + { + + $element=$input_get->getString($i."_other_input".$id); + + if(isset($element)) + + { + + $value=$element; + + break; + + } + + + + $value=$input_get->getString($i."_element".$id); + + break; + + } + + + + case "type_checkbox": + + { + + $start=-1; + + $value=''; + + for($j=0; $j<100; $j++) + + { + + + + $element=$input_get->getString($i."_element".$id.$j); + + + + if(isset($element)) + + { + + $start=$j; + + break; + + } + + } + + + + $other_element_id=-1; + + $is_other=$input_get->getString($i."_allow_other".$id); + + if($is_other=="yes") + + { + + $other_element_id=$input_get->getString($i."_allow_other_num".$id); + + } + + + + if($start!=-1) + + { + + for($j=$start; $j<100; $j++) + + { + + $element=$input_get->getString($i."_element".$id.$j); + + if(isset($element)) + + if($j==$other_element_id) + + { + + $value=$value.$input_get->getString($i."_other_input".$id).'***br***'; + + } + + else + + + + $value=$value.$input_get->getString($i."_element".$id.$j).'***br***'; + + } + + } + + + + break; + + } + + + + case "type_paypal_price": + + + + { + + + + $value=0; + + + + if($input_get->getString($i."_element_dollars".$id)) + + + + $value=$input_get->getString($i."_element_dollars".$id); + + + + + + $value = (int) preg_replace('/\D/', '', $value); + + + + + + + + if($input_get->getString($i."_element_cents".$id)) + + + + $value=$value.'.'.( preg_replace('/\D/', '', $input_get->getString($i."_element_cents".$id))); + + + + + + + + $total+=(float)($value); + + + + + + + + $paypal_option=array(); + + + + + + + + if($value!=0) + + + + { + + + + array_push ($paypal['item_name'], $label_label[$key]); + + + + array_push ($paypal['quantity'], $input_get->getString($i."_element_quantity".$id,1)); + + + + array_push ($paypal['amount'], $value); + + $is_amount=true; + + + array_push ($paypal['on_os'], $paypal_option); + + + + } + + + + $value=$value.$form_currency; + + + + break; + + + + } + + + + case "type_paypal_select": + + + + { + + + + if($input_get->getString($i."_element_label".$id)) + + $value=$input_get->getString($i."_element_label".$id).' : '.$input_get->getString($i."_element".$id).$form_currency; + + else + + $value=''; + + + + $total+=(float)($input_get->getString($i."_element".$id))*(float)($input_get->getString($i."_element_quantity".$id,1)); + + + + array_push ($paypal['item_name'],$label_label[$key].' '.$input_get->getString($i."_element_label".$id)); + + + + array_push ($paypal['quantity'], $input_get->getString($i."_element_quantity".$id,1)); + + + + array_push ($paypal['amount'], $input_get->getString($i."_element".$id)); + + + if($input_get->getString($i."_element".$id)) + $is_amount=true; + + + + + + $element_quantity_label=$input_get->getString($i."_element_quantity_label".$id); + + + + if(isset($element_quantity_label)) + + + + $value.='***br***'.$input_get->getString($i."_element_quantity_label".$id).': '.$input_get->getString($i."_element_quantity".$id); + + + + + + + + $paypal_option=array(); + + + + $paypal_option['on']=array(); + + + + $paypal_option['os']=array(); + + + + + + + + for($k=0; $k<50; $k++) + + + + { + + $temp_val=$input_get->getString($i."_element_property_value".$id.$k); + + + + if(isset($temp_val)) + + + + { + + + + array_push ($paypal_option['on'], $input_get->getString($i."_element_property_label".$id.$k)); + + + + array_push ($paypal_option['os'], $input_get->getString($i."_element_property_value".$id.$k)); + + + + $value.='***br***'. $input_get->getString($i."_element_property_label".$id.$k).': '.$input_get->getString($i."_element_property_value".$id.$k); + + + + } + + + + } + + + + array_push ($paypal['on_os'], $paypal_option); + + + + break; + + + + } + + + + case "type_paypal_radio": + + + + { + + + + + + + + if($input_get->getString($i."_element_label".$id)) + + $value=$input_get->getString($i."_element_label".$id).' : '.$input_get->getString($i."_element".$id).$form_currency; + + else + + $value=''; + + + + $total+=(float)($input_get->getString($i."_element".$id))*(float)($input_get->getString($i."_element_quantity".$id,1)); + + + + array_push ($paypal['item_name'], $label_label[$key].' '.$input_get->getString($i."_element_label".$id)); + + + + array_push ($paypal['quantity'], $input_get->getString($i."_element_quantity".$id,1)); + + + + array_push ($paypal['amount'], $input_get->getString($i."_element".$id)); + + + + + if($input_get->getString($i."_element".$id)) + $is_amount=true; + + + + + + + + + $element_quantity_label=$input_get->getString($i."_element_quantity_label".$id); + + + + if(isset($element_quantity_label)) + + + + $value.='***br***'.$input_get->getString($i."_element_quantity_label".$id).': '.$input_get->getString($i."_element_quantity".$id); + + + + + + + + + + + + + + + + + + + + + + + + $paypal_option=array(); + + + + $paypal_option['on']=array(); + + + + $paypal_option['os']=array(); + + + + + + + + for($k=0; $k<50; $k++) + + + + { + + + + $temp_val=$input_get->getString($i."_element_property_value".$id.$k); + + + + if(isset($temp_val)) + + + + { + + + + array_push ($paypal_option['on'], $input_get->getString($i."_element_property_label".$id.$k)); + + + + array_push ($paypal_option['os'], $input_get->getString($i."_element_property_value".$id.$k)); + + + + $value.='***br***'.$input_get->getString($i."_element_property_label".$id.$k).': '.$input_get->getString($i."_element_property_value".$id.$k); + + + + } + + + + } + + + + array_push ($paypal['on_os'], $paypal_option); + + + + break; + + + + } + + + + case "type_paypal_shipping": + + + + { + + + + + + + + if($input_get->getString($i."_element_label".$id)) + + $value=$input_get->getString($i."_element_label".$id).' : '.$input_get->getString($i."_element".$id).$form_currency; + + else + + $value=''; + + + + + + + + $paypal['shipping']=$input_get->getString($i."_element".$id); + + + + + + + + break; + + + + } + + + + + + + + case "type_paypal_checkbox": + + + + { + + + + $start=-1; + + + + $value=''; + + + + for($j=0; $j<100; $j++) + + + + { + + + + + + + + $element=$input_get->getString($i."_element".$id.$j); + + + + + + + + if(isset($element)) + + + + { + + + + $start=$j; + + + + break; + + + + } + + + + } + + + + + + + + $other_element_id=-1; + + + + $is_other=$input_get->getString($i."_allow_other".$id); + + + + if($is_other=="yes") + + + + { + + + + $other_element_id=$input_get->getString($i."_allow_other_num".$id); + + + + } + + + + + + + + if($start!=-1) + + + + { + + + + for($j=$start; $j<100; $j++) + + + + { + + + + $element=$input_get->getString($i."_element".$id.$j); + + + + if(isset($element)) + + + + if($j==$other_element_id) + + + + { + + + + $value=$value.$input_get->getString($i."_other_input".$id).'***br***'; + + + + + + + + } + + + + else + + + + { + + + + + + + + $value=$value.$input_get->getString($i."_element".$id.$j."_label").' - '.($input_get->getString($i."_element".$id.$j)=='' ? '0' : $input_get->getString($i."_element".$id.$j)).$form_currency.'***br***'; + + + + $total+=(float)($input_get->getString($i."_element".$id.$j))*(float)($input_get->getString($i."_element_quantity".$id,1)); + + + + array_push ($paypal['item_name'], $label_label[$key].' '.$input_get->getString($i."_element".$id.$j."_label")); + + + + array_push ($paypal['quantity'], $input_get->getString($i."_element_quantity".$id,1)); + + + + array_push ($paypal['amount'], $input_get->getString($i."_element".$id.$j)=='' ? '0' : $input_get->getString($i."_element".$id.$j)); + + if($input_get->getString($i."_element".$id.$j)) + $is_amount=true; + + + $paypal_option=array(); + + + + $paypal_option['on']=array(); + + + + $paypal_option['os']=array(); + + + + + + + + for($k=0; $k<50; $k++) + + + + { + + + + $temp_val=$input_get->getString($i."_element_property_value".$id.$k); + + + + if(isset($temp_val)) + + + + { + + + + array_push ($paypal_option['on'], $input_get->getString($i."_element_property_label".$id.$k)); + + + + array_push ($paypal_option['os'], $input_get->getString($i."_element_property_value".$id.$k)); + + + + } + + + + } + + + + array_push ($paypal['on_os'], $paypal_option); + + + + } + + + + } + + + + + + + + $element_quantity_label=$input_get->getString($i."_element_quantity_label".$id); + + + + if(isset($element_quantity_label)) + + + + $value.=$input_get->getString($i."_element_quantity_label".$id).': '.$input_get->getString($i."_element_quantity".$id).'***br***'; + + + + + + + + for($k=0; $k<50; $k++) + + + + { + + + + $temp_val=$input_get->getString($i."_element_property_value".$id.$k); + + + + if(isset($temp_val)) + + + + { + + + + $value.=$input_get->getString($i."_element_property_label".$id.$k).': '.$input_get->getString($i."_element_property_value".$id.$k).'***br***'; + + + + } + + + + } + + + + + + + + } + + + + + + + + + + + + break; + + + + } + + + + case "type_star_rating": + + { + + + + if($input_get->getString($i."_selected_star_amount".$id)=="") + + $selected_star_amount=0; + + else + + $selected_star_amount=$input_get->getString($i."_selected_star_amount".$id); + + + + $value=$input_get->getString($i."_star_amount".$id).'***'.$selected_star_amount.'***'.$input_get->getString($i."_star_color".$id).'***star_rating***'; + + break; + + } + + + + + + case "type_scale_rating": + + { + + + + $value=$input_get->getString($i."_scale_radio".$id,0).'/'.$input_get->getString($i."_scale_amount".$id); + + break; + + } + + + + case "type_spinner": + + { + + $value=$input_get->getString($i."_element".$id); + + + + break; + + } + + + + case "type_slider": + + { + + $value=$input_get->getString($i."_slider_value".$id); + + + + break; + + } + + case "type_range": + + { + + $value = $input_get->getString($i."_element".$id.'0').'-'.$input_get->getString($i."_element".$id.'1'); + + + + break; + + } + + case "type_grading": + + { + + $value =""; + + $items = explode(":",$input_get->getString($i."_hidden_item".$id)); + + for($k=0; $kgetString($i."_element".$id.$k).':'; + + $value .= $input_get->getString($i."_hidden_item".$id).'***grading***'; + + + + break; + + } + + + + + + case "type_matrix": + + { + + $rows_of_matrix=explode("***",$input_get->getString($i."_hidden_row".$id)); + + $rows_count= sizeof($rows_of_matrix)-1; + + $column_of_matrix=explode("***",$input_get->getString($i."_hidden_column".$id)); + + $columns_count= sizeof($column_of_matrix)-1; + + $row_ids=explode(",",substr($input_get->getString($i."_row_ids".$id), 0, -1)); + + $column_ids=explode(",",substr($input_get->getString($i."_column_ids".$id), 0, -1)); + + + + + + if($input_get->getString($i."_input_type".$id)=="radio") + + { + + $input_value=""; + + foreach($row_ids as $row_id) + + $input_value.=$input_get->getString($i."_input_element".$id.$row_id,0)."***"; + + + + } + + if($input_get->getString($i."_input_type".$id)=="checkbox") + + { + + + + $input_value=""; + + foreach($row_ids as $row_id) + + foreach($column_ids as $column_id) + + $input_value.=$input_get->getString($i."_input_element".$id.$row_id.'_'.$column_id,0)."***"; + + + + + + } + + + + if($input_get->getString($i."_input_type".$id)=="text") + + { + + $input_value=""; + + foreach($row_ids as $row_id) + + foreach($column_ids as $column_id) + + $input_value.=$input_get->getString($i."_input_element".$id.$row_id.'_'.$column_id)."***"; + + } + + + + if($input_get->getString($i."_input_type".$id)=="select") + + { + + $input_value=""; + + foreach($row_ids as $row_id) + + foreach($column_ids as $column_id) + + $input_value.=$input_get->getString($i."_select_yes_no".$id.$row_id.'_'.$column_id)."***"; + + } + + + + + + $value=$rows_count.'***'.$input_get->getString($i."_hidden_row".$id).$columns_count.'***'.$input_get->getString($i."_hidden_column".$id).$input_get->getString($i."_input_type".$id).'***'.$input_value.'***matrix***'; + + + + break; + + } + + } + + + + if($type=="type_address") + + if( $value=='*#*#*#') + + continue; + + + + $unique_element=$input_get->getString($i."_unique".$id); + + if($unique_element=='yes') + + { + + $db->setQuery("SELECT id FROM #__formmaker_submits WHERE form_id='".$db->escape($id)."' and element_label='".$db->escape($i)."' and element_value='".$db->escape(addslashes($value))."'"); + + $unique = $db->loadResult(); + + if ($db->getErrorNum()){echo $db->stderr(); return false;} + + + + if ($unique) + + { + + echo ""; + + return array($max+1);; + + } + + } + + + + $ip=$_SERVER['REMOTE_ADDR']; + + + + $db->setQuery("INSERT INTO #__formmaker_submits (form_id, element_label, element_value, group_id, date, ip) VALUES('".$id."', '".$i."', '".addslashes($value)."','".($max+1)."', now(), '".$ip."')" ); + + $rows = $db->query(); + + if ($db->getErrorNum()){echo $db->stderr(); return false;} + + $chgnac=false; + + } + + + + } + + $db->setQuery("SELECT * FROM #__formmaker_query WHERE form_id=".$id ); + $queries = $db->loadObjectList(); + if($queries) + { + foreach($queries as $query) + { + $db = JFactory::getDBO(); + + $temp = explode('***wdfcon_typewdf***',$query->details); + $con_type = $temp[0]; + $temp = explode('***wdfcon_methodwdf***',$temp[1]); + $con_method = $temp[0]; + $temp = explode('***wdftablewdf***',$temp[1]); + $table_cur = $temp[0]; + $temp = explode('***wdfhostwdf***',$temp[1]); + $host = $temp[0]; + $temp = explode('***wdfportwdf***',$temp[1]); + $port = $temp[0]; + $temp = explode('***wdfusernamewdf***',$temp[1]); + $username = $temp[0]; + $temp = explode('***wdfpasswordwdf***',$temp[1]); + $password = $temp[0]; + $temp = explode('***wdfdatabasewdf***',$temp[1]); + $database = $temp[0]; + + if($con_type == 'remote') + { + $remote = array(); //prevent problems + + $remote['driver'] = 'mysql'; + $remote['host'] = $host; + $remote['user'] = $username; + $remote['password'] = $password; + $remote['database'] = $database; + $remote['prefix'] = ''; + + $db = JDatabase::getInstance( $remote ); + + } + + $query=str_replace(array_keys($fvals), $fvals ,$query->query); + + $db->setQuery($query); + $db->query(); + + + } + } + + $db = JFactory::getDBO(); + $str=''; + + + + + + + + + + + + + + + + if($form->paypal_mode) + + + + + + + + if($paypal['item_name']) + + + + + + + + if($is_amount) + + + + + + + + { + + + + + + + + + + + + + + + + $tax=$form->tax; + + + + + + + + $currency=$form->payment_currency; + + + + + + + + $business=$form->paypal_email; + + + + + + + + + + + + + + + + + + + + + + + + $ip=$_SERVER['REMOTE_ADDR']; + + + + + + + + + + + + + + + + $total2=round($total, 2); + + + + + + + + + + + + + + + + $db->setQuery("INSERT INTO #__formmaker_submits (form_id, element_label, element_value, group_id, date, ip) VALUES('".$id."', 'item_total', '".$total2.$form_currency."','".($max+1)."', now(), '".$ip."')" ); + + + + + + + + + + + + + + + + $rows = $db->query(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $total=$total+($total*$tax)/100; + + + + + + + + + + + + + + + + if(isset($paypal['shipping'])) + + + + + + + + { + + + + + + + + $total=$total+$paypal['shipping']; + + + + + + + + } + + + + + + + + + + + + + + + + $total=round($total, 2); + + + + + + + + + + + + + + + + if ($db->getErrorNum()){echo $db->stderr(); return false;} + + + + + + + + + + + + + + + + $db->setQuery("INSERT INTO #__formmaker_submits (form_id, element_label, element_value, group_id, date, ip) VALUES('".$id."', 'total', '".$total.$form_currency."','".($max+1)."', now(), '".$ip."')" ); + + + + + + + + + + + + + + + + $rows = $db->query(); + + + + + + + + + + + + + + + + if ($db->getErrorNum()){echo $db->stderr(); return false;} + + + + + + + + + + + + + + + + + + + + + + + + $db->setQuery("INSERT INTO #__formmaker_submits (form_id, element_label, element_value, group_id, date, ip) VALUES('".$id."', '0', 'In progress','".($max+1)."', now(), '".$ip."')" ); + + + + + + + + + + + + + + + + $rows = $db->query(); + + + + + + + + + + + + + + + + if ($db->getErrorNum()){echo $db->stderr(); return false;} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $str=''; + + + + + + + + + + + + + + + + if($form->checkout_mode=="production") + + + + + + + + $str.="https://www.paypal.com/cgi-bin/webscr?"; + + + + + + + + else + + + + + + + + $str.="https://www.sandbox.paypal.com/cgi-bin/webscr?"; + + + + + + + + + + + + + + + + $str.="charset=utf-8"; + + $str.="¤cy_code=".$currency; + + + + + + + + + + $str.="&business=".$business; + + + + + + + + $str.="&cmd="."_cart"; + + + + $str.="&charset=utf8"; + + + + + + $str.="¬ify_url=".JUri::root().'index.php?option=com_formmaker%26view=checkpaypal%26form_id='.$id.'%26group_id='.($max+1); + + + + + + + + $str.="&upload="."1"; + + + + + + + + + + + + + + + + if(isset($paypal['shipping'])) + + + + + + + + { + + + + + + + + $str=$str."&shipping_1=".$paypal['shipping']; + + + + + + + + // $str=$str."&weight_cart=".$paypal['shipping']; + + + + + + + + // $str=$str."&shipping2=3".$paypal['shipping']; + + + + + + + + $str=$str."&no_shipping=2"; + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + $i=0; + foreach($paypal['item_name'] as $pkey => $pitem_name) + if($paypal['amount'][$pkey]) + { + $i++; + $str=$str."&item_name_".$i."=".$pitem_name; + $str=$str."&amount_".$i."=".$paypal['amount'][$pkey]; + $str=$str."&quantity_".$i."=".$paypal['quantity'][$pkey]; + + if($tax) + $str=$str."&tax_rate_".$i."=".$tax; + + if($paypal['on_os'][$pkey]) + { + foreach($paypal['on_os'][$pkey]['on'] as $on_os_key => $on_item_name) + { + + $str=$str."&on".$on_os_key."_".$i."=".$on_item_name; + $str=$str."&os".$on_os_key."_".$i."=".$paypal['on_os'][$pkey]['os'][$on_os_key]; + } + } + + } + + + + } + + + + if($chgnac) + + { $mainframe = JFactory::getApplication(); + + + + if(count($all_files)==0) + + $mainframe->redirect($_SERVER["REQUEST_URI"], addslashes(JText::_('WDF_EMPTY_SUBMIT'))); + + } + + + + return array($all_files, $str); + + } + + + + protected function gen_mail($counter, $all_files, $str, $id) + + { + + + + $input_get = JFactory::getApplication()->input; + + @session_start(); + + $mainframe = JFactory::getApplication(); + + $Itemid=$input_get->getString('Itemid'.$id); + + JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_formmaker'.DS.'tables'); + + $row = JTable::getInstance('formmaker', 'Table'); + + $row->load( $id); + + $ip=$_SERVER['REMOTE_ADDR']; + + $total=0; + + + + $form_currency='$'; + + + + $currency_code=array('USD', 'EUR', 'GBP', 'JPY', 'CAD', 'MXN', 'HKD', 'HUF', 'NOK', 'NZD', 'SGD', 'SEK', 'PLN', 'AUD', 'DKK', 'CHF', 'CZK', 'ILS', 'BRL', 'TWD', 'MYR', 'PHP', 'THB'); + + $currency_sign=array('$' , '€' , '£' , 'Â¥' , 'C$', 'Mex$', 'HK$', 'Ft' , 'kr' , 'NZ$', 'S$' , 'kr' , 'zÅ‚' , 'A$' , 'kr' , 'CHF' , 'KÄ', '₪' , 'R$' , 'NT$', 'RM' , '₱' , '฿' ); + + + + + + if($row->payment_currency) + + + + $form_currency= $currency_sign[array_search($row->payment_currency, $currency_code)]; + + + + $old = false; + + + + if(isset($row->form) ) + + $old = true; + + + + $cc=array(); + + $label_order_original= array(); + + $label_order_ids= array(); + + + + if($old == false || ($old == true && $row->form=='')) + + $label_all = explode('#****#',$row->label_order_current); + + else + + $label_all = explode('#****#',$row->label_order); + + $label_all = array_slice($label_all,0, count($label_all)-1); + + foreach($label_all as $key => $label_each) + + { + + $label_id_each=explode('#**id**#',$label_each); + + $label_id=$label_id_each[0]; + + array_push($label_order_ids,$label_id); + + + + $label_oder_each=explode('#**label**#', $label_id_each[1]); + + $label_order_original[$label_id]=$label_oder_each[0]; + + $label_type[$label_id]=$label_oder_each[1]; + + } + + $disabled_fields = explode(',',$input_get->getString("disabled_fields".$id)); + $disabled_fields = array_slice($disabled_fields,0, count($disabled_fields)-1); + + $list=''; + $list_text_mode = ''; + if($old == false || ($old == true && $row->form=='')) + + { + + + + foreach($label_order_ids as $key => $label_order_id) + + { + + $i=$label_order_id; + + $type=$label_type[$i]; + + + + if($type!="type_map" and $type!="type_submit_reset" and $type!="type_editor" and $type!="type_captcha" and $type!="type_recaptcha" and $type!="type_button") + + { + + $element_label=$label_order_original[$i]; + + + if(!in_array($i,$disabled_fields)) + switch ($type) + { + case 'type_text': + case 'type_password': + case 'type_textarea': + case "type_date": + case "type_own_select": + case "type_country": + case "type_number": + { + $element=$input_get->getString('wdform_'.$i."_element".$id); + if(isset($element)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n"; + } + break; + + + } + case "type_wdeditor": + { + + $element = $input_get->getString('wdform_'.$i.'_wd_editor'.$id, '', 'post', 'string', JREQUEST_ALLOWRAW ); + + $list=$list.''; + + $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n"; + + break; + + } + case "type_hidden": + { + $element=$input_get->getString($element_label); + if(isset($element)) + { + $list=$list.''; + + $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n"; + } + break; + } + + + case "type_mark_map": + { + $element=$input_get->getString('wdform_'.$i."_long".$id); + if(isset($element)) + { + $list=$list.''; + + $list_text_mode=$list_text_mode.$element_label.' - Longitude:'.$input_get->getString('wdform_'.$i."_long".$id).' Latitude:'.$input_get->getString('wdform_'.$i."_lat".$id)."\r\n"; + } + break; + } + + case "type_submitter_mail": + { + $element=$input_get->getString('wdform_'.$i."_element".$id); + if(isset($element)) + { + $list=$list.''; + + $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n"; + } + break; + } + + case "type_time": + { + + $hh=$input_get->getString('wdform_'.$i."_hh".$id); + if(isset($hh)) + { + $ss=$input_get->getString('wdform_'.$i."_ss".$id); + if(isset($ss)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$input_get->getString('wdform_'.$i."_am_pm".$id)."\r\n"; + } + else + { + $list=$list.''; + $list_text_mode=$list_text_mode."\r\n"; + } + } + + break; + } + + case "type_phone": + { + $element_first=$input_get->getString('wdform_'.$i."_element_first".$id); + if(isset($element_first)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$element_label.' - '.$input_get->getString('wdform_'.$i."_element_first".$id).' '.$input_get->getString('wdform_'.$i."_element_last".$id)."\r\n"; + } + break; + } + + case "type_name": + { + $element_first=$input_get->getString('wdform_'.$i."_element_first".$id); + if(isset($element_first)) + { + $element_title=$input_get->getString('wdform_'.$i."_element_title".$id); + if(isset($element_title)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$element_label.' - '.$input_get->getString('wdform_'.$i."_element_title".$id).' '.$input_get->getString('wdform_'.$i."_element_first".$id).' '.$input_get->getString('wdform_'.$i."_element_last".$id).' '.$input_get->getString('wdform_'.$i."_element_middle".$id)."\r\n"; + } + else + { + $list=$list.''; + $list_text_mode=$list_text_mode.$element_label.' - '.$input_get->getString('wdform_'.$i."_element_first".$id).' '.$input_get->getString('wdform_'.$i."_element_last".$id)."\r\n"; + } + } + break; + } + + case "type_address": + { + $element=$input_get->getString('wdform_'.$i."_street1".$id); + if(isset($element)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$input_get->getString('wdform_'.$i."_street1".$id)."\r\n"; + break; + } + + $element=$input_get->getString('wdform_'.$i."_street2".$id); + if(isset($element)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$input_get->getString('wdform_'.$i."_street2".$id)."\r\n"; + break; + } + + $element=$input_get->getString('wdform_'.$i."_city".$id); + if(isset($element)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$input_get->getString('wdform_'.$i."_city".$id)."\r\n"; + break; + } + + $element=$input_get->getString('wdform_'.$i."_state".$id); + if(isset($element)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$input_get->getString('wdform_'.$i."_state".$id)."\r\n"; + break; + } + + $element=$input_get->getString('wdform_'.$i."_postal".$id); + if(isset($element)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$input_get->getString('wdform_'.$i."_postal".$id)."\r\n"; + break; + } + + $element=$input_get->getString('wdform_'.$i."_country".$id); + if(isset($element)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$input_get->getString('wdform_'.$i."_country".$id)."\r\n"; + break; + } + + break; + + } + + + case "type_date_fields": + { + $day=$input_get->getString('wdform_'.$i."_day".$id); + if(isset($day)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$element_label.' - '.$input_get->getString('wdform_'.$i."_day".$id).'-'.$input_get->getString('wdform_'.$i."_month".$id).'-'.$input_get->getString('wdform_'.$i."_year".$id)."\r\n"; + } + break; + } + + case "type_radio": + { + $element=$input_get->getString('wdform_'.$i."_other_input".$id); + if(isset($element)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$element_label.' - '.$input_get->getString('wdform_'.$i."_other_input".$id)."\r\n"; + break; + } + + $element=$input_get->getString('wdform_'.$i."_element".$id); + if(isset($element)) + { + $list=$list.''; $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n"; + } + break; + } + + case "type_checkbox": + { + $list=$list.''; + $list_text_mode=$list_text_mode."\r\n"; + } + + + break; + } + case "type_paypal_price": + { + $value=0; + if($input_get->getString('wdform_'.$i."_element_dollars".$id)) + $value=$input_get->getString('wdform_'.$i."_element_dollars".$id); + + if($input_get->getString('wdform_'.$i."_element_cents".$id)) + $value=$value.'.'.$input_get->getString('wdform_'.$i."_element_cents".$id); + + $list=$list.''; + $list_text_mode=$list_text_mode.$element_label.' - '.$value.$form_currency."\r\n"; + break; + + } + + case "type_paypal_select": + { + if($input_get->getString('wdform_'.$i."_element_label".$id)) + $value=$input_get->getString('wdform_'.$i."_element_label".$id).' : '.$input_get->getString('wdform_'.$i."_element".$id).$form_currency; + else + $value=''; + $element_quantity_label=$input_get->getString('wdform_'.$i."_element_quantity_label".$id); + if(isset($element_quantity_label)) + $value.='
'.$input_get->getString('wdform_'.$i."_element_quantity_label".$id).': '.$input_get->getString('wdform_'.$i."_element_quantity".$id); + + for($k=0; $k<50; $k++) + { + $temp_val=$input_get->getString('wdform_'.$i."_element_property_value".$id.$k); + if(isset($temp_val)) + { + $value.='
'.$input_get->getString('wdform_'.$i."_element_property_label".$id.$k).': '.$input_get->getString('wdform_'.$i."_element_property_value".$id.$k); + } + } + + $list=$list.'';$list_text_mode=$list_text_mode.$element_label.' - '.str_replace('
',', ',$value)."\r\n"; + break; + } + + case "type_paypal_radio": + { + + if($input_get->getString('wdform_'.$i."_element_label".$id)) + $value=$input_get->getString('wdform_'.$i."_element_label".$id).' : '.$input_get->getString('wdform_'.$i."_element".$id).$form_currency; + else + $value=''; + $element_quantity_label=$input_get->getString('wdform_'.$i."_element_quantity_label".$id); + if(isset($element_quantity_label)) + $value.='
'.$input_get->getString('wdform_'.$i."_element_quantity_label".$id).': '.$input_get->getString('wdform_'.$i."_element_quantity".$id); + + for($k=0; $k<50; $k++) + { + $temp_val=$input_get->getString('wdform_'.$i."_element_property_value".$id.$k); + if(isset($temp_val)) + { + $value.='
'.$input_get->getString('wdform_'.$i."_element_property_label".$id.$k).': '.$input_get->getString('wdform_'.$i."_element_property_value".$id.$k); + } + } + + $list=$list.''; $list_text_mode=$list_text_mode.$element_label.' - '.str_replace('
',', ',$value)."\r\n"; + + break; + } + + case "type_paypal_shipping": + { + + if($input_get->getString('wdform_'.$i."_element_label".$id)) + $value=$input_get->getString('wdform_'.$i."_element_label".$id).' : '.$input_get->getString('wdform_'.$i."_element".$id).$form_currency; + else + $value=''; + + $list=$list.''; $list_text_mode=$list_text_mode.$element_label.' - '.$value."\r\n"; + + break; + } + + case "type_paypal_checkbox": + { + + $list=$list.''; + $list_text_mode=$list_text_mode."\r\n"; + break; + } + + case "type_paypal_total": + { + + + $element=$input_get->getString('wdform_'.$i."_paypal_total".$id); + + + $list=$list.''; + $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n"; + + + break; + + } + + + case "type_star_rating": + { + $element=$input_get->getString('wdform_'.$i."_star_amount".$id); + $selected=$input_get->getString('wdform_'.$i."_selected_star_amount".$id,0); + + + if(isset($element)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$element_label.' - '.$selected.'/'.$element."\r\n"; + } + break; + } + + + case "type_scale_rating": + { + $element=$input_get->getString('wdform_'.$i."_scale_amount".$id); + $selected=$input_get->getString('wdform_'.$i."_scale_radio".$id,0); + + + if(isset($element)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$element_label.' - '.$selected.'/'.$element."\r\n"; + } + break; + } + + case "type_spinner": + { + + $element=$input_get->getString('wdform_'.$i."_element".$id); + if(isset($element)) + { + $list=$list.'';$list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n"; + } + break; + } + + case "type_slider": + { + + $element=$input_get->getString('wdform_'.$i."_slider_value".$id); + if(isset($element)) + { + $list=$list.'';$list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n"; + } + break; + } + case "type_range": + { + + $element0=$input_get->getString('wdform_'.$i."_element".$id.'0'); + $element1=$input_get->getString('wdform_'.$i."_element".$id.'1'); + if(isset($element0) || isset($element1)) + { + $list=$list.''; + $list_text_mode=$list_text_mode.$element_label.' - From:'.$element0.' To:'.$element1."\r\n"; + } + break; + } + + case "type_grading": + { + $element=$input_get->getString('wdform_'.$i."_hidden_item".$id); + $grading = explode(":",$element); + $items_count = sizeof($grading)-1; + + $element = ""; + $total = ""; + + for($k=0;$k<$items_count;$k++) + + { + $element .= $grading[$k].":".$input_get->getString('wdform_'.$i."_element".$id.'_'.$k)." "; + $total += $input_get->getString('wdform_'.$i."_element".$id.'_'.$k); + } + + $element .="Total:".$total; + + + if(isset($element)) + { + $list=$list.''; $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n"; + } + break; + } + + case "type_matrix": + { + + + $input_type=$input_get->getString('wdform_'.$i."_input_type".$id); + + $mat_rows=explode("***",$input_get->getString('wdform_'.$i."_hidden_row".$id)); + $rows_count= sizeof($mat_rows)-1; + $mat_columns=explode("***",$input_get->getString('wdform_'.$i."_hidden_column".$id)); + $columns_count= sizeof($mat_columns)-1; + + + + $matrix="
'.$element_label.'
'.$element.'
'.$element_label.'
'.$element.'
'.$element_label.'
'.$element.'
'.$element_label.'Longitude:'.$input_get->getString('wdform_'.$i."_long".$id).'
Latitude:'.$input_get->getString('wdform_'.$i."_lat".$id).'
'.$element_label.'
'.$element.'
'.$element_label.''.$input_get->getString('wdform_'.$i."_hh".$id).':'.$input_get->getString('wdform_'.$i."_mm".$id).':'.$input_get->getString('wdform_'.$i."_ss".$id); + $list_text_mode=$list_text_mode.$element_label.' - '.$input_get->getString('wdform_'.$i."_hh".$id).':'.$input_get->getString('wdform_'.$i."_mm".$id).':'.$input_get->getString('wdform_'.$i."_ss".$id); + } + else + { + $list=$list.'
'.$element_label.''.$input_get->getString('wdform_'.$i."_hh".$id).':'.$input_get->getString('wdform_'.$i."_mm".$id); + $list_text_mode=$list_text_mode.$element_label.' - '.$input_get->getString('wdform_'.$i."_hh".$id).':'.$input_get->getString('wdform_'.$i."_mm".$id); + } + $am_pm=$input_get->getString('wdform_'.$i."_am_pm".$id); + if(isset($am_pm)) + { + $list=$list.' '.$input_get->getString('wdform_'.$i."_am_pm".$id).'
'.$element_label.''.$input_get->getString('wdform_'.$i."_element_first".$id).' '.$input_get->getString('wdform_'.$i."_element_last".$id).'
'.$element_label.''.$input_get->getString('wdform_'.$i."_element_title".$id).' '.$input_get->getString('wdform_'.$i."_element_first".$id).' '.$input_get->getString('wdform_'.$i."_element_last".$id).' '.$input_get->getString('wdform_'.$i."_element_middle".$id).'
'.$element_label.''.$input_get->getString('wdform_'.$i."_element_first".$id).' '.$input_get->getString('wdform_'.$i."_element_last".$id).'
'.$label_order_original[$i].''.$input_get->getString('wdform_'.$i."_street1".$id).'
'.$label_order_original[$i].''.$input_get->getString('wdform_'.$i."_street2".$id).'
'.$label_order_original[$i].''.$input_get->getString('wdform_'.$i."_city".$id).'
'.$label_order_original[$i].''.$input_get->getString('wdform_'.$i."_state".$id).'
'.$label_order_original[$i].''.$input_get->getString('wdform_'.$i."_postal".$id).'
'.$label_order_original[$i].''.$input_get->getString('wdform_'.$i."_country".$id).'
'.$element_label.''.$input_get->getString('wdform_'.$i."_day".$id).'-'.$input_get->getString('wdform_'.$i."_month".$id).'-'.$input_get->getString('wdform_'.$i."_year".$id).'
'.$element_label.''.$input_get->getString('wdform_'.$i."_other_input".$id).'
'.$element_label.'
'.$element.'
'.$element_label.''; + $list_text_mode=$list_text_mode.$element_label.' - '; + $start=-1; + for($j=0; $j<100; $j++) + { + $element=$input_get->getString('wdform_'.$i."_element".$id.$j); + if(isset($element)) + { + $start=$j; + break; + } + } + + $other_element_id=-1; + $is_other=$input_get->getString('wdform_'.$i."_allow_other".$id); + if($is_other=="yes") + { + $other_element_id=$input_get->getString('wdform_'.$i."_allow_other_num".$id); + } + + + if($start!=-1) + { + for($j=$start; $j<100; $j++) + { + + $element=$input_get->getString('wdform_'.$i."_element".$id.$j); + if(isset($element)) + if($j==$other_element_id) + { + $list=$list.$input_get->getString('wdform_'.$i."_other_input".$id).'
'; + $list_text_mode=$list_text_mode.$input_get->getString('wdform_'.$i."_other_input".$id).', '; + } + else + { + $list=$list.$input_get->getString('wdform_'.$i."_element".$id.$j).'
'; + $list_text_mode=$list_text_mode.$input_get->getString('wdform_'.$i."_element".$id.$j).', '; + } + } + + $list=$list.'
'.$element_label.''.$value.$form_currency.'
'.$element_label.'
'.$value.'
'.$element_label.'
'.$value.'
'.$element_label.'
'.$value.'
'.$element_label.''; + $list_text_mode=$list_text_mode.$element_label.' - '; + $start=-1; + for($j=0; $j<100; $j++) + { + $element=$input_get->getString('wdform_'.$i."_element".$id.$j); + if(isset($element)) + { + $start=$j; + break; + } + } + + if($start!=-1) + { + for($j=$start; $j<100; $j++) + { + + $element=$input_get->getString('wdform_'.$i."_element".$id.$j); + if(isset($element)) + { + $list=$list.$input_get->getString('wdform_'.$i."_element".$id.$j."_label").' - '.($input_get->getString('wdform_'.$i."_element".$id.$j)=='' ? '0'.$form_currency : $input_get->getString('wdform_'.$i."_element".$id.$j)).$form_currency.'
'; + $list_text_mode=$list_text_mode.$input_get->getString('wdform_'.$i."_element".$id.$j."_label").' - '.($input_get->getString('wdform_'.$i."_element".$id.$j)=='' ? '0'.$form_currency : $input_get->getString('wdform_'.$i."_element".$id.$j)).$form_currency.', '; + } + } + + + } + $element_quantity_label=$input_get->getString('wdform_'.$i."_element_quantity_label".$id); + if(isset($element_quantity_label)) + { + $list=$list.'
'.$input_get->getString('wdform_'.$i."_element_quantity_label".$id).': '.$input_get->getString('wdform_'.$i."_element_quantity".$id); + $list_text_mode=$list_text_mode.$input_get->getString('wdform_'.$i."_element_quantity_label".$id).': '.$input_get->getString('wdform_'.$i."_element_quantity".$id).', '; + } + + for($k=0; $k<50; $k++) + { + $temp_val=$input_get->getString('wdform_'.$i."_element_property_value".$id.$k); + if(isset($temp_val)) + { + $list=$list.'
'.$input_get->getString('wdform_'.$i."_element_property_label".$id.$k).': '.$input_get->getString('wdform_'.$i."_element_property_value".$id.$k); + $list_text_mode=$list_text_mode.$input_get->getString('wdform_'.$i."_element_property_label".$id.$k).': '.$input_get->getString('wdform_'.$i."_element_property_value".$id.$k).', '; + } + } + + $list=$list.'
'.$element_label.'
'.$element.'
'.$element_label.'
'.$selected.'/'.$element.'
'.$element_label.'
'.$selected.'/'.$element.'
'.$element_label.'
'.$element.'
'.$element_label.'
'.$element.'
'.$element_label.'
From:'.$element0.'To:'.$element1.'
'.$element_label.'
'.$element.'
"; + + $matrix .=''; + + for( $k=1;$k< count($mat_columns) ;$k++) + $matrix .=''; + $matrix .=''; + + $aaa=Array(); + + for($k=1; $k<=$rows_count; $k++) + { + $matrix .=''; + + if($input_type=="radio") + { + + + $mat_radio = $input_get->getString('wdform_'.$i."_input_element".$id.$k,0); + if($mat_radio==0) + { + $checked=""; + $aaa[1]=""; + } + else + $aaa=explode("_",$mat_radio); + + + for($j=1; $j<=$columns_count; $j++) + { + if($aaa[1]==$j) + $checked="checked"; + else + $checked=""; + + $matrix .=''; + + } + + } + else + { + if($input_type=="checkbox") + { + for($j=1; $j<=$columns_count; $j++) + { + $checked = $input_get->getString('wdform_'.$i."_input_element".$id.$k.'_'.$j); + if($checked==1) + $checked = "checked"; + else + $checked = ""; + + $matrix .=''; + + } + + } + else + { + if($input_type=="text") + { + + for($j=1; $j<=$columns_count; $j++) + { + $checked = $input_get->getString('wdform_'.$i."_input_element".$id.$k.'_'.$j); + $matrix .=''; + + } + + } + else{ + for($j=1; $j<=$columns_count; $j++) + { + $checked = $input_get->getString('wdform_'.$i."_select_yes_no".$id.$k.'_'.$j); + $matrix .=''; + + + + } + } + + } + + } + $matrix .=''; + + } + $matrix .='
'.$mat_columns[$k].'
'.$mat_rows[$k].''.$checked.'
'; + + + + + + if(isset($matrix)) + { + $list=$list.''.$element_label.'
'.$matrix.'
'; + } + + break; + } + + + default: break; + } + + + } + + + + } + + + + $list=$list.''; + + + $config = JFactory::getConfig(); + + if($row->mail_from) + + $site_mailfrom = $row->mail_from; + + else + + $site_mailfrom=$config->get( 'mailfrom' ); + + + + if($row->mail_from_name) + + $site_fromname = $row->mail_from_name; + + else + + $site_fromname=$config->get( 'fromname' ); + + + + + + if($row->sendemail) + if($row->send_to) + { + $recipient=''; + $cca = $row->mail_cc_user; + $bcc = $row->mail_bcc_user; + $send_tos=explode('**',$row->send_to); + if($row->mail_from_user) + $from = $row->mail_from_user; + else + $from=$config->get( 'mailfrom' ); + + if($row->mail_from_name_user) + $fromname = $row->mail_from_name_user; + else + $fromname=$config->get( 'fromname' ); + + if($row->mail_subject_user) + $subject = $row->mail_subject_user; + else + $subject = $row->title; + + if($row->reply_to_user) + $replyto = $row->reply_to_user; + + if($row->mail_attachment_user) + for($k=0;$kmail_mode_user) + { + $mode = 1; + $list_user = wordwrap($list, 70, "\n", true); + $new_script = $row->script_mail_user; + } + else + { + $mode = 0; + $list_user = wordwrap($list_text_mode, 1000, "\n", true); + $new_script = str_replace(array('

','

'),'',$row->script_mail_user); + } + + + foreach($label_order_original as $key => $label_each) + { + $type=$label_type[$key]; + if(strpos($row->script_mail_user, "%".$label_each."%")) + { + $new_value = $this->custom_fields_mail($type, $key, $id); + $new_script = str_replace("%".$label_each."%", $new_value, $new_script); + } + + if(strpos($fromname, "%".$label_each."%")>-1) + { + $new_value = $this->custom_fields_mail($type, $key, $id); + $fromname = str_replace("%".$label_each."%", $new_value, $fromname); + } + + if(strpos($subject, "%".$label_each."%")>-1) + { + $new_value = $this->custom_fields_mail($type, $key, $id); + $subject = str_replace("%".$label_each."%", $new_value, $subject); + } + } + + if(strpos($new_script, "%ip%")>-1) + $new_script = str_replace("%ip%", $ip, $new_script); + + if(strpos($new_script, "%all%")>-1) + $new_script = str_replace("%all%", $list_user, $new_script); + + $body = $new_script; + + $send_copy=$input_get->getString("wdform_send_copy_".$id); + + if(isset($send_copy)) + $send=true; + else + { + foreach($send_tos as $send_to) + { + $recipient=$input_get->getString('wdform_'.str_replace('*', '', $send_to)."_element".$id); + if($recipient) + $send=$this->sendMail($from, $fromname, $recipient, $subject, $body, $mode, $cca, $bcc, $attachment_user, $replyto, $replytoname); + } + } + + } + + if($row->sendemail) + if($row->mail) + { + if($row->mail_from) + { + $from = $input_get->getString('wdform_'.$row->mail_from."_element".$id); + if(!isset($from)) + $from = $row->mail_from; + } + else + { + $from = $config->get( 'mailfrom' ); + } + + if($row->mail_from_name) + $fromname = $row->mail_from_name; + else + $fromname = $config->get( 'fromname' ); + + if($row->reply_to) + { + $replyto = $input_get->getString('wdform_'.$row->reply_to."_element".$id); + if(!isset($replyto)) + $replyto = $row->reply_to; + } + $recipient = $row->mail; + $cca = $row->mail_cc; + $bcc = $row->mail_bcc; + + if($row->mail_subject) + $subject = $row->mail_subject; + else + $subject = $row->title; + + if($row->mail_attachment) + for($k=0;$kmail_mode) + { + $mode = 1; + $list = wordwrap($list, 70, "\n", true); + $new_script = $row->script_mail; + } + else + { + $mode = 0; + $list = $list_text_mode; + $list = wordwrap($list, 1000, "\n", true); + $new_script = str_replace(array('

','

'),'',$row->script_mail); + } + + foreach($label_order_original as $key => $label_each) + { + $type=$label_type[$key]; + if(strpos($row->script_mail, "%".$label_each."%")) + { + $new_value = $this->custom_fields_mail($type, $key, $id); + $new_script = str_replace("%".$label_each."%", $new_value, $new_script); + } + + if(strpos($fromname, "%".$label_each."%")>-1) + { + $new_value = $this->custom_fields_mail($type, $key, $id); + $fromname = str_replace("%".$label_each."%", $new_value, $fromname); + } + + if(strpos($subject, "%".$label_each."%")>-1) + { + $new_value = $this->custom_fields_mail($type, $key, $id); + $subject = str_replace("%".$label_each."%", $new_value, $subject); + } + } + + if(strpos($new_script, "%ip%")>-1) + $new_script = str_replace("%ip%", $ip, $new_script); + + if(strpos($new_script, "%all%")>-1) + $new_script = str_replace("%all%", $list, $new_script); + + $body = $new_script; + + if($row->sendemail) + { + $send=$this->sendMail($from, $fromname, $recipient, $subject, $body, $mode, $cca, $bcc, $attachment, $replyto, $replytoname); + } + } + + + // $msg =JFactory::getApplication()->enqueueMessage(JText::_('WDF_SUBMITTED'),'Success'); + + $msg=JText::_('WDF_SUBMITTED'); + + $succes = 1; + + + + if($row->sendemail) + + if($row->mail || $row->send_to) + + { + + if ( $send) + { + if ( $send !== true ) + { + $msg=JText::_('WDF_MAIL_SEND_ERROR'); + $succes = 0; + } + else + $msg=JText::_('WDF_MAIL_SENT'); + } + } + + + + } + + + + else + + { + + + + + + + + foreach($label_order_ids as $key => $label_order_id) + + { + + $i=$label_order_id; + + $type=$input_get->getString($i."_type".$id); + + if(isset($type)) + + if($type!="type_map" and $type!="type_submit_reset" and $type!="type_editor" and $type!="type_captcha" and $type!="type_recaptcha" and $type!="type_button") + + { + + $element_label=$label_order_original[$i]; + + + + switch ($type) + + { + + case 'type_text': + + case 'type_password': + + case 'type_textarea': + + case "type_date": + + case "type_own_select": + + case "type_country": + + case "type_number": + + { + + $element=$input_get->getString($i."_element".$id); + + if(isset($element)) + + { + + $list=$list.''.$element_label.'
'.$element.'
'; + + } + + break; + + + + + + } + + + + case "type_hidden": + + { + + $element=$input_get->getString($element_label); + + if(isset($element)) + + { + + $list=$list.''.$element_label.'
'.$element.'
'; + + } + + break; + + } + + + + case "type_mark_map": + + { + + $element=$input_get->getString($i."_long".$id); + + if(isset($element)) + + { + + $list=$list.''.$element_label.'Longitude:'.$input_get->getString($i."_long".$id).'
Latitude:'.$input_get->getString($i."_lat".$id).''; + + } + + break; + + } + + + + case "type_submitter_mail": + + { + + $element=$input_get->getString($i."_element".$id); + + if(isset($element)) + + { + + $list=$list.''.$element_label.'
'.$element.'
'; + + if($input_get->getString($i."_send".$id)=="yes") + + array_push($cc, $element); + + } + + break; + + } + + + + case "type_time": + + { + + + + $hh=$input_get->getString($i."_hh".$id); + + if(isset($hh)) + + { + + $ss=$input_get->getString($i."_ss".$id); + + if(isset($ss)) + + $list=$list.''.$element_label.''.$input_get->getString($i."_hh".$id).':'.$input_get->getString($i."_mm".$id).':'.$input_get->getString($i."_ss".$id); + + else + + $list=$list.''.$element_label.''.$input_get->getString($i."_hh".$id).':'.$input_get->getString($i."_mm".$id); + + $am_pm=$input_get->getString($i."_am_pm".$id); + + if(isset($am_pm)) + + $list=$list.' '.$input_get->getString($i."_am_pm".$id).''; + + else + + $list=$list.''; + + } + + + + break; + + } + + + + case "type_phone": + + { + + $element_first=$input_get->getString($i."_element_first".$id); + + if(isset($element_first)) + + { + + $list=$list.''.$element_label.''.$input_get->getString($i."_element_first".$id).' '.$input_get->getString($i."_element_last".$id).''; + + } + + break; + + } + + + + case "type_name": + + { + + $element_first=$input_get->getString($i."_element_first".$id); + + if(isset($element_first)) + + { + + $element_title=$input_get->getString($i."_element_title".$id); + + if(isset($element_title)) + + $list=$list.''.$element_label.''.$input_get->getString($i."_element_title".$id).' '.$input_get->getString($i."_element_first".$id).' '.$input_get->getString($i."_element_last".$id).' '.$input_get->getString($i."_element_middle".$id).''; + + else + + $list=$list.''.$element_label.''.$input_get->getString($i."_element_first".$id).' '.$input_get->getString($i."_element_last".$id).''; + + } + + break; + + } + + + + case "type_address": + + { + + $street1=$input_get->getString($i."_street1".$id); + + + + if(isset($street1)) + + + + + + + + $list=$list.''.$label_order_original[$i].''.$input_get->getString($i."_street1".$id).''; + + + + $i++; + + + + $street2=$input_get->getString($i."_street2".$id); + + + + if(isset($street2)) + + + + $list=$list.''.$label_order_original[$i].''.$input_get->getString($i."_street2".$id).''; + + + + $i++; + + + + + + $city=$input_get->getString($i."_city".$id); + + + + if(isset($city)) + + + + $list=$list.''.$label_order_original[$i].''.$input_get->getString($i."_city".$id).''; + + + + $i++; + + + + $state=$input_get->getString($i."_state".$id); + + + + if(isset($state)) + + + + $list=$list.''.$label_order_original[$i].''.$input_get->getString($i."_state".$id).''; + + + + $i++; + + + + $postal=$input_get->getString($i."_postal".$id); + + + + if(isset($postal)) + + + + $list=$list.''.$label_order_original[$i].''.$input_get->getString($i."_postal".$id).''; + + + + $i++; + + + + $country = $input_get->getString($i."_country".$id); + + + + if(isset($country)) + + + + $list=$list.''.$label_order_original[$i].''.$input_get->getString($i."_country".$id).''; + + + + $i++; + + + + break; + + } + + + + case "type_date_fields": + + { + + $day=$input_get->getString($i."_day".$id); + + if(isset($day)) + + { + + $list=$list.''.$element_label.''.$input_get->getString($i."_day".$id).'-'.$input_get->getString($i."_month".$id).'-'.$input_get->getString($i."_year".$id).''; + + } + + break; + + } + + + + case "type_radio": + + { + + $element=$input_get->getString($i."_other_input".$id); + + if(isset($element)) + + { + + $list=$list.''.$element_label.''.$input_get->getString($i."_other_input".$id).''; + + break; + + } + + + + $element=$input_get->getString($i."_element".$id); + + if(isset($element)) + + { + + $list=$list.''.$element_label.'
'.$element.'
'; + + } + + break; + + } + + + + case "type_checkbox": + + { + + $list=$list.''.$element_label.''; + + + + $start=-1; + + for($j=0; $j<100; $j++) + + { + + $element=$input_get->getString($i."_element".$id.$j); + + if(isset($element)) + + { + + $start=$j; + + break; + + } + + } + + + + $other_element_id=-1; + + $is_other=$input_get->getString($i."_allow_other".$id); + + if($is_other=="yes") + + { + + $other_element_id=$input_get->getString($i."_allow_other_num".$id); + + } + + + + + + if($start!=-1) + + { + + for($j=$start; $j<100; $j++) + + { + + + + $element=$input_get->getString($i."_element".$id.$j); + + if(isset($element)) + + if($j==$other_element_id) + + { + + $list=$list.$input_get->getString($i."_other_input".$id).'
'; + + } + + else + + + + $list=$list.$input_get->getString($i."_element".$id.$j).'
'; + + } + + $list=$list.''; + + } + + + + + + break; + + } + + + + case "type_paypal_price": + + + + { + + + + $value=0; + + + + if($input_get->getString($i."_element_dollars".$id)) + + + + $value=$input_get->getString($i."_element_dollars".$id); + + + + + + + + if($input_get->getString($i."_element_cents".$id)) + + + + $value=$value.'.'.$input_get->getString($i."_element_cents".$id); + + + + + + + + $list=$list.''.$element_label.''.$value.$form_currency.''; + + + + break; + + + + + + + + } + + + + + + + + case "type_paypal_select": + + + + { + + + + $value=$input_get->getString($i."_element_label".$id).':'.$input_get->getString($i."_element".$id).$form_currency; + + + + $element_quantity_label=$input_get->getString($i."_element_quantity_label".$id); + + + + if(isset($element_quantity_label)) + + + + $value.='
'.$input_get->getString($i."_element_quantity_label".$id).': '.$input_get->getString($i."_element_quantity".$id); + + + + + + + + for($k=0; $k<50; $k++) + + + + { + + + + $temp_val=$input_get->getString($i."_element_property_value".$id.$k); + + + + if(isset($temp_val)) + + + + { + + + + $value.='
'.$input_get->getString($i."_element_property_label".$id.$k).': '.$input_get->getString($i."_element_property_value".$id.$k); + + + + } + + + + } + + + + + + + + $list=$list.''.$element_label.'
'.$value.'
'; + + + + break; + + + + + + + + } + + + + + + + + case "type_paypal_radio": + + + + { + + + + + + + + $value=$input_get->getString($i."_element_label".$id).' - '.$input_get->getString($i."_element".$id).$form_currency; + + + + + + + + $element_quantity_label=$input_get->getString($i."_element_quantity_label".$id); + + + + if(isset($element_quantity_label)) + + + + $value.='
'.$input_get->getString($i."_element_quantity_label".$id).': '.$input_get->getString($i."_element_quantity".$id); + + + + + + + + for($k=0; $k<50; $k++) + + + + { + + + + $temp_val=$input_get->getString($i."_element_property_value".$id.$k); + + + + if(isset($temp_val)) + + + + { + + + + $value.='
'.$input_get->getString($i."_element_property_label".$id.$k).': '.$input_get->getString($i."_element_property_value".$id.$k); + + + + } + + + + } + + + + + + + + $list=$list.''.$element_label.'
'.$value.'
'; + + + + + + + + break; + + + + } + + + + + + + + case "type_paypal_shipping": + + + + { + + + + + + + + $value=$input_get->getString($i."_element_label".$id).' - '.$input_get->getString($i."_element".$id).$form_currency; + + + + $list=$list.''.$element_label.'
'.$value.'
'; + + + + + + + + break; + + + + } + + + + + + + + case "type_paypal_checkbox": + + + + { + + + + $list=$list.''.$element_label.''; + + + + + + + + $start=-1; + + + + for($j=0; $j<100; $j++) + + + + { + + + + $element=$input_get->getString($i."_element".$id.$j); + + + + if(isset($element)) + + + + { + + + + $start=$j; + + + + break; + + + + } + + + + } + + + + + + + + if($start!=-1) + + + + { + + + + for($j=$start; $j<100; $j++) + + + + { + + + + + + + + $element=$input_get->getString($i."_element".$id.$j); + + + + if(isset($element)) + + + + { + + + + $list=$list.$input_get->getString($i."_element".$id.$j."_label").' - '.($input_get->getString($i."_element".$id.$j)=='' ? '0'.$form_currency : $input_get->getString($i."_element".$id.$j)).$form_currency.'
'; + + + + } + + + + } + + + + } + + + + + + + + $element_quantity_label=$input_get->getString($i."_element_quantity_label".$id); + + + + if(isset($element_quantity_label)) + + + + $list=$list.'
'.$input_get->getString($i."_element_quantity_label".$id).': '.$input_get->getString($i."_element_quantity".$id); + + + + + + + + for($k=0; $k<50; $k++) + + + + { + + + + $temp_val=$input_get->getString($i."_element_property_value".$id.$k); + + + + if(isset($temp_val)) + + + + { + + + + $list=$list.'
'.$input_get->getString($i."_element_property_label".$id.$k).': '.$input_get->getString($i."_element_property_value".$id.$k); + + + + } + + + + } + + + + + + + + $list=$list.''; + + + + + + + + + + + + break; + + + + } + + + + case "type_paypal_total": + + + + { + + + + + + $element=$input_get->getString($i."_paypal_total".$id); + + + + + + $list=$list.''.$element_label.'
'.$element.'
'; + + + + + + + + break; + + + + } + + + + case "type_star_rating": + + { + + $element=$input_get->getString($i."_star_amount".$id); + + $selected=$input_get->getString($i."_selected_star_amount".$id,0); + + //$star_color=$input_get->getString($i."_star_color_id_temp"); + + + + if(isset($element)) + + { + + $list=$list.''.$element_label.'
'.$selected.'/'.$element.'
'; + + } + + break; + + } + + + + + + case "type_scale_rating": + + { + + $element=$input_get->getString($i."_scale_amount".$id); + + $selected=$input_get->getString($i."_scale_radio".$id,0); + + + + + + if(isset($element)) + + { + + $list=$list.''.$element_label.'
'.$selected.'/'.$element.'
'; + + } + + break; + + } + + + + case "type_spinner": + + { + + + + $element=$input_get->getString($i."_element".$id); + + if(isset($element)) + + { + + $list=$list.''.$element_label.'
'.$element.'
'; + + } + + break; + + } + + + + case "type_slider": + + { + + + + $element=$input_get->getString($i."_slider_value".$id); + + if(isset($element)) + + { + + $list=$list.''.$element_label.'
'.$element.'
'; + + } + + break; + + } + + case "type_range": + + { + + + + $element0=$input_get->getString($i."_element".$id.'0'); + + $element1=$input_get->getString($i."_element".$id.'1'); + + if(isset($element0) || isset($element1)) + + { + + $list=$list.''.$element_label.'
From:'.$element0.'To:'.$element1.'
'; + + } + + break; + + } + + + + case "type_grading": + + { + + $element=$input_get->getString($i."_hidden_item".$id); + + $grading = explode(":",$element); + + $items_count = sizeof($grading)-1; + + + + $element = ""; + + $total = ""; + + + + for($k=0;$k<$items_count;$k++) + + + + { + + $element .= $grading[$k].":".$input_get->getString($i."_element".$id.$k)." "; + + $total += $input_get->getString($i."_element".$id.$k); + + } + + + + $element .="Total:".$total; + + + + + + if(isset($element)) + + { + + $list=$list.''.$element_label.'
'.$element.'
'; + + } + + break; + + } + + + + case "type_matrix": + + { + + + + + + $input_type=$input_get->getString($i."_input_type".$id); + + + + $mat_rows = $input_get->getString($i."_hidden_row".$id); + + $mat_rows = explode('***', $mat_rows); + + $mat_rows = array_slice($mat_rows,0, count($mat_rows)-1); + + + + $mat_columns = $input_get->getString($i."_hidden_column".$id); + + $mat_columns = explode('***', $mat_columns); + + $mat_columns = array_slice($mat_columns,0, count($mat_columns)-1); + + + + $row_ids=explode(",",substr($input_get->getString($i."_row_ids".$id), 0, -1)); + + $column_ids=explode(",",substr($input_get->getString($i."_column_ids".$id), 0, -1)); + + + + $matrix=""; + + + + $matrix .=''; + + + + for( $k=0;$k< count($mat_columns) ;$k++) + + $matrix .=''; + + $matrix .=''; + + + + $aaa=Array(); + + $k=0; + + foreach($row_ids as $row_id) + + { + + $matrix .=''; + + + + if($input_type=="radio") + + { + + + + + + $mat_radio = $input_get->getString($i."_input_element".$id.$row_id,0); + + if($mat_radio==0) + + { + + $checked=""; + + $aaa[1]=""; + + } + + else + + $aaa=explode("_",$mat_radio); + + + + foreach($column_ids as $column_id) + + { + + if($aaa[1]==$column_id) + + $checked="checked"; + + else + + $checked=""; + + + + $matrix .=''; + + + + } + + + + } + + else + + { + + if($input_type=="checkbox") + + { + + foreach($column_ids as $column_id) + + { + + $checked = $input_get->getString($i."_input_element".$id.$row_id.'_'.$column_id); + + if($checked==1) + + $checked = "checked"; + + else + + $checked = ""; + + + + $matrix .=''; + + + + } + + + + } + + else + + { + + if($input_type=="text") + + { + + + + foreach($column_ids as $column_id) + + { + + $checked = $input_get->getString($i."_input_element".$id.$row_id.'_'.$column_id); + + $matrix .=''; + + + + } + + + + } + + else{ + + foreach($column_ids as $column_id) + + { + + $checked = $input_get->getString($i."_select_yes_no".$id.$row_id.'_'.$column_id); + + $matrix .=''; + + + + + + + + } + + } + + + + } + + + + } + + $matrix .=''; + + $k++; + + } + + $matrix .='
'.$mat_columns[$k].'
'.$mat_rows[$k].''.$checked.'
'; + + + + + + + + + + + + if(isset($matrix)) + + { + + $list=$list.''.$element_label.'
'.$matrix.'
'; + + } + + + + break; + + } + + + + + + default: break; + + } + + } + + + + + + + + + + + + } + + + + $list=$list.''; + + $list = wordwrap($list, 70, "\n", true); + + + + $config = JFactory::getConfig(); + + if($row->mail_from) + + $site_mailfrom = $row->mail_from; + + else + + $site_mailfrom=$config->get( 'mailfrom' ); + + + + if($row->mail_from_name) + + $site_fromname = $row->mail_from_name; + + else + + $site_fromname=$config->get( 'fromname' ); + + for($k=0;$ktitle; + + ///////////////////////////////////////////////////////////////////////////////////////// + + + + + + + +////////////////////////////////////////////////////////////////////////////////////////////////////////// + + + + + + + + $new_script = $row->script_mail_user; + + + + + + + + foreach($label_order_original as $key => $label_each) + + + + + + + + { + + + + + + + + if(strpos($row->script_mail_user, "%".$label_each."%")!=-1) + + + + + + + + { + + + + + + + + $type = $input_get->getString($key."_type".$id); + + + + + + + + if($type!="type_submit_reset" or $type!="type_map" or $type!="type_editor" or $type!="type_captcha" or $type!="type_recaptcha" or $type!="type_button") + + + + + + + + { + + + + + + + + $new_value =""; + + + + + + + + switch ($type) + + + + + + + + { + + + + + + + + case 'type_text': + + + + + + + + case 'type_password': + + + + + + + + case 'type_textarea': + + + + + + + + case "type_date": + + + + + + + + case "type_own_select": + + + + + + + + case "type_country": + + + + + + + + case "type_number": + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_element".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $element; + + + + + + + + } + + + + + + + + break; + + + + + + + + + + + + + + + + + + + + + + + + } + + + + + + + + + + + + + + + + case "type_hidden": + + + + + + + + { + + + + + + + + $element=$input_get->getString($element_label); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $element; + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + case "type_mark_map": + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_long".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = 'Longitude:'.$input_get->getString($key."_long".$id).'
Latitude:'.$input_get->getString($key."_lat".$id); + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_submitter_mail": + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_element".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $element; + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_time": + + + + + + + + { + + + + + + + + + + + + + + + + $hh=$input_get->getString($key."_hh".$id); + + + + + + + + if(isset($hh)) + + + + + + + + { + + + + + + + + $ss=$input_get->getString($key."_ss".$id); + + + + + + + + if(isset($ss)) + + + + + + + + $new_value = $input_get->getString($key."_hh".$id).':'.$input_get->getString($key."_mm".$id).':'.$input_get->getString($key."_ss".$id); + + + + + + + + else + + + + + + + + $new_value = $input_get->getString($key."_hh".$id).':'.$input_get->getString($key."_mm".$id); + + + + + + + + $am_pm=$input_get->getString($key."_am_pm".$id); + + + + + + + + if(isset($am_pm)) + + + + + + + + $new_value=$new_value.' '.$input_get->getString($key."_am_pm".$id); + + + + + + + + + + + + + + + + } + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_phone": + + + + + + + + { + + + + + + + + $element_first=$input_get->getString($key."_element_first".$id); + + + + + + + + if(isset($element_first)) + + + + + + + + { + + + + + + + + $new_value = $input_get->getString($key."_element_first".$id).' '.$input_get->getString($key."_element_last".$id); + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_name": + + + + + + + + { + + + + + + + + $element_first=$input_get->getString($key."_element_first".$id); + + + + + + + + if(isset($element_first)) + + + + + + + + { + + + + + + + + $element_title=$input_get->getString($key."_element_title".$id); + + + + + + + + if(isset($element_title)) + + + + + + + + $new_value = $input_get->getString($key."_element_title".$id).' '.$input_get->getString($key."_element_first".$id).' '.$input_get->getString($i."_element_last".$id).' '.$input_get->getString($i."_element_middle".$id); + + + + + + + + else + + + + + + + + $new_value = $input_get->getString($key."_element_first".$id).' '.$input_get->getString($key."_element_last".$id); + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_address": + + { + + $street1=$input_get->getString($key."_street1".$id); + + + + if(isset($street1)) + + + + { + + + + $new_value=$input_get->getString($key."_street1".$id); + + + + break; + + + + } + + + + $street2=$input_get->getString($key."_street2".$id); + + + + if(isset($street2)) + + + + { + + + + $new_value=$input_get->getString($key."_street2".$id); + + + + break; + + + + } + + + + $city=$input_get->getString($key."_city".$id); + + + + if(isset($city)) + + + + { + + + + $new_value=$input_get->getString($key."_city".$id); + + + + break; + + + + } + + + + $state=$input_get->getString($key."_state".$id); + + + + if(isset($state)) + + + + { + + + + $new_value=$input_get->getString($key."_state".$id); + + + + break; + + + + } + + + + $postal=$input_get->getString($key."_postal".$id); + + + + if(isset($postal)) + + + + { + + + + $new_value=$input_get->getString($key."_postal".$id); + + + + break; + + } + + + + + + $country = $input_get->getString($key."_country".$id); + + + + if(isset($country)) + + { + + + + $new_value=$input_get->getString($key."_country".$id); + + + + break; + + } + + + + + + break; + + } + + + + + + + + + + + + case "type_date_fields": + + + + + + + + { + + + + + + + + $day=$input_get->getString($key."_day".$id); + + + + + + + + if(isset($day)) + + + + + + + + { + + + + + + + + $new_value = $input_get->getString($key."_day".$id).'-'.$input_get->getString($key."_month".$id).'-'.$input_get->getString($key."_year".$id); + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_radio": + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_other_input".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $input_get->getString($key."_other_input".$id); + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + $element=$input_get->getString($key."_element".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $element; + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_checkbox": + + + + + + + + { + + + + + + + + + + + + + + + + $start=-1; + + + + + + + + for($j=0; $j<100; $j++) + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_element".$id.$j); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $start=$j; + + + + + + + + break; + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + $other_element_id=-1; + + + + + + + + $is_other=$input_get->getString($key."_allow_other".$id); + + + + + + + + if($is_other=="yes") + + + + + + + + { + + + + + + + + $other_element_id=$input_get->getString($key."_allow_other_num".$id); + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + if($start!=-1) + + + + + + + + { + + + + + + + + for($j=$start; $j<100; $j++) + + + + + + + + { + + + + + + + + + + + + + + + + $element=$input_get->getString($key."_element".$id.$j); + + + + + + + + if(isset($element)) + + + + + + + + if($j==$other_element_id) + + + + + + + + { + + + + + + + + $new_value = $new_value.$input_get->getString($key."_other_input".$id).'
'; + + + + + + + + } + + + + + + + + else + + + + + + + + + + + + + + + + $new_value = $new_value.$input_get->getString($key."_element".$id.$j).'
'; + + + + + + + + } + + + + + + + + + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + case "type_paypal_price": + + + + + + + + { + + + + + + + + $new_value=0; + + + + + + + + if($input_get->getString($key."_element_dollars".$id)) + + + + + + + + $new_value=$input_get->getString($key."_element_dollars".$id); + + + + + + + + + + + + + + + + if($input_get->getString($key."_element_cents".$id)) + + + + + + + + $new_value=$new_value.'.'.$input_get->getString($key."_element_cents".$id); + + + + + + + + + + + + + + + + $new_value=$new_value.$form_currency; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_paypal_select": + + + + + + + + { + + + + + + + + + + + + + + + + $new_value=$input_get->getString($key."_element_label".$id).':'.$input_get->getString($key."_element".$id).$form_currency; + + + + + + + + $element_quantity_label=$input_get->getString($key."_element_quantity_label".$id); + + + + + + + + if(isset($element_quantity_label)) + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_quantity_label".$id).': '.$input_get->getString($key."_element_quantity".$id); + + + + + + + + + + + + + + + + for($k=0; $k<50; $k++) + + + + + + + + { + + + + + + + + $temp_val=$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + if(isset($temp_val)) + + + + + + + + { + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_property_label".$id.$k).': '.$input_get->getString($i."_element_property_value".$id.$k); + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_paypal_radio": + + + + + + + + { + + + + + + + + + + + + + + + + $new_value=$input_get->getString($key."_element_label".$id).' - '.$input_get->getString($key."_element".$id).$form_currency; + + + + + + + + + + + + + + + + $element_quantity_label=$input_get->getString($key."_element_quantity_label".$id); + + + + + + + + if(isset($element_quantity_label)) + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_quantity_label".$id).': '.$input_get->getString($key."_element_quantity".$id); + + + + + + + + + + + + + + + + for($k=0; $k<50; $k++) + + + + + + + + { + + + + + + + + $temp_val=$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + if(isset($temp_val)) + + + + + + + + { + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_property_label".$id.$k).': '.$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_paypal_shipping": + + + + + + + + { + + + + + + + + + + + + + + + + $new_value=$input_get->getString($key."_element_label".$id).' : '.$input_get->getString($key."_element".$id).$form_currency; + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_paypal_checkbox": + + + + + + + + { + + + + + + + + $start=-1; + + + + + + + + for($j=0; $j<100; $j++) + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_element".$id.$j); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $start=$j; + + + + + + + + break; + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + if($start!=-1) + + + + + + + + { + + + + + + + + for($j=$start; $j<100; $j++) + + + + + + + + { + + + + + + + + + + + + + + + + $element=$input_get->getString($key."_element".$id.$j); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value=$new_value.$input_get->getString($key."_element".$id.$j."_label").' - '.($input_get->getString($key."_element".$id.$j)=='' ? '0'.$form_currency : $input_get->getString($key."_element".$id.$j)).$form_currency.'
'; + + + + + + + + } + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + $element_quantity_label=$input_get->getString($key."_element_quantity_label".$id); + + + + + + + + if(isset($element_quantity_label)) + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_quantity_label".$id).': '.$input_get->getString($key."_element_quantity".$id); + + + + + + + + + + + + + + + + for($k=0; $k<50; $k++) + + + + + + + + { + + + + + + + + $temp_val=$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + if(isset($temp_val)) + + + + + + + + { + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_property_label".$id.$k).': '.$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + case "type_paypal_total": + + + + { + + + + + + $element=$input_get->getString($key."_paypal_total".$id); + + + + + + $new_value=$new_value.$element; + + + + + + + + break; + + + + } + + + + + + + + case "type_star_rating": + + { + + $element=$input_get->getString($key."_star_amount".$id); + + $selected=$input_get->getString($key."_selected_star_amount".$id,0); + + + + + + if(isset($element)) + + { + + $new_value=$new_value.$selected.'/'.$element; + + } + + break; + + } + + + + + + case "type_scale_rating": + + { + + $element=$input_get->getString($key."_scale_amount".$id); + + $selected=$input_get->getString($key."_scale_radio".$id,0); + + + + + + if(isset($element)) + + { + + $new_value=$new_value.$selected.'/'.$element; + + } + + break; + + } + + + + case "type_spinner": + + { + + + + $element=$input_get->getString($key."_element".$id); + + if(isset($element)) + + { + + $new_value=$new_value.$element; + + } + + break; + + } + + + + case "type_slider": + + { + + + + $element=$input_get->getString($key."_slider_value".$id); + + if(isset($element)) + + { + + $new_value=$new_value.$element; + + } + + break; + + } + + case "type_range": + + { + + + + $element0=$input_get->getString($key."_element".$id.'0'); + + $element1=$input_get->getString($key."_element".$id.'1'); + + if(isset($element0) || isset($element1)) + + { + + $new_value=$new_value.$element0.'-'.$element1; + + } + + break; + + } + + + + case "type_grading": + + { + + $element=$input_get->getString($key."_hidden_item".$id); + + $grading = explode(":",$element); + + $items_count = sizeof($grading)-1; + + + + $element = ""; + + $total = ""; + + + + for($k=0;$k<$items_count;$k++) + + + + { + + $element .= $grading[$k].":".$input_get->getString($key."_element".$id.$k)." "; + + $total += $input_get->getString($key."_element".$id.$k); + + } + + + + $element .="Total:".$total; + + + + + + if(isset($element)) + + { + + $new_value=$new_value.$element; + + } + + break; + + } + + + + case "type_matrix": + + { + + + + + + $input_type=$input_get->getString($key."_input_type".$id); + + + + $mat_rows = $input_get->getString($key."_hidden_row".$id); + + $mat_rows = explode('***', $mat_rows); + + $mat_rows = array_slice($mat_rows,0, count($mat_rows)-1); + + + + $mat_columns = $input_get->getString($key."_hidden_column".$id); + + $mat_columns = explode('***', $mat_columns); + + $mat_columns = array_slice($mat_columns,0, count($mat_columns)-1); + + + + $row_ids=explode(",",substr($input_get->getString($key."_row_ids".$id), 0, -1)); + + $column_ids=explode(",",substr($input_get->getString($key."_column_ids".$id), 0, -1)); + + + + + + $matrix=""; + + + + $matrix .=''; + + + + for( $k=0;$k< count($mat_columns) ;$k++) + + $matrix .=''; + + $matrix .=''; + + + + $aaa=Array(); + + $k=0; + + foreach( $row_ids as $row_id){ + + $matrix .=''; + + + + if($input_type=="radio"){ + + + + $mat_radio = $input_get->getString($key."_input_element".$id.$row_id,0); + + if($mat_radio==0){ + + $checked=""; + + $aaa[1]=""; + + } + + else{ + + $aaa=explode("_",$mat_radio); + + } + + + + foreach( $column_ids as $column_id){ + + if($aaa[1]==$column_id) + + $checked="checked"; + + else + + $checked=""; + + $matrix .=''; + + + + } + + + + } + + else{ + + if($input_type=="checkbox") + + { + + foreach( $column_ids as $column_id){ + + $checked = $input_get->getString($key."_input_element".$id.$row_id.'_'.$column_id); + + if($checked==1) + + $checked = "checked"; + + else + + $checked = ""; + + + + $matrix .=''; + + + + } + + + + } + + else + + { + + if($input_type=="text") + + { + + + + foreach( $column_ids as $column_id){ + + $checked = $input_get->getString($key."_input_element".$id.$row_id.'_'.$column_id); + + + + $matrix .=''; + + + + } + + + + } + + else{ + + foreach( $column_ids as $column_id){ + + $checked = $input_get->getString($key."_select_yes_no".$id.$row_id.'_'.$column_id); + + $matrix .=''; + + + + + + + + } + + } + + + + } + + + + } + + $matrix .=''; + + $k++; + + } + + $matrix .='
'.$mat_columns[$k].'
'.$mat_rows[$k].''.$checked.'
'; + + + + + + + + + + + + if(isset($matrix)) + + { + + $new_value=$new_value.$matrix; + + } + + + + break; + + } + + + + + + + + + + + + + + + + + + + + + + default: break; + + + + + + + + } + + + + + + + + + + + + + + + + $new_script = str_replace("%".$label_each."%", $new_value, $new_script); + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + if(strpos($new_script, "%ip%")>-1) + + $new_script = str_replace("%ip%", $ip, $new_script); + + + + if(strpos($new_script, "%all%")!=-1) + + + + + + + + $new_script = str_replace("%all%", $list, $new_script); + + + + + + + + + + + + + + + + $body = $new_script; + + + + + + + +////////////////////////////////////////////////////////////////////////////////////////////////////////// + + + + + + + +/////////////////////////////////////////////////////////////////////// + + + + $mode = 1; + + $send=$this->sendMail($from, $fromname, $recipient, $subject, $body, $mode, $cca, $bcc, $attachment, $replyto, $replytoname); + + } + + + + + + if($row->mail) + + { + + if($c) + + { + + $from = $c; + + $fromname = $c; + + } + + else + + { + + $from = $site_mailfrom; + + $fromname = $site_fromname; + + } + + $recipient = $row->mail; + + $subject = $row->title; + + $new_script = $row->script_mail; + + + + + + + + foreach($label_order_original as $key => $label_each) + + + + + + + + { + + + + + + + + if(strpos($row->script_mail, "%".$label_each."%")!=-1) + + + + + + + + { + + + + + + + + $type =$input_get->getString($key."_type".$id); + + + + + + + + if($type!="type_submit_reset" or $type!="type_map" or $type!="type_editor" or $type!="type_captcha" or $type!="type_recaptcha" or $type!="type_button") + + + + + + + + { + + + + + + + + $new_value =""; + + + + + + + + switch ($type) + + + + + + + + { + + + + + + + + case 'type_text': + + + + + + + + case 'type_password': + + + + + + + + case 'type_textarea': + + + + + + + + case "type_date": + + + + + + + + case "type_own_select": + + + + + + + + case "type_country": + + + + + + + + case "type_number": + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_element".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $element; + + + + + + + + } + + + + + + + + break; + + + + + + + + + + + + + + + + + + + + + + + + } + + + + + + + + + + + + + + + + case "type_hidden": + + + + + + + + { + + + + + + + + $element=$input_get->getString($element_label); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $element; + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + case "type_mark_map": + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_long".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = 'Longitude:'.$input_get->getString($key."_long".$id).'
Latitude:'.$input_get->getString($key."_lat".$id); + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_submitter_mail": + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_element".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $element; + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_time": + + + + + + + + { + + + + + + + + + + + + + + + + $hh=$input_get->getString($key."_hh".$id); + + + + + + + + if(isset($hh)) + + + + + + + + { + + + + + + + + $ss=$input_get->getString($key."_ss".$id); + + + + + + + + if(isset($ss)) + + + + + + + + $new_value = $input_get->getString($key."_hh".$id).':'.$input_get->getString($key."_mm".$id).':'.$input_get->getString($key."_ss".$id); + + + + + + + + else + + + + + + + + $new_value = $input_get->getString($key."_hh".$id).':'.$input_get->getString($key."_mm".$id); + + + + + + + + $am_pm=$input_get->getString($key."_am_pm".$id); + + + + + + + + if(isset($am_pm)) + + + + + + + + $new_value=$new_value.' '.$input_get->getString($key."_am_pm".$id); + + + + + + + + + + + + + + + + } + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_phone": + + + + + + + + { + + + + + + + + $element_first=$input_get->getString($key."_element_first".$id); + + + + + + + + if(isset($element_first)) + + + + + + + + { + + + + + + + + $new_value = $input_get->getString($key."_element_first".$id).' '.$input_get->getString($key."_element_last".$id); + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_name": + + + + + + + + { + + + + + + + + $element_first=$input_get->getString($key."_element_first".$id); + + + + + + + + if(isset($element_first)) + + + + + + + + { + + + + + + + + $element_title=$input_get->getString($key."_element_title".$id); + + + + + + + + if(isset($element_title)) + + + + + + + + $new_value = $input_get->getString($key."_element_title".$id).' '.$input_get->getString($key."_element_first".$id).' '.$input_get->getString($i."_element_last".$id).' '.$input_get->getString($i."_element_middle".$id); + + + + + + + + else + + + + + + + + $new_value = $input_get->getString($key."_element_first".$id).' '.$input_get->getString($key."_element_last".$id); + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_address": + + { + + $street1=$input_get->getString($key."_street1".$id); + + + + if(isset($street1)) + + + + { + + + + $new_value=$input_get->getString($key."_street1".$id); + + + + break; + + + + } + + + + $street2=$input_get->getString($key."_street2".$id); + + + + if(isset($street2)) + + + + { + + + + $new_value=$input_get->getString($key."_street2".$id); + + + + break; + + + + } + + + + $city=$input_get->getString($key."_city".$id); + + + + if(isset($city)) + + + + { + + + + $new_value=$input_get->getString($key."_city".$id); + + + + break; + + + + } + + + + $state=$input_get->getString($key."_state".$id); + + + + if(isset($state)) + + + + { + + + + $new_value=$input_get->getString($key."_state".$id); + + + + break; + + + + } + + + + $postal=$input_get->getString($key."_postal".$id); + + + + if(isset($postal)) + + + + { + + + + $new_value=$input_get->getString($key."_postal".$id); + + + + break; + + + + } + + + + + + $country = $input_get->getString($key."_country".$id); + + + + if(isset($country)) + + { + + + + $new_value=$input_get->getString($key."_country".$id); + + + + break; + + } + + + + + + break; + + + + } + + + + + + + + + + + + case "type_date_fields": + + + + + + + + { + + + + + + + + $day=$input_get->getString($key."_day".$id); + + + + + + + + if(isset($day)) + + + + + + + + { + + + + + + + + $new_value = $input_get->getString($key."_day".$id).'-'.$input_get->getString($key."_month".$id).'-'.$input_get->getString($key."_year".$id); + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_radio": + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_other_input".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $input_get->getString($key."_other_input".$id); + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + $element=$input_get->getString($key."_element".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $element; + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_checkbox": + + + + + + + + { + + + + + + + + + + + + + + + + $start=-1; + + + + + + + + for($j=0; $j<100; $j++) + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_element".$id.$j); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $start=$j; + + + + + + + + break; + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + $other_element_id=-1; + + + + + + + + $is_other=$input_get->getString($key."_allow_other".$id); + + + + + + + + if($is_other=="yes") + + + + + + + + { + + + + + + + + $other_element_id=$input_get->getString($key."_allow_other_num".$id); + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + if($start!=-1) + + + + + + + + { + + + + + + + + for($j=$start; $j<100; $j++) + + + + + + + + { + + + + + + + + + + + + + + + + $element=$input_get->getString($key."_element".$id.$j); + + + + + + + + if(isset($element)) + + + + + + + + if($j==$other_element_id) + + + + + + + + { + + + + + + + + $new_value = $new_value.$input_get->getString($key."_other_input".$id).'
'; + + + + + + + + } + + + + + + + + else + + + + + + + + + + + + + + + + $new_value = $new_value.$input_get->getString($key."_element".$id.$j).'
'; + + + + + + + + } + + + + + + + + + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + case "type_paypal_price": + + + + + + + + { + + + + + + + + $new_value=0; + + + + + + + + if($input_get->getString($key."_element_dollars".$id)) + + + + + + + + $new_value=$input_get->getString($key."_element_dollars".$id); + + + + + + + + + + + + + + + + if($input_get->getString($key."_element_cents".$id)) + + + + + + + + $new_value=$new_value.'.'.$input_get->getString($key."_element_cents".$id); + + + + + + + + + + + + + + + + $new_value=$new_value.$form_currency; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + break; + + + + + + + + + + + + + + + + } + + + + + + + + + + + + + + + + case "type_paypal_select": + + + + + + + + { + + + + + + + + $new_value=$input_get->getString($key."_element_label".$id).':'.$input_get->getString($key."_element".$id).$form_currency; + + + + + + + + $element_quantity_label=$input_get->getString($key."_element_quantity_label".$id); + + + + + + + + if(isset($element_quantity_label)) + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_quantity_label".$id).': '.$input_get->getString($key."_element_quantity".$id); + + + + + + + + + + + + + + + + for($k=0; $k<50; $k++) + + + + + + + + { + + + + + + + + $temp_val=$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + if(isset($temp_val)) + + + + + + + + { + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_property_label".$id.$k).': '.$input_get->getString($i."_element_property_value".$id.$k); + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + break; + + + + + + + + + + + + + + + + } + + + + + + + + + + + + + + + + case "type_paypal_radio": + + + + + + + + { + + + + + + + + + + + + + + + + $new_value=$input_get->getString($key."_element_label".$id).' - '.$input_get->getString($key."_element".$id).$form_currency; + + + + + + + + + + + + + + + + $element_quantity_label=$input_get->getString($key."_element_quantity_label".$id); + + + + + + + + if(isset($element_quantity_label)) + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_quantity_label".$id).': '.$input_get->getString($key."_element_quantity".$id); + + + + + + + + + + + + + + + + for($k=0; $k<50; $k++) + + + + + + + + { + + + + + + + + $temp_val=$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + if(isset($temp_val)) + + + + + + + + { + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_property_label".$id.$k).': '.$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_paypal_shipping": + + + + + + + + { + + + + + + + + + + + + + + + + $new_value=$input_get->getString($key."_element_label".$id).' : '.$input_get->getString($key."_element".$id).$form_currency; + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_paypal_checkbox": + + + + + + + + { + + + + + + + + $start=-1; + + + + + + + + for($j=0; $j<100; $j++) + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_element".$id.$j); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $start=$j; + + + + + + + + break; + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + if($start!=-1) + + + + + + + + { + + + + + + + + for($j=$start; $j<100; $j++) + + + + + + + + { + + + + + + + + + + + + + + + + $element=$input_get->getString($key."_element".$id.$j); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value=$new_value.$input_get->getString($key."_element".$id.$j."_label").' - '.($input_get->getString($key."_element".$id.$j)=='' ? '0'.$form_currency : $input_get->getString($key."_element".$id.$j)).$form_currency.'
'; + + + + + + + + } + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + $element_quantity_label=$input_get->getString($key."_element_quantity_label".$id); + + + + + + + + if(isset($element_quantity_label)) + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_quantity_label".$id).': '.$input_get->getString($key."_element_quantity".$id); + + + + + + + + + + + + + + + + for($k=0; $k<50; $k++) + + + + + + + + { + + + + + + + + $temp_val=$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + if(isset($temp_val)) + + + + + + + + { + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_property_label".$id.$k).': '.$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + case "type_paypal_total": + + + + { + + + + + + $element=$input_get->getString($key."_paypal_total".$id); + + + + + + $new_value=$new_value.$element; + + + + + + + + break; + + + + } + + + + case "type_star_rating": + + { + + $element=$input_get->getString($key."_star_amount".$id); + + $selected=$input_get->getString($key."_selected_star_amount".$id,0); + + //$star_color=$input_get->getString($key."_star_color_id_temp"); + + + + if(isset($element)) + + { + + $new_value=$new_value.$selected.'/'.$element; + + } + + break; + + } + + + + + + case "type_scale_rating": + + { + + $element=$input_get->getString($key."_scale_amount".$id); + + $selected=$input_get->getString($key."_scale_radio".$id,0); + + + + + + if(isset($element)) + + { + + $new_value=$new_value.$selected.'/'.$element; + + } + + break; + + } + + + + case "type_spinner": + + { + + + + $element=$input_get->getString($key."_element".$id); + + if(isset($element)) + + { + + $new_value=$new_value.$element; + + } + + break; + + } + + + + case "type_slider": + + { + + + + $element=$input_get->getString($key."_slider_value".$id); + + if(isset($element)) + + { + + $new_value=$new_value.$element; + + } + + break; + + } + + case "type_range": + + { + + + + $element0=$input_get->getString($key."_element".$id.'0'); + + $element1=$input_get->getString($key."_element".$id.'1'); + + if(isset($element0) || isset($element1)) + + { + + $new_value=$new_value.$element0.'-'.$element1; + + } + + break; + + } + + + + case "type_grading": + + { + + $element=$input_get->getString($key."_hidden_item".$id); + + $grading = explode(":",$element); + + $items_count = sizeof($grading)-1; + + + + $element = ""; + + $total = ""; + + + + for($k=0;$k<$items_count;$k++) + + + + { + + $element .= $grading[$k].":".$input_get->getString($key."_element".$id.$k)." "; + + $total += $input_get->getString($key."_element".$id.$k); + + } + + + + $element .="Total:".$total; + + + + + + if(isset($element)) + + { + + $new_value=$new_value.$element; + + } + + break; + + } + + + + case "type_matrix": + + { + + + + + + $input_type=$input_get->getString($key."_input_type".$id); + + + + $mat_rows = $input_get->getString($key."_hidden_row".$id); + + $mat_rows = explode('***', $mat_rows); + + $mat_rows = array_slice($mat_rows,0, count($mat_rows)-1); + + + + $mat_columns = $input_get->getString($key."_hidden_column".$id); + + $mat_columns = explode('***', $mat_columns); + + $mat_columns = array_slice($mat_columns,0, count($mat_columns)-1); + + + + $row_ids=explode(",",substr($input_get->getString($key."_row_ids".$id), 0, -1)); + + $column_ids=explode(",",substr($input_get->getString($key."_column_ids".$id), 0, -1)); + + + + + + $matrix=""; + + + + $matrix .=''; + + + + for( $k=0;$k< count($mat_columns) ;$k++) + + $matrix .=''; + + $matrix .=''; + + + + $aaa=Array(); + + $k=0; + + foreach( $row_ids as $row_id){ + + $matrix .=''; + + + + if($input_type=="radio"){ + + + + $mat_radio = $input_get->getString($key."_input_element".$id.$row_id,0); + + if($mat_radio==0){ + + $checked=""; + + $aaa[1]=""; + + } + + else{ + + $aaa=explode("_",$mat_radio); + + } + + + + foreach( $column_ids as $column_id){ + + if($aaa[1]==$column_id) + + $checked="checked"; + + else + + $checked=""; + + $matrix .=''; + + + + } + + + + } + + else{ + + if($input_type=="checkbox") + + { + + foreach( $column_ids as $column_id){ + + $checked = $input_get->getString($key."_input_element".$id.$row_id.'_'.$column_id); + + if($checked==1) + + $checked = "checked"; + + else + + $checked = ""; + + + + $matrix .=''; + + + + } + + + + } + + else + + { + + if($input_type=="text") + + { + + + + foreach( $column_ids as $column_id){ + + $checked = $input_get->getString($key."_input_element".$id.$row_id.'_'.$column_id); + + + + $matrix .=''; + + + + } + + + + } + + else{ + + foreach( $column_ids as $column_id){ + + $checked = $input_get->getString($key."_select_yes_no".$id.$row_id.'_'.$column_id); + + $matrix .=''; + + + + + + + + } + + } + + + + } + + + + } + + $matrix .=''; + + $k++; + + } + + $matrix .='
'.$mat_columns[$k].'
'.$mat_rows[$k].''.$checked.'
'; + + + + + + + + + + + + if(isset($matrix)) + + { + + $new_value=$new_value.$matrix; + + } + + + + break; + + } + + + + + + + + + + + + + + + + + + + + default: break; + + + + + + + + } + + + + + + + + + + + + + + + + $new_script = str_replace("%".$label_each."%", $new_value, $new_script); + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + if(strpos($new_script, "%ip%")>-1) + + $new_script = str_replace("%ip%", $ip, $new_script); + + + + if(strpos($new_script, "%all%")!=-1) + + + + + + + + $new_script = str_replace("%all%", $list, $new_script); + + + + + + + + + + + + + + + + $body = $new_script; + + + + $mode = 1; + + + + $send=$this->sendMail($from, $fromname, $recipient, $subject, $body, $mode, $cca, $bcc, $attachment, $replyto, $replytoname); + + } + + } + + } + + else + + { + + if($row->mail) + + { + + + + $from = $site_mailfrom; + + $fromname = $site_fromname; + + $recipient = $row->mail; + + $subject = $row->title; + + $new_script = $row->script_mail; + + + + + + + + foreach($label_order_original as $key => $label_each) + + + + + + + + { + + + + + + + + if(strpos($row->script_mail, "%".$label_each."%")!=-1) + + + + + + + + { + + + + + + + + $type = $input_get->getString($key."_type".$id); + + + + + + + + if($type!="type_submit_reset" or $type!="type_map" or $type!="type_editor" or $type!="type_captcha" or $type!="type_recaptcha" or $type!="type_button") + + + + + + + + { + + + + + + + + $new_value =""; + + + + + + + + switch ($type) + + + + + + + + { + + + + + + + + case 'type_text': + + + + + + + + case 'type_password': + + + + + + + + case 'type_textarea': + + + + + + + + case "type_date": + + + + + + + + case "type_own_select": + + + + + + + + case "type_country": + + + + + + + + case "type_number": + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_element".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $element; + + + + + + + + } + + + + + + + + break; + + + + + + + + + + + + + + + + + + + + + + + + } + + + + + + + + + + + + + + + + case "type_hidden": + + + + + + + + { + + + + + + + + $element=$input_get->getString($element_label); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $element; + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + case "type_mark_map": + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_long".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = 'Longitude:'.$input_get->getString($key."_long".$id).'
Latitude:'.$input_get->getString($key."_lat".$id); + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_submitter_mail": + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_element".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $element; + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_time": + + + + + + + + { + + + + + + + + + + + + + + + + $hh=$input_get->getString($key."_hh".$id); + + + + + + + + if(isset($hh)) + + + + + + + + { + + + + + + + + $ss=$input_get->getString($key."_ss".$id); + + + + + + + + if(isset($ss)) + + + + + + + + $new_value = $input_get->getString($key."_hh".$id).':'.$input_get->getString($key."_mm".$id).':'.$input_get->getString($key."_ss".$id); + + + + + + + + else + + + + + + + + $new_value = $input_get->getString($key."_hh".$id).':'.$input_get->getString($key."_mm".$id); + + + + + + + + $am_pm=$input_get->getString($key."_am_pm".$id); + + + + + + + + if(isset($am_pm)) + + + + + + + + $new_value=$new_value.' '.$input_get->getString($key."_am_pm".$id); + + + + + + + + + + + + + + + + } + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_phone": + + + + + + + + { + + + + + + + + $element_first=$input_get->getString($key."_element_first".$id); + + + + + + + + if(isset($element_first)) + + + + + + + + { + + + + + + + + $new_value = $input_get->getString($key."_element_first".$id).' '.$input_get->getString($key."_element_last".$id); + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_name": + + + + + + + + { + + + + + + + + $element_first=$input_get->getString($key."_element_first".$id); + + + + + + + + if(isset($element_first)) + + + + + + + + { + + + + + + + + $element_title=$input_get->getString($key."_element_title".$id); + + + + + + + + if(isset($element_title)) + + + + + + + + $new_value = $input_get->getString($key."_element_title".$id).' '.$input_get->getString($key."_element_first".$id).' '.$input_get->getString($i."_element_last".$id).' '.$input_get->getString($i."_element_middle".$id); + + + + + + + + else + + + + + + + + $new_value = $input_get->getString($key."_element_first".$id).' '.$input_get->getString($key."_element_last".$id); + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_address": + + { + + $street1=$input_get->getString($key."_street1".$id); + + + + if(isset($street1)) + + + + { + + + + $new_value=$input_get->getString($key."_street1".$id); + + + + break; + + + + } + + + + $street2=$input_get->getString($key."_street2".$id); + + + + if(isset($street2)) + + + + { + + + + $new_value=$input_get->getString($key."_street2".$id); + + + + break; + + + + } + + + + $city=$input_get->getString($key."_city".$id); + + + + if(isset($city)) + + + + { + + + + $new_value=$input_get->getString($key."_city".$id); + + + + break; + + + + } + + + + $state=$input_get->getString($key."_state".$id); + + + + if(isset($state)) + + + + { + + + + $new_value=$input_get->getString($key."_state".$id); + + + + break; + + + + } + + + + $postal=$input_get->getString($key."_postal".$id); + + + + if(isset($postal)) + + + + { + + + + $new_value=$input_get->getString($key."_postal".$id); + + + + break; + + } + + + + + + $country = $input_get->getString($key."_country".$id); + + + + if(isset($country)) + + { + + + + $new_value=$input_get->getString($key."_country".$id); + + + + break; + + } + + + + + + break; + + + + } + + + + + + + + + + + + case "type_date_fields": + + + + + + + + { + + + + + + + + $day=$input_get->getString($key."_day".$id); + + + + + + + + if(isset($day)) + + + + + + + + { + + + + + + + + $new_value = $input_get->getString($key."_day".$id).'-'.$input_get->getString($key."_month".$id).'-'.$input_get->getString($key."_year".$id); + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_radio": + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_other_input".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $input_get->getString($key."_other_input".$id); + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + $element=$input_get->getString($key."_element".$id); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value = $element; + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_checkbox": + + + + + + + + { + + + + + + + + + + + + + + + + $start=-1; + + + + + + + + for($j=0; $j<100; $j++) + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_element".$id.$j); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $start=$j; + + + + + + + + break; + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + $other_element_id=-1; + + + + + + + + $is_other=$input_get->getString($key."_allow_other".$id); + + + + + + + + if($is_other=="yes") + + + + + + + + { + + + + + + + + $other_element_id=$input_get->getString($key."_allow_other_num".$id); + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + if($start!=-1) + + + + + + + + { + + + + + + + + for($j=$start; $j<100; $j++) + + + + + + + + { + + + + + + + + + + + + + + + + $element=$input_get->getString($key."_element".$id.$j); + + + + + + + + if(isset($element)) + + + + + + + + if($j==$other_element_id) + + + + + + + + { + + + + + + + + $new_value = $new_value.$input_get->getString($key."_other_input".$id).'
'; + + + + + + + + } + + + + + + + + else + + + + + + + + + + + + + + + + $new_value = $new_value.$input_get->getString($key."_element".$id.$j).'
'; + + + + + + + + } + + + + + + + + + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_paypal_price": + + + + + + + + { + + + + + + + + $new_value=0; + + + + + + + + if($input_get->getString($key."_element_dollars".$id)) + + + + + + + + $new_value=$input_get->getString($key."_element_dollars".$id); + + + + + + + + + + + + + + + + if($input_get->getString($key."_element_cents".$id)) + + + + + + + + $new_value=$new_value.'.'.$input_get->getString($key."_element_cents".$id); + + + + + + + + + + + + + + + + $new_value=$new_value.$form_currency; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_paypal_select": + + + + + + + + { + + + + + + + + + + + + + + + + $new_value=$input_get->getString($key."_element_label".$id).':'.$input_get->getString($key."_element".$id).$form_currency; + + + + + + + + $element_quantity_label=$input_get->getString($key."_element_quantity_label".$id); + + + + + + + + if(isset($element_quantity_label)) + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_quantity_label".$id).': '.$input_get->getString($key."_element_quantity".$id); + + + + + + + + + + + + + + + + for($k=0; $k<50; $k++) + + + + + + + + { + + + + + + + + $temp_val=$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + if(isset($temp_val)) + + + + + + + + { + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_property_label".$id.$k).': '.$input_get->getString($i."_element_property_value".$id.$k); + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_paypal_radio": + + + + + + + + { + + + + + + + + + + + + + + + + $new_value=$input_get->getString($key."_element_label".$id).' - '.$input_get->getString($key."_element".$id).$form_currency; + + + + + + + + + + + + + + + + $element_quantity_label=$input_get->getString($key."_element_quantity_label".$id); + + + + + + + + if(isset($element_quantity_label)) + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_quantity_label".$id).': '.$input_get->getString($key."_element_quantity".$id); + + + + + + + + + + + + + + + + for($k=0; $k<50; $k++) + + + + + + + + { + + + + + + + + $temp_val=$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + if(isset($temp_val)) + + + + + + + + { + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_property_label".$id.$k).': '.$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + } + + + + + + + + } + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_paypal_shipping": + + + + + + + + { + + + + + + + + + + + + + + + + $new_value=$input_get->getString($i."_element_label".$id).' : '.$input_get->getString($i."_element".$id).$form_currency; + + + + + + + + + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + + + + + + + + + + + + + case "type_paypal_checkbox": + + + + + + + + { + + + + + + + + $start=-1; + + + + + + + + for($j=0; $j<100; $j++) + + + + + + + + { + + + + + + + + $element=$input_get->getString($key."_element".$id.$j); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $start=$j; + + + + + + + + break; + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + if($start!=-1) + + + + + + + + { + + + + + + + + for($j=$start; $j<100; $j++) + + + + + + + + { + + + + + + + + + + + + + + + + $element=$input_get->getString($key."_element".$id.$j); + + + + + + + + if(isset($element)) + + + + + + + + { + + + + + + + + $new_value=$new_value.$input_get->getString($key."_element".$id.$j."_label").' - '.($input_get->getString($key."_element".$id.$j)=='' ? '0'.$form_currency : $input_get->getString($key."_element".$id.$j)).$form_currency.'
'; + + + + + + + + } + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + $element_quantity_label=$input_get->getString($key."_element_quantity_label".$id); + + + + + + + + if(isset($element_quantity_label)) + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_quantity_label".$id).': '.$input_get->getString($key."_element_quantity".$id); + + + + + + + + + + + + + + + + for($k=0; $k<50; $k++) + + + + + + + + { + + + + + + + + $temp_val=$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + if(isset($temp_val)) + + + + + + + + { + + + + + + + + $new_value.='
'.$input_get->getString($key."_element_property_label".$id.$k).': '.$input_get->getString($key."_element_property_value".$id.$k); + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + + + + + break; + + + + + + + + } + + + + case "type_paypal_total": + + + + { + + + + + + $element=$input_get->getString($key."_paypal_total".$id); + + + + + + $new_value=$new_value.$element; + + + + + + + + break; + + + + } + + + + case "type_star_rating": + + { + + $element=$input_get->getString($key."_star_amount".$id); + + $selected=$input_get->getString($key."_selected_star_amount".$id,0); + + //$star_color=$input_get->getString($key."_star_color_id_temp"); + + + + if(isset($element)) + + { + + $new_value=$new_value.$selected.'/'.$element; + + } + + break; + + } + + + + + + case "type_scale_rating": + + { + + $element=$input_get->getString($key."_scale_amount".$id); + + $selected=$input_get->getString($key."_scale_radio".$id,0); + + + + + + if(isset($element)) + + { + + $new_value=$new_value.$selected.'/'.$element; + + } + + break; + + } + + + + case "type_spinner": + + { + + + + $element=$input_get->getString($key."_element".$id); + + if(isset($element)) + + { + + $new_value=$new_value.$element; + + } + + break; + + } + + + + case "type_slider": + + { + + + + $element=$input_get->getString($key."_slider_value".$id); + + if(isset($element)) + + { + + $new_value=$new_value.$element; + + } + + break; + + } + + case "type_range": + + { + + + + $element0=$input_get->getString($key."_element".$id.'0'); + + $element1=$input_get->getString($key."_element".$id.'1'); + + if(isset($element0) || isset($element1)) + + { + + $new_value=$new_value.$element0.'-'.$element1; + + } + + break; + + } + + + + case "type_grading": + + { + + $element=$input_get->getString($key."_hidden_item".$id); + + $grading = explode(":",$element); + + $items_count = sizeof($grading)-1; + + + + $element = ""; + + $total = ""; + + + + for($k=0;$k<$items_count;$k++) + + + + { + + $element .= $grading[$k].":".$input_get->getString($key."_element".$id.$k)." "; + + $total += $input_get->getString($key."_element".$id.$k); + + } + + + + $element .="Total:".$total; + + + + + + if(isset($element)) + + { + + $new_value=$new_value.$element; + + } + + break; + + } + + + + case "type_matrix": + + { + + + + + + $input_type=$input_get->getString($key."_input_type".$id); + + + + $mat_rows = $input_get->getString($key."_hidden_row".$id); + + $mat_rows = explode('***', $mat_rows); + + $mat_rows = array_slice($mat_rows,0, count($mat_rows)-1); + + + + $mat_columns = $input_get->getString($key."_hidden_column".$id); + + $mat_columns = explode('***', $mat_columns); + + $mat_columns = array_slice($mat_columns,0, count($mat_columns)-1); + + + + $row_ids=explode(",",substr($input_get->getString($key."_row_ids".$id), 0, -1)); + + $column_ids=explode(",",substr($input_get->getString($key."_column_ids".$id), 0, -1)); + + + + + + $matrix=""; + + + + $matrix .=''; + + + + for( $k=0;$k< count($mat_columns) ;$k++) + + $matrix .=''; + + $matrix .=''; + + + + $aaa=Array(); + + $k=0; + + foreach($row_ids as $row_id) + + { + + $matrix .=''; + + + + if($input_type=="radio"){ + + + + $mat_radio = $input_get->getString($key."_input_element".$id.$row_id,0); + + if($mat_radio==0){ + + $checked=""; + + $aaa[1]=""; + + } + + else{ + + $aaa=explode("_",$mat_radio); + + } + + + + foreach($column_ids as $column_id){ + + if($aaa[1]==$column_id) + + $checked="checked"; + + else + + $checked=""; + + $matrix .=''; + + + + } + + + + } + + else{ + + if($input_type=="checkbox") + + { + + foreach($column_ids as $column_id){ + + $checked = $input_get->getString($key."_input_element".$id.$row_id.'_'.$column_id); + + if($checked==1) + + $checked = "checked"; + + else + + $checked = ""; + + + + $matrix .=''; + + + + } + + + + } + + else + + { + + if($input_type=="text") + + { + + + + foreach($column_ids as $column_id){ + + $checked = $input_get->getString($key."_input_element".$id.$row_id.'_'.$column_id); + + + + $matrix .=''; + + + + } + + + + } + + else{ + + foreach($column_ids as $column_id){ + + $checked = $input_get->getString($i."_select_yes_no".$id.$row_id.'_'.$column_id); + + $matrix .=''; + + + + + + + + } + + } + + + + } + + + + } + + $matrix .=''; + + $k++; + + } + + $matrix .='
'.$mat_columns[$k].'
'.$mat_rows[$k].''.$checked.'
'; + + + + + + + + + + + + if(isset($matrix)) + + { + + $new_value=$new_value.$matrix; + + } + + + + break; + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + default: break; + + + + + + + + } + + + + + + + + + + + + + + + + $new_script = str_replace("%".$label_each."%", $new_value, $new_script); + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + + + + + + + } + + + + + + + + + + + + if(strpos($new_script, "%ip%")>-1) + + $new_script = str_replace("%ip%", $ip, $new_script); + + + + if(strpos($new_script, "%all%")!=-1) + + + + + + + + $new_script = str_replace("%all%", $list, $new_script); + + + + + + + + + + + + + + + + $body = $new_script; + + + + $mode = 1; + + + + $send=$this->sendMail($from, $fromname, $recipient, $subject, $body, $mode, $cca, $bcc, $attachment, $replyto, $replytoname); + + } + + } + + + + $succes=1; + + if($row->mail) + + { + + if ( $send !== true ) + + { + + $msg=JText::_('WDF_MAIL_SEND_ERROR'); + + $succes = 0; + + } + + else + + $msg=JText::_('WDF_MAIL_SENT'); + + } + + else + + $msg=JText::_('WDF_SUBMITTED'); + + + + } + + + + + + switch($row->submit_text_type) + + { + + case "2": + + { + + $redirect_url=JUri::root()."index.php?option=com_content&view=article&id=".$row->article_id."&Itemid=".$Itemid; + + //$mainframe->redirect("index.php?option=com_content&view=article&id=".$row->article_id."&Itemid=".$Itemid, $msg); + + break; + + } + + case "3": + + { + + $_SESSION['show_submit_text'.$id]=1; + + $redirect_url=$_SERVER["HTTP_REFERER"]; + + //$mainframe->redirect($_SERVER["REQUEST_URI"], $msg); + + break; + + } + + case "4": + + { + + $redirect_url=$row->url; + + //$mainframe->redirect($row->url, $msg); + + break; + + } + + default: + + { + + $redirect_url=$_SERVER["HTTP_REFERER"]; + + //$mainframe->redirect($_SERVER["REQUEST_URI"], $msg); + + break; + + } + + } + + + + if(!$str) + + { + + if($msg == JText::_('WDF_SUBMITTED') || $msg == JText::_('WDF_MAIL_SENT')) + + $mainframe->redirect($redirect_url, $msg, 'message'); + + else + + $mainframe->redirect($redirect_url, $msg, 'error'); + + } + + else + + + + + + + + { + + + + + + + + $str.="&return=".urlencode($redirect_url); + + + + + + + + $mainframe->redirect($str); + + + + + + + + + + + + + + + + } + + + + } + + protected function custom_fields_mail($type, $key, $id) + { + $input_get = JFactory::getApplication()->input; + + $disabled_fields = explode(',',$input_get->getString("disabled_fields".$id)); + $disabled_fields = array_slice($disabled_fields,0, count($disabled_fields)-1); + + if($type!="type_submit_reset" or $type!="type_map" or $type!="type_editor" or $type!="type_captcha" or $type!="type_recaptcha" or $type!="type_button") + { + $new_value =""; + if(!in_array($key,$disabled_fields)) + switch ($type) + { + case 'type_text': + case 'type_password': + case 'type_textarea': + case "type_date": + case "type_own_select": + case "type_country": + case "type_number": + { + $element=$input_get->getString('wdform_'.$key."_element".$id); + if(isset($element)) + { + $new_value = $element; + } + break; + + + } + case "type_wdeditor": + { + + $element = $input_get->getString( 'wdform_'.$key.'_wd_editor'.$id, '', 'post', 'string', JREQUEST_ALLOWRAW ); + + if(isset($element)) + { + $new_value = $element; + } + + break; + + } + case "type_hidden": + { + $element=$input_get->getString($element_label); + if(isset($element)) + { + $new_value = $element; + } + break; + } + + + case "type_mark_map": + { + $element=$input_get->getString('wdform_'.$key."_long".$id); + if(isset($element)) + { + $new_value = 'Longitude:'.$input_get->getString('wdform_'.$key."_long".$id).'
Latitude:'.$input_get->getString('wdform_'.$key."_lat".$id); + } + break; + } + + case "type_submitter_mail": + { + $element=$input_get->getString('wdform_'.$key."_element".$id); + if(isset($element)) + { + $new_value = $element; + } + break; + } + + case "type_time": + { + + $hh=$input_get->getString('wdform_'.$key."_hh".$id); + if(isset($hh)) + { + $ss=$input_get->getString('wdform_'.$key."_ss".$id); + if(isset($ss)) + $new_value = $input_get->getString('wdform_'.$key."_hh".$id).':'.$input_get->getString('wdform_'.$key."_mm".$id).':'.$input_get->getString('wdform_'.$key."_ss".$id); + else + $new_value = $input_get->getString('wdform_'.$key."_hh".$id).':'.$input_get->getString('wdform_'.$key."_mm".$id); + $am_pm=$input_get->getString('wdform_'.$key."_am_pm".$id); + if(isset($am_pm)) + $new_value=$new_value.' '.$input_get->getString('wdform_'.$key."_am_pm".$id); + + } + + break; + } + + case "type_phone": + { + $element_first=$input_get->getString('wdform_'.$key."_element_first".$id); + if(isset($element_first)) + { + $new_value = $input_get->getString('wdform_'.$key."_element_first".$id).' '.$input_get->getString('wdform_'.$key."_element_last".$id); + } + break; + } + + case "type_name": + { + $element_first=$input_get->getString('wdform_'.$key."_element_first".$id); + if(isset($element_first)) + { + $element_title=$input_get->getString('wdform_'.$key."_element_title".$id); + if(isset($element_title)) + $new_value = $input_get->getString('wdform_'.$key."_element_title".$id).' '.$input_get->getString('wdform_'.$key."_element_first".$id).' '.$input_get->getString('wdform_'.$key."_element_last".$id).' '.$input_get->getString('wdform_'.$key."_element_middle".$id); + else + $new_value = $input_get->getString('wdform_'.$key."_element_first".$id).' '.$input_get->getString('wdform_'.$key."_element_last".$id); + } + break; + } + + case "type_address": + { + + $street1=$input_get->getString('wdform_'.$key."_street1".$id); + + if(isset($street1)) + + { + + $new_value=$input_get->getString('wdform_'.$key."_street1".$id); + + break; + + } + + $street2=$input_get->getString('wdform_'.$key."_street2".$id); + + if(isset($street2)) + + { + + $new_value=$input_get->getString('wdform_'.$key."_street2".$id); + + break; + + } + + $city=$input_get->getString('wdform_'.$key."_city".$id); + + if(isset($city)) + + { + + $new_value=$input_get->getString('wdform_'.$key."_city".$id); + + break; + + } + + $state=$input_get->getString('wdform_'.$key."_state".$id); + + if(isset($state)) + + { + + $new_value=$input_get->getString('wdform_'.$key."_state".$id); + + break; + + } + + $postal=$input_get->getString('wdform_'.$key."_postal".$id); + + if(isset($postal)) + + { + + $new_value=$input_get->getString('wdform_'.$key."_postal".$id); + + break; + + } + + + $country = $input_get->getString('wdform_'.$key."_country".$id); + + if(isset($country)) + { + + $new_value=$input_get->getString('wdform_'.$key."_country".$id); + + break; + } + + + break; + + } + + case "type_date_fields": + { + $day=$input_get->getString('wdform_'.$key."_day".$id); + if(isset($day)) + { + $new_value = $input_get->getString('wdform_'.$key."_day".$id).'-'.$input_get->getString('wdform_'.$key."_month".$id).'-'.$input_get->getString('wdform_'.$key."_year".$id); + } + break; + } + + case "type_radio": + { + $element=$input_get->getString('wdform_'.$key."_other_input".$id); + if(isset($element)) + { + $new_value = $input_get->getString('wdform_'.$key."_other_input".$id); + break; + } + + $element=$input_get->getString('wdform_'.$key."_element".$id); + if(isset($element)) + { + $new_value = $element; + } + break; + } + + case "type_checkbox": + { + + $start=-1; + for($j=0; $j<100; $j++) + { + $element=$input_get->getString('wdform_'.$key."_element".$id.$j); + if(isset($element)) + { + $start=$j; + break; + } + } + + $other_element_id=-1; + $is_other=$input_get->getString('wdform_'.$key."_allow_other".$id); + if($is_other=="yes") + { + $other_element_id=$input_get->getString('wdform_'.$key."_allow_other_num".$id); + } + + + if($start!=-1) + { + for($j=$start; $j<100; $j++) + { + + $element=$input_get->getString('wdform_'.$key."_element".$id.$j); + if(isset($element)) + if($j==$other_element_id) + { + $new_value = $new_value.$input_get->getString('wdform_'.$key."_other_input".$id).'
'; + } + else + + $new_value = $new_value.$input_get->getString('wdform_'.$key."_element".$id.$j).'
'; + } + + } + break; + } + case "type_paypal_price": + { + $new_value=0; + if($input_get->getString('wdform_'.$key."_element_dollars".$id)) + $new_value=$input_get->getString('wdform_'.$key."_element_dollars".$id); + + if($input_get->getString('wdform_'.$key."_element_cents".$id)) + $new_value=$new_value.'.'.$input_get->getString('wdform_'.$key."_element_cents".$id); + + $new_value=$new_value.$form_currency; + + + + + break; + + } + + case "type_paypal_select": + { + $new_value=$input_get->getString('wdform_'.$key."_element_label".$id).':'.$input_get->getString('wdform_'.$key."_element".$id).$form_currency; + $element_quantity_label=$input_get->getString('wdform_'.$key."_element_quantity_label".$id); + if(isset($element_quantity_label)) + $new_value.='
'.$input_get->getString('wdform_'.$key."_element_quantity_label".$id).': '.$input_get->getString('wdform_'.$key."_element_quantity".$id); + + for($k=0; $k<50; $k++) + { + $temp_val=$input_get->getString('wdform_'.$key."_element_property_value".$id.$k); + if(isset($temp_val)) + { + $new_value.='
'.$input_get->getString('wdform_'.$key."_element_property_label".$id.$k).': '.$input_get->getString($i."_element_property_value".$id.$k); + } + } + + break; + + } + + case "type_paypal_radio": + { + + $new_value=$input_get->getString('wdform_'.$key."_element_label".$id).' - '.$input_get->getString('wdform_'.$key."_element".$id).$form_currency; + + $element_quantity_label=$input_get->getString('wdform_'.$key."_element_quantity_label".$id); + if(isset($element_quantity_label)) + $new_value.='
'.$input_get->getString('wdform_'.$key."_element_quantity_label".$id).': '.$input_get->getString('wdform_'.$key."_element_quantity".$id); + + for($k=0; $k<50; $k++) + { + $temp_val=$input_get->getString('wdform_'.$key."_element_property_value".$id.$k); + if(isset($temp_val)) + { + $new_value.='
'.$input_get->getString('wdform_'.$key."_element_property_label".$id.$k).': '.$input_get->getString('wdform_'.$key."_element_property_value".$id.$k); + } + } + + break; + } + + case "type_paypal_shipping": + { + + $new_value=$input_get->getString('wdform_'.$key."_element_label".$id).' : '.$input_get->getString('wdform_'.$key."_element".$id).$form_currency; + + break; + } + + case "type_paypal_checkbox": + { + $start=-1; + for($j=0; $j<100; $j++) + { + $element=$input_get->getString('wdform_'.$key."_element".$id.$j); + if(isset($element)) + { + $start=$j; + break; + } + } + + if($start!=-1) + { + for($j=$start; $j<100; $j++) + { + + $element=$input_get->getString('wdform_'.$key."_element".$id.$j); + if(isset($element)) + { + $new_value=$new_value.$input_get->getString('wdform_'.$key."_element".$id.$j."_label").' - '.($input_get->getString('wdform_'.$key."_element".$id.$j)=='' ? '0'.$form_currency : $input_get->getString('wdform_'.$key."_element".$id.$j)).$form_currency.'
'; + } + } + } + + $element_quantity_label=$input_get->getString('wdform_'.$key."_element_quantity_label".$id); + if(isset($element_quantity_label)) + $new_value.='
'.$input_get->getString('wdform_'.$key."_element_quantity_label".$id).': '.$input_get->getString('wdform_'.$key."_element_quantity".$id); + + for($k=0; $k<50; $k++) + { + $temp_val=$input_get->getString('wdform_'.$key."_element_property_value".$id.$k); + if(isset($temp_val)) + { + $new_value.='
'.$input_get->getString('wdform_'.$key."_element_property_label".$id.$k).': '.$input_get->getString('wdform_'.$key."_element_property_value".$id.$k); + } + } + + + break; + } + + case "type_paypal_total": + + { + + + $element=$input_get->getString('wdform_'.$key."_paypal_total".$id); + + + $new_value=$new_value.$element; + + + + break; + + } + + case "type_star_rating": + { + $element=$input_get->getString('wdform_'.$key."_star_amount".$id); + $selected=$input_get->getString('wdform_'.$key."_selected_star_amount".$id,0); + //$star_color=$input_get->getString($key."_star_color_id_temp"); + + if(isset($element)) + { + $new_value=$new_value.$selected.'/'.$element; + } + break; + } + + + case "type_scale_rating": + { + $element=$input_get->getString('wdform_'.$key."_scale_amount".$id); + $selected=$input_get->getString('wdform_'.$key."_scale_radio".$id,0); + + + if(isset($element)) + { + $new_value=$new_value.$selected.'/'.$element; + } + break; + } + + case "type_spinner": + { + + $element=$input_get->getString('wdform_'.$key."_element".$id); + if(isset($element)) + { + $new_value=$new_value.$element; + } + break; + } + + case "type_slider": + { + + $element=$input_get->getString('wdform_'.$key."_slider_value".$id); + if(isset($element)) + { + $new_value=$new_value.$element; + } + break; + } + case "type_range": + { + + $element0=$input_get->getString('wdform_'.$key."_element".$id.'0'); + $element1=$input_get->getString('wdform_'.$key."_element".$id.'1'); + if(isset($element0) || isset($element1)) + { + $new_value=$new_value.$element0.'-'.$element1; + } + break; + } + + case "type_grading": + { + $element=$input_get->getString('wdform_'.$key."_hidden_item".$id); + $grading = explode(":",$element); + $items_count = sizeof($grading)-1; + + $element = ""; + $total = ""; + + for($k=0;$k<$items_count;$k++) + + { + $element .= $grading[$k].":".$input_get->getString('wdform_'.$key."_element".$id.'_'.$k)." "; + $total += $input_get->getString('wdform_'.$key."_element".$id.'_'.$k); + } + + $element .="Total:".$total; + + + if(isset($element)) + { + $new_value=$new_value.$element; + } + break; + } + + case "type_matrix": + { + + $input_type=$input_get->getString('wdform_'.$key."_input_type".$id); + + $mat_rows=explode("***",$input_get->getString('wdform_'.$key."_hidden_row".$id)); + $rows_count= sizeof($mat_rows)-1; + $mat_columns=explode("***",$input_get->getString('wdform_'.$key."_hidden_column".$id)); + $columns_count= sizeof($mat_columns)-1; + + + $matrix=""; + + $matrix .=''; + + + + for( $k=1;$k< count($mat_columns) ;$k++) + $matrix .=''; + $matrix .=''; + + $aaa=Array(); + + for($k=1; $k<=$rows_count; $k++) + { + $matrix .=''; + + if($input_type=="radio") + { + + + $mat_radio = $input_get->getString('wdform_'.$key."_input_element".$id.$k,0); + if($mat_radio==0) + { + $checked=""; + $aaa[1]=""; + } + else + $aaa=explode("_",$mat_radio); + + + for($j=1; $j<=$columns_count; $j++) + { + if($aaa[1]==$j) + $checked="checked"; + else + $checked=""; + + $matrix .=''; + + } + + } + else + { + if($input_type=="checkbox") + { + for($j=1; $j<=$columns_count; $j++) + { + $checked = $input_get->getString('wdform_'.$key."_input_element".$id.$k.'_'.$j); + if($checked==1) + $checked = "checked"; + else + $checked = ""; + + $matrix .=''; + + } + + } + else + { + if($input_type=="text") + { + + for($j=1; $j<=$columns_count; $j++) + { + $checked = $input_get->getString('wdform_'.$key."_input_element".$id.$k.'_'.$j); + $matrix .=''; + + } + + } + else{ + for($j=1; $j<=$columns_count; $j++) + { + $checked = $input_get->getString('wdform_'.$key."_select_yes_no".$id.$k.'_'.$j); + $matrix .=''; + + + + } + } + + } + + } + $matrix .=''; + + } + $matrix .='
'.$mat_columns[$k].'
'.$mat_rows[$k].''.$checked.'
'; + + + + if(isset($matrix)) + { + $new_value=$new_value.$matrix; + } + + break; + } + + default: break; + } + + + } + + return $new_value; + } + + + + protected function sendMail(&$from, &$fromname, &$recipient, &$subject, &$body, &$mode=0, &$cc=null, &$bcc=null, &$attachment=null, &$replyto=null, &$replytoname=null) + + { + + $input_get = JFactory::getApplication()->input; + + $recipient=explode (',', str_replace(' ', '', $recipient )); + $cc=explode (',', str_replace(' ', '', $cc )); + $bcc=explode (',', str_replace(' ', '', $bcc )); + + // Get a JMail instance + + $mail = JFactory::getMailer(); + + + + $mail->setSender(array($from, $fromname)); + + $mail->setSubject($subject); + + $mail->setBody($body); + + + + // Are we sending the email as HTML? + + if ($mode) { + + $mail->IsHTML(true); + + } + + + + $mail->addRecipient($recipient); + + $mail->addCC($cc); + + $mail->addBCC($bcc); + + + + if($attachment) + + foreach($attachment as $attachment_temp) + + { + + $mail->AddEmbeddedImage($attachment_temp[0], $attachment_temp[1], $attachment_temp[2]); + + } + + + + // Take care of reply email addresses + + if (is_array($replyto)) { + + $numReplyTo = count($replyto); + + for ($i=0; $i < $numReplyTo; $i++){ + + $mail->addReplyTo(array($replyto[$i], $replytoname[$i])); + + } + + } elseif (isset($replyto)) { + + $mail->addReplyTo(array($replyto, $replytoname)); + + } + + + + return $mail->Send(); + + } + + + + protected function remove($group_id) + + { + + $input_get = JFactory::getApplication()->input; + + + + $db = JFactory::getDBO(); + + $db->setQuery('DELETE FROM #__formmaker_submits WHERE group_id="'.$db->escape($group_id).'"'); + + $db->query(); + + } + + + + + + protected function checkpaypal() + { + + $input_get = JFactory::getApplication()->input; + $File = "components/com_formmaker/models/request.txt"; + $Handle = fopen($File, 'w'); + + $id=$input_get->getString( 'form_id',0); + $group_id=$input_get->getString( 'group_id',0); + + $form = JTable::getInstance('formmaker', 'Table'); + $form->load( $id); + + + + if($form->checkout_mode=="production") + $paypal_action="https://www.paypal.com/cgi-bin/webscr"; + else + $paypal_action="https://www.sandbox.paypal.com/cgi-bin/webscr"; + + + $payment_status=$input_get->getString( 'payment_status',''); + + + $postdata=""; + + foreach (JRequest::get('post') as $key=>$value) + $postdata.=$key."=".urlencode($value)."&"; + + $postdata .= "cmd=_notify-validate"; + $curl = curl_init($paypal_action); + curl_setopt ($curl, CURLOPT_HEADER, 0); + curl_setopt ($curl, CURLOPT_POST, 1); + curl_setopt ($curl, CURLOPT_POSTFIELDS, $postdata); + curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt ($curl, CURLOPT_SSL_VERIFYHOST, 1); + $response = curl_exec ($curl); + curl_close ($curl); + + $option =$input_get->getString('option'); + $total =$input_get->getString( 'mc_gross'); + $tax_total =$input_get->getString( 'tax'); + $shipping_total =$input_get->getString( 'mc_shipping'); + + $refresh=0; + + $tax=0; + + $shipping=0; + + $total_cost=0; + + $total_count=0; + + + $form_currency='$'; + $currency_code=array('USD', 'EUR', 'GBP', 'JPY', 'CAD', 'MXN', 'HKD', 'HUF', 'NOK', 'NZD', 'SGD', 'SEK', 'PLN', 'AUD', 'DKK', 'CHF', 'CZK', 'ILS', 'BRL', 'TWD', 'MYR', 'PHP', 'THB'); + $currency_sign=array('$' , '€' , '£' , 'Â¥' , 'C$', 'Mex$', 'HK$', 'Ft' , 'kr' , 'NZ$', 'S$' , 'kr' , 'zÅ‚' , 'A$' , 'kr' , 'CHF' , 'KÄ', '₪' , 'R$' , 'NT$', 'RM' , '₱' , '฿' ); + + if($form->payment_currency) + $form_currency= $currency_sign[array_search($form->payment_currency, $currency_code)]; + + $tax=$form->tax; + $shipping=$input_get->getString( 'mc_shipping',0); + + $db = JFactory::getDBO(); + + $query = "UPDATE #__formmaker_submits SET `element_value`='".$db->escape($payment_status)."' WHERE group_id='".$db->escape($group_id)."' AND element_label='0'"; + fwrite($Handle, $query); + + $db->setQuery( $query); + $db->query(); + if($db->getErrorNum()){ echo $db->stderr(); return false;} + + + + $row = JTable::getInstance('sessions', 'Table'); + $query = "SELECT id FROM #__formmaker_sessions WHERE group_id=".$group_id; + $db->setQuery( $query); + $ses_id=$db->LoadResult(); + if($db->getErrorNum()){ echo $db->stderr(); return false;} + + if($ses_id) + $row->load( $ses_id); + $row->form_id=$id; $row->group_id=$group_id; + + $row->full_name=$input_get->getString( 'first_name','')." ".$input_get->getString( 'last_name',''); + + + + + $row->email=$input_get->getString( 'payer_email',''); + + $row->phone=$input_get->getString( 'night_ phone_a','')."-".$input_get->getString( 'night_ phone_b','')."-".$input_get->getString( 'night_ phone_c',''); + + $row->address="Country: ".$input_get->getString( 'address_country','')."
"; + if($input_get->getString( 'address_state','')!="") + $row->address.="State: ".$input_get->getString( 'address_state','')."
"; + if($input_get->getString( 'City','')!="") + $row->address.="City: ".$input_get->getString( 'address_city','')."
"; + if($input_get->getString( 'address_street','')!="") + $row->address.="Street: ".$input_get->getString( 'address_street','')."
"; + if($input_get->getString( 'address_zip','')!="") + $row->address.="Zip Code: ".$input_get->getString( 'address_zip','')."
"; + if($input_get->getString( 'address_zip','')!="") + $row->address.="Address Status: ".$input_get->getString( 'address_status','')."
"; + if($input_get->getString( 'address_name','')!="") + $row->address.="Name: ".$input_get->getString( 'address_name','').""; + $row->status =$input_get->getString( 'payment_status',''); + + + $row->ipn =$response; + $row->currency =$form->payment_currency.' - '.$form_currency; + + $row->paypal_info =""; + + + if($input_get->getString( 'payer_status','')!="") + $row->paypal_info .= "Payer Status -".$input_get->getString( 'payer_status','')."
"; + + if($input_get->getString( 'payer_email','')!="") + $row->paypal_info .= "Payer Email -".$input_get->getString( 'payer_email','')."
"; + + if($input_get->getString( 'txn_id','')!="") + $row->paypal_info .= "Transaction -".$input_get->getString( 'txn_id','')."
"; + + if($input_get->getString( 'payment_type','')!="") + $row->paypal_info .= "Payment Type -".$input_get->getString( 'payment_type','')."
"; + + if($input_get->getString( 'residence_country','')!="") + $row->paypal_info .= "Residence Country -".$input_get->getString( 'residence_country','')."
"; + + $row->ord_last_modified = date( 'Y-m-d H:i:s' ); + + $row->tax = $tax; + + $row->shipping = $shipping; + + $row->total = $total; + + if (!$row->store()) + { + + echo "\n"; + exit(); + } + + + + $list=' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Currency '.$row->currency.'
Date '.$row->ord_last_modified.'
Status '.$row->status.'
Full name '.$row->full_name.'
Email '.$row->email.'
Phone '.$row->phone.'
Mobile phone '.$row->mobile_phone.'
Fax '.$row->fax.'
Address '.$row->address.'
Paypal info '.$row->paypal_info.'
IPN '.$row->ipn.'
tax '.$row->tax.'%
shipping '.$row->shipping.'
Item total '.($total-$tax_total-$shipping_total).$form_currency.'
Tax '.$tax_total.$form_currency.'
Shipping and handling '.$shipping_total.$form_currency.'
Total '.$total.$form_currency.'
+'; + + + if($form->mail) + { + + + $config = JFactory::getConfig(); + if($form->mail_from) + $site_mailfrom = $form->mail_from; + else + $site_mailfrom=$config->get( 'config.mailfrom' ); + + if($form->mail_from_name) + $site_fromname = $form->mail_from_name; + else + $site_fromname=$config->get( 'config.fromname' ); + + + $from = $site_mailfrom; + $fromname = $site_fromname; + + $recipient = $form->mail; + $subject = "Payment information"; + $body = $list; + $mode = 1; + + $send=$this->sendMail($from, $fromname, $recipient, $subject, $body, $mode, $cca, $bcc, $attachment, $replyto, $replytoname); + + } + + + fwrite($Handle, $req); + fclose($Handle); + + return 0; + + } + + + + + + + protected function defaultphp($row, $Itemid, $label_id,$label_type, $form_theme, $id, $ok) + + { + + ob_start(); + + static $embedded; + + if(!$embedded) + + { + + $embedded=true; + + } + + ?> + + + +input; + + + +@session_start(); + +$mainframe = JFactory::getApplication(); + + + +$old = false; + + + +if(isset($_SESSION['redirect_paypal'.$id])) + + if($_SESSION['redirect_paypal'.$id]==1) + + { + + $_SESSION['redirect_paypal'.$id]=0; + + $succes=$input_get->getString('succes'); + + if(isset($succes)) + + if($succes==0) + + { + + JError::raiseWarning( 100, JText::_('WDF_MAIL_SEND_ERROR') ); + + } + + else + + { + + JFactory::getApplication()->enqueueMessage(JText::_('WDF_SUBMITTED')); + + } + + } + + + + + + + +if(isset($_SESSION['show_submit_text'.$id])) + + if($_SESSION['show_submit_text'.$id]==1) + + { + + $_SESSION['show_submit_text'.$id]=0; + + echo $row->submit_text; + + $content=ob_get_contents(); + + ob_end_clean(); + + return $content; + + } + + + + $db = JFactory::getDBO(); + $db->setQuery("SELECT `views` FROM #__formmaker_views WHERE form_id=".$db->escape($id) ); + $views = $db->loadResult(); + if ($db->getErrorNum()) {echo $db->stderr(); return false;} + + if($views==NULL) + { + $db->setQuery("INSERT INTO #__formmaker_views (form_id, views) VALUES('".$id."', 0)"); + $db->query(); + if ($db->getErrorNum()) {echo $db->stderr(); return false;} + } + else + { + $db->setQuery("UPDATE #__formmaker_views SET views=".($views+1)." where form_id=".$db->escape($id) ); + $db->query(); + if ($db->getErrorNum()) {echo $db->stderr(); return false;} + } + + + + $document = JFactory::getDocument(); + + + + $is_editor=false; + + $plugin = JPluginHelper::getPlugin('editors', 'tinymce'); + if (isset($plugin->type)) + { + $editor = JFactory::getEditor('tinymce'); + $is_editor=true; + } + + $editor = JFactory::getEditor('tinymce'); + + + + if(isset($row->form) ) + + $old = true; + + + + $article=$row->article_id; + + echo ''; + + + + $css_rep1=array("[SITE_ROOT]", "}"); + + $css_rep2=array(JURI::root(true), "}#form".$id." "); + + $order = array("\r\n", "\n", "\r"); + + $form_theme=str_replace($order,'',$form_theme); + + $form_theme=str_replace($css_rep1,$css_rep2,$form_theme); + + $form_theme="#form".$id.' '.$form_theme; + + $form_currency='$'; + + $check_js=''; + + $onload_js=''; + + $onsubmit_js=''; + + + + + + $currency_code=array('USD', 'EUR', 'GBP', 'JPY', 'CAD', 'MXN', 'HKD', 'HUF', 'NOK', 'NZD', 'SGD', 'SEK', 'PLN', 'AUD', 'DKK', 'CHF', 'CZK', 'ILS', 'BRL', 'TWD', 'MYR', 'PHP', 'THB'); + + + + $currency_sign=array('$' , '€' , '£' , 'Â¥' , 'C$', 'Mex$', 'HK$', 'Ft' , 'kr' , 'NZ$', 'S$' , 'kr' , 'zÅ‚' , 'A$' , 'kr' , 'CHF' , 'KÄ', '₪' , 'R$' , 'NT$', 'RM' , '₱' , '฿' ); + + + + + + + + if($row->payment_currency) + + + + $form_currency= $currency_sign[array_search($row->payment_currency, $currency_code)]; + + + + $form_paypal_tax = $row->tax; + + + + echo ''; + + + + + +// echo '

'.$row->title.'


'; + +?> + +
+ +
+ + + + + + + +form=='')) + + { + + + + + + $is_type = array(); + + $id1s = array(); + + $types = array(); + + $labels = array(); + + $paramss = array(); + + $required_sym=$row->requiredmark; + + $fields=explode('*:*new_field*:*',$row->form_fields); + + $fields = array_slice($fields,0, count($fields)-1); + + foreach($fields as $field) + + { + + $temp=explode('*:*id*:*',$field); + + array_push($id1s, $temp[0]); + + $temp=explode('*:*type*:*',$temp[1]); + + array_push($types, $temp[0]); + + $temp=explode('*:*w_field_label*:*',$temp[1]); + + array_push($labels, $temp[0]); + + array_push($paramss, $temp[1]); + + } + + + + $form_id=$id; + + $show_hide = array(); + $field_label = array(); + $all_any = array(); + $condition_params = array(); + $type_and_id = array(); + + $condition_js=''; + if($row->condition!="") + { + $conditions=explode('*:*new_condition*:*',$row->condition); + $conditions = array_slice($conditions,0, count($conditions)-1); + $count_of_conditions = count($conditions); + + foreach($conditions as $condition) + { + $temp=explode('*:*show_hide*:*',$condition); + array_push($show_hide, $temp[0]); + $temp=explode('*:*field_label*:*',$temp[1]); + array_push($field_label, $temp[0]); + $temp=explode('*:*all_any*:*',$temp[1]); + array_push($all_any, $temp[0]); + array_push($condition_params, $temp[1]); + } + + foreach($id1s as $id1s_key => $id1) + { + $type_and_id[$id1]=$types[$id1s_key]; + } + + + for($k=0; $k<$count_of_conditions; $k++) + { + + if($show_hide[$k]) + { + $display = 'removeAttr("style")'; + $display_none = 'css("display", "none")'; + } + else + { + $display = 'css("display", "none")'; + $display_none = 'removeAttr("style")'; + } + + if($all_any[$k]=="and") + $or_and = '&&'; + else + $or_and = '||'; + + + if($condition_params[$k]) + { + $cond_params =explode('*:*next_condition*:*',$condition_params[$k]); + $cond_params = array_slice($cond_params,0, count($cond_params)-1); + + $if = ''; + $keyup = ''; + $change = ''; + $click = ''; + + foreach($cond_params as $key=>$param) + { + $params_value = explode('***',$param); + + if(isset($type_and_id[$params_value[0]])) + switch($type_and_id[$params_value[0]]) + { + case "type_text": + case "type_password": + case "type_textarea": + case "type_number": + case "type_submitter_mail": + $if .= ' wdformjQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" '; + $keyup .= '#wdform_'.$params_value[0].'_element'.$form_id.', '; + break; + + case "type_name": + + $extended0 = ''; + $extended1 = ''; + $extended2 = ''; + $extended3 = ''; + $normal0 = ''; + $normal1 = ''; + $normal2 = ''; + $normal3 = ''; + + $name_fields = explode(' ',$params_value[2]); + if($name_fields[0]!='') + { + $extended0 = 'wdformjQuery("#wdform_'.$params_value[0].'_element_title'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[0].'"'; + $normal0 = 'wdformjQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[0].'"'; + } + + if(isset($name_fields[1]) && $name_fields[1]!='') + { + $extended1 = 'wdformjQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[1].'"'; + $normal1 = 'wdformjQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[1].'"'; + } + + if(isset($name_fields[2]) && $name_fields[2]!='') + { + $extended2 = 'wdformjQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[2].'"'; + $normal2 = ''; + } + + if(isset($name_fields[3]) && $name_fields[3]!='') + { + $extended3 = 'wdformjQuery("#wdform_'.$params_value[0].'_element_middle'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[3].'"'; + $normal3 = ''; + } + + + if(isset($name_fields[3])) + { + $extended =''; + $normal =''; + if($extended0) + { + $extended = $extended0; + if($extended1) + { + $extended .= ' && '.$extended1; + if($extended2) + $extended .=' && '.$extended2; + + if($extended3) + $extended .=' && '.$extended3; + } + else + { + if($extended2) + $extended .= ' && '.$extended2; + if($extended3) + $extended .= ' && '.$extended3; + } + } + else + { + if($extended1) + { + $extended = $extended1; + if($extended2) + $extended .=' && '.$extended2; + + if($extended3) + $extended .=' && '.$extended3; + } + else + { + if($extended2) + { + $extended = $extended2; + if($extended3) + $extended .= ' && '.$extended3; + } + else + if($extended3) + $extended = $extended3; + } + } + + if($normal0) + { + $normal = $normal0; + if($normal1) + $normal .= ' && '.$normal1; + } + else + { + if($normal1) + $normal = $normal1; + } + } + else + { + if(isset($name_fields[2])) + { + $extended =""; + $normal =""; + if($extended0) + { + $extended = $extended0; + if($extended1) + $extended .= ' && '.$extended1; + + if($extended2) + $extended .=' && '.$extended2; + + } + else + { + if($extended1) + { + $extended = $extended1; + if($extended2) + $extended .= ' && '.$extended2; + } + else + if($extended2) + $extended = $extended2; + } + + + if($normal0) + { + $normal = $normal0; + if($normal1) + $normal .= ' && '.$normal1; + } + else + { + if($normal1) + $normal = $normal1; + } + + } + else + { + if(isset($name_fields[1])) + { + $extended =''; + $normal =''; + if($extended0) + { + if($extended1) + $extended = $extended0.' && '.$extended1; + else + $extended = $extended0; + } + else + { + if($extended1) + $extended = $extended1; + } + + + if($normal0) + { + if($normal1) + $normal = $normal0.' && '.$normal1; + else + $normal = $normal0; + } + else + { + if($normal1) + $normal = $normal1; + } + } + else + { + $extended = $extended0; + $normal = $normal0; + } + } + } + + if($extended!="" && $normal!="") + $if .= ' ((wdformjQuery("#wdform_'.$params_value[0].'_element_title'.$form_id.'").length != 0) ? '.$extended.' : '.$normal.') '; + else + $if .= ' true'; + + $keyup .= '#wdform_'.$params_value[0].'_element_title'.$form_id.', #wdform_'.$params_value[0].'_element_first'.$form_id.', #wdform_'.$params_value[0].'_element_last'.$form_id.', #wdform_'.$params_value[0].'_element_middle'.$form_id.', '; + break; + + case "type_phone": + $phone_fields = explode(' ',$params_value[2]); + if(isset($phone_fields[1])) + { + if($phone_fields[0]!='' && $phone_fields[1]!='') + $if .= ' (wdformjQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$phone_fields[0].'" && wdformjQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$params_value[1].'"'.$phone_fields[1].'") '; + else + { + if($phone_fields[0]=='') + $if .= ' (wdformjQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$params_value[1].'"'.$phone_fields[1].'") '; + else + if($phone_fields[1]=='') + $if .= ' (wdformjQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$phone_fields[1].'") '; + } + } + else + $if .= ' wdformjQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" '; + + $keyup .= '#wdform_'.$params_value[0].'_element_first'.$form_id.', #wdform_'.$params_value[0].'_element_last'.$form_id.', '; + break; + + case "type_paypal_price": + $if .= ' + (wdformjQuery("#wdform_'.$params_value[0].'_td_name_cents").attr("style")=="display: none;") ? wdformjQuery("#wdform_'.$params_value[0].'_element_dollars'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" : parseFloat(wdformjQuery("#wdform_'.$params_value[0].'_element_dollars'.$form_id.'").val()+"."+wdformjQuery("#wdform_'.$params_value[0].'_element_cents'.$form_id.'").val())'.$params_value[1].'parseFloat("'.str_replace('.0', '.', $params_value[2]).'")'; + + $keyup .= '#wdform_'.$params_value[0].'_element_dollars'.$form_id.', #wdform_'.$params_value[0].'_element_cents'.$form_id.', '; + break; + + case "type_own_select": + case "type_paypal_select": + + $if .= ' wdformjQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" '; + $change .= '#wdform_'.$params_value[0].'_element'.$form_id.', '; + break; + + case "type_address": + $if .= ' wdformjQuery("#wdform_'.$params_value[0].'_country'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" '; + $change .= '#wdform_'.$params_value[0].'_country'.$form_id.', '; + break; + + case "type_radio": + case "type_paypal_radio": + case "type_paypal_shipping": + + $if .= ' wdformjQuery("label[for=\'"+wdformjQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").prop("id")+"\']").eq(0).text()'.$params_value[1].'"'.$params_value[2].'" '; + $click .= 'div[wdid='.$params_value[0].'] input[type=\'radio\'], '; + break; + + case "type_checkbox": + case "type_paypal_checkbox": + + if($params_value[2]) + { + $choises = explode('@@@',$params_value[2]); + $choises = array_slice($choises,0, count($choises)-1); + + if($params_value[1]=="!=") + $is = "!"; + else + $is = ""; + + foreach($choises as $key1=>$choise) + { + if($type_and_id[$params_value[0]]=="type_paypal_checkbox") + { + $choise_and_value = explode("*:*value*:*",$choise); + $if .= ' '.$is.'(wdformjQuery("div[wdid='.$params_value[0].'] input[value=\"'.$choise_and_value[1].'\"]").is(":checked") && wdformjQuery("div[wdid='.$params_value[0].'] input[title=\"'.$choise_and_value[0].'\"]"))'; + + } + else + $if .= ' '.$is.'wdformjQuery("div[wdid='.$params_value[0].'] input[value=\"'.$choise.'\"]").is(":checked") '; + + if($key1!=count($choises)-1) + $if .= '&&'; + } + + $click .= 'div[wdid='.$params_value[0].'] input[type=\'checkbox\'], '; + } + else + { + if($or_and=='&&') + $if .= ' true'; + else + $if .= ' false'; + } + break; + } + + if($key!=count($cond_params)-1) + $if .= $or_and; + } + + if($if) + { + $condition_js .= ' + + if('.$if.') + wdformjQuery("div[wdid='.$field_label[$k].']").'.$display .'; + else + wdformjQuery("div[wdid='.$field_label[$k].']").'.$display_none .';'; + } + + if($keyup) + $condition_js .= ' + wdformjQuery("'.substr($keyup,0,-2).'").keyup(function() { + + if('.$if.') + wdformjQuery("div[wdid='.$field_label[$k].']").'.$display .'; + else + wdformjQuery("div[wdid='.$field_label[$k].']").'.$display_none .'; });'; + + if($change) + $condition_js .= ' + wdformjQuery("'.substr($change,0,-2).'").change(function() { + if('.$if.') + wdformjQuery("div[wdid='.$field_label[$k].']").'.$display .'; + else + wdformjQuery("div[wdid='.$field_label[$k].']").'.$display_none .'; });'; + + if($click) + $condition_js .= ' + wdformjQuery("'.substr($click,0,-2).'").click(function() { + if('.$if.') + wdformjQuery("div[wdid='.$field_label[$k].']").'.$display .'; + else + wdformjQuery("div[wdid='.$field_label[$k].']").'.$display_none .'; });'; + + } + + + } + + } + + + + if($row->autogen_layout==0) + + $form=$row->custom_front; + + else + + $form=$row->form_front; + + + + foreach($id1s as $id1s_key => $id1) + + { + + $label=$labels[$id1s_key]; + + $type=$types[$id1s_key]; + + $params=$paramss[$id1s_key]; + + if( strpos($form, '%'.$id1.' - '.$label.'%')) + + { + + $rep=''; + + $required=false; + + $param=array(); + + $param['attributes'] = ''; + + $is_type[$type]=true; + + + + switch($type) + + { + + case 'type_section_break': + + { + + $params_names=array('w_editor'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + $rep ='
'.$param['w_editor'].'
'; + + break; + + } + + + + case 'type_editor': + + { + + $params_names=array('w_editor'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + $rep ='
'.$param['w_editor'].'
'; + + break; + + } + + case 'type_send_copy': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_required'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $input_active = ($param['w_first_val']=='true' ? "checked='checked'" : ""); + + $post_value=$input_get->getString("counter".$form_id); + + + + if(isset($post_value)) + + { + + $post_temp=$input_get->getString('wdform_'.$id1.'_element'.$form_id); + + $input_active = (isset($post_temp) ? "checked='checked'" : ""); + + } + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + + + $rep ='
'; + + if($required) + + $rep.=''.$required_sym.''; + + + + $rep.='
+ +
+ +
+ + + + + +
+ +
'; + + + + $onsubmit_js.=' + + if(!wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").is(":checked")) + + wdformjQuery("").appendTo("#form'.$form_id.'"); + + '; + + + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(x.find(wdformjQuery("div[wdid='.$id1.'] input:checked")).length == 0) + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + + + return false; + + } + + } + + '; + + + + + + break; + + + + } + + + + + + case 'type_text': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $param['w_first_val']=$input_get->getString('wdform_'.$id1.'_element'.$form_id, $param['w_first_val']); + + + + $wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size'] : max($param['w_field_label_size'],$param['w_size'])); + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active"); + + $required = ($param['w_required']=="yes" ? true : false); + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="'.$param['w_title'].'" || wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" ); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").focus(); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( wdformjQuery(this).val()!="" ) wdformjQuery(this).removeClass("form-error"); else wdformjQuery(this).addClass("form-error");}); + + return false; + + } + + } + + '; + + + + break; + + + + } + + + + case 'type_number': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique','w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $param['w_first_val']=$input_get->getString('wdform_'.$id1.'_element'.$form_id, $param['w_first_val']); + + + + $wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size'] : max($param['w_field_label_size'],$param['w_size'])); + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active"); + + $required = ($param['w_required']=="yes" ? true : false); + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="'.$param['w_title'].'" || wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" ); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").focus(); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( wdformjQuery(this).val()!="" ) wdformjQuery(this).removeClass("form-error"); else wdformjQuery(this).addClass("form-error");}); + + return false; + + } + + } + + '; + + + + break; + + } + + + + case 'type_password': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_required','w_unique','w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size'] : max($param['w_field_label_size'],$param['w_size'])); + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" ); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").focus(); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( wdformjQuery(this).val()!="" ) wdformjQuery(this).removeClass("form-error"); else wdformjQuery(this).addClass("form-error");}); + + return false; + + } + + } + + '; + + + + break; + + } + + + + case 'type_textarea': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_size_w','w_size_h','w_first_val','w_title','w_required','w_unique','w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $param['w_first_val']=$input_get->getString('wdform_'.$id1.'_element'.$form_id, $param['w_first_val']); + + + + $wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size_w'] : max($param['w_field_label_size'],$param['w_size_w'])); + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active"); + + $required = ($param['w_required']=="yes" ? true : false); + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="'.$param['w_title'].'" || wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" ); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").focus(); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( wdformjQuery(this).val()!="" ) wdformjQuery(this).removeClass("form-error"); else wdformjQuery(this).addClass("form-error");}); + + return false; + + } + + } + + '; + + + + + + break; + + } + + case 'type_wdeditor': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_size_w','w_size_h','w_title','w_required','w_class'); + + $temp=$params; + + + + + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + + + $wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size_w']+10 : max($param['w_field_label_size'],$param['w_size_w'])); + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + + + $required = ($param['w_required']=="yes" ? true : false); + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + if($is_editor) + + $wd_editor = $editor->display('wdform_'.$id1.'_wd_editor'.$form_id,'',$param['w_size_w'],$param['w_size_h'],'40','6'); + + else + + { + + $wd_editor=' + + '; + + } + + + + $rep.= $wd_editor.'
'; + + + + + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(tinyMCE.get("wdform_'.$id1.'_wd_editor'.$form_id.'").getContent()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + wdformjQuery("#wdform_'.$id1.'_wd_editor'.$form_id.'").addClass( "form-error" ); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_wd_editor'.$form_id.'").focus(); + + wdformjQuery("#wdform_'.$id1.'_wd_editor'.$form_id.'").change(function() { if( wdformjQuery(this).val()!="" ) wdformjQuery(this).removeClass("form-error"); else wdformjQuery(this).addClass("form-error");}); + + return false; + + } + + } + + '; + + + + $onload_js .='tinyMCE.get("wdform_'.$id1.'_wd_editor'.$form_id.'").setContent("'.$param['w_title'].'");'; + + + + + + break; + + } + + + + + + case 'type_phone': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_mini_labels','w_required','w_unique', 'w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + + + $w_first_val = explode('***',$param['w_first_val']); + + $w_title = explode('***',$param['w_title']); + + + + $param['w_first_val']=$input_get->getString('wdform_'.$id1.'_element_first'.$form_id, $w_first_val[0]).'***'.$input_get->getString('wdform_'.$id1.'_element_last'.$form_id, $w_first_val[1]); + + + + $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']+65) : max($param['w_field_label_size'],($param['w_size']+65))); + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active"); + + $required = ($param['w_required']=="yes" ? true : false); + + + + $w_first_val = explode('***',$param['w_first_val']); + + $w_title = explode('***',$param['w_title']); + + $w_mini_labels = explode('***',$param['w_mini_labels']); + + + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.=' + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
-
+ +
+ +
+ +
+ +
+ +
+ +
+ +
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_element_first'.$form_id.'").val()=="'.$w_title[0].'" || wdformjQuery("#wdform_'.$id1.'_element_first'.$form_id.'").val()=="" || wdformjQuery("#wdform_'.$id1.'_element_last'.$form_id.'").val()=="'.$w_title[1].'" || wdformjQuery("#wdform_'.$id1.'_element_last'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element_first'.$form_id.'").focus(); + + return false; + + } + + + + } + + '; + + break; + + } + + + + case 'type_name': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_title', 'w_mini_labels','w_size','w_name_format','w_required','w_unique', 'w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $w_first_val = explode('***',$param['w_first_val']); + + $w_title = explode('***',$param['w_title']); + + $w_mini_labels = explode('***',$param['w_mini_labels']); + + + + + + + + $element_title = $input_get->getString('wdform_'.$id1.'_element_title'.$form_id); + + $element_first = $input_get->getString('wdform_'.$id1.'_element_first'.$form_id); + + if(isset($element_title)) + + $param['w_first_val']=$input_get->getString('wdform_'.$id1.'_element_title'.$form_id, $w_first_val[0]).'***'.$input_get->getString('wdform_'.$id1.'_element_first'.$form_id, $w_first_val[1]).'***'.$input_get->getString('wdform_'.$id1.'_element_last'.$form_id, $w_first_val[2]).'***'.$input_get->getString('wdform_'.$id1.'_element_middle'.$form_id, $w_first_val[3]); + + else + + if(isset($element_first)) + + $param['w_first_val']=$input_get->getString('wdform_'.$id1.'_element_first'.$form_id, $w_first_val[0]).'***'.$input_get->getString('wdform_'.$id1.'_element_last'.$form_id, $w_first_val[1]); + + + + $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active"); + + $required = ($param['w_required']=="yes" ? true : false); + + + + $w_first_val = explode('***',$param['w_first_val']); + + $w_title = explode('***',$param['w_title']); + + + + + + + + if($param['w_name_format']=='normal') + + { + + $w_name_format = ' + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + '; + + $w_size=2*$param['w_size']; + + + + } + + else + + { + + $w_name_format = ' + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + '; + + $w_size=3*$param['w_size']+80; + + } + + + + $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$w_size) : max($param['w_field_label_size'],$w_size)); + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'.$w_name_format.'
'; + + + + if($required) + + { + + if($param['w_name_format']=='normal') + + { + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_element_first'.$form_id.'").val()=="'.$w_title[0].'" || wdformjQuery("#wdform_'.$id1.'_element_first'.$form_id.'").val()=="" || wdformjQuery("#wdform_'.$id1.'_element_last'.$form_id.'").val()=="'.$w_title[1].'" || wdformjQuery("#wdform_'.$id1.'_element_last'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element_first'.$form_id.'").focus(); + + return false; + + } + + } + + '; + + } + + else + + { + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_element_title'.$form_id.'").val()=="'.$w_title[0].'" || wdformjQuery("#wdform_'.$id1.'_element_title'.$form_id.'").val()=="" || wdformjQuery("#wdform_'.$id1.'_element_first'.$form_id.'").val()=="'.$w_title[1].'" || wdformjQuery("#wdform_'.$id1.'_element_first'.$form_id.'").val()=="" || wdformjQuery("#wdform_'.$id1.'_element_last'.$form_id.'").val()=="'.$w_title[2].'" || wdformjQuery("#wdform_'.$id1.'_element_last'.$form_id.'").val()=="" || wdformjQuery("#wdform_'.$id1.'_element_middle'.$form_id.'").val()=="'.$w_title[3].'" || wdformjQuery("#wdform_'.$id1.'_element_middle'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element_first'.$form_id.'").focus(); + + return false; + + } + + } + + '; + + } + + } + + break; + + } + + + + case 'type_address': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_mini_labels','w_disabled_fields','w_required','w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + + + $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size'])); + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + $w_mini_labels = explode('***',$param['w_mini_labels']); + + $w_disabled_fields = explode('***',$param['w_disabled_fields']); + + + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + + + + + + + + + $address_fields =''; + + $g=0; + + if($w_disabled_fields[0]=='no') + + { + + $g+=2; + + $address_fields .= ''; + + } + + + + if($w_disabled_fields[1]=='no') + + { + + $g+=2; + + $address_fields .= ''; + + } + + + + if($w_disabled_fields[2]=='no') + + { + + $g++; + + $address_fields .= ''; + + } + + if($w_disabled_fields[3]=='no') + + { + + $g++; + + + + + + $w_states = array("","Alabama","Alaska", "Arizona","Arkansas","California","Colorado","Connecticut","Delaware","District Of Columbia","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"); + + $w_state_options = ''; + + foreach($w_states as $w_state) + + { + + + + if($w_state == $input_get->getString('wdform_'.($id1+3).'_state'.$form_id)) + + $selected = 'selected="selected"'; + + else + + $selected = ''; + + $w_state_options .= ''; + + } + + if($w_disabled_fields[5]=='yes' && $w_disabled_fields[6]=='yes') + + { + + $address_fields .= ''; + + } + + else + + $address_fields .= ''; + + } + + if($w_disabled_fields[4]=='no') + + { + + $g++; + + $address_fields .= ''; + + } + + $w_countries = array("","Afghanistan","Albania", "Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Colombi","Comoros","Congo (Brazzaville)","Congo","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","East Timor (Timor Timur)","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Fiji","Finland","France","Gabon","Gambia, The","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Korea, North","Korea, South","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepa","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia and Montenegro","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen","Zambia","Zimbabwe"); + + $w_options = ''; + + foreach($w_countries as $w_country) + + { + + + + if($w_country == $input_get->getString('wdform_'.($id1+5).'_country'.$form_id)) + + $selected = 'selected="selected"'; + + else + + $selected = ''; + + $w_options .= ''; + + } + + + + if($w_disabled_fields[5]=='no') + + { + + $g++; + + $address_fields .= ''; + + } + + + + + + $rep.='
+ + '.$address_fields.'
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_street1'.$form_id.'").val()=="" || wdformjQuery("#wdform_'.$id1.'_street2'.$form_id.'").val()=="" || wdformjQuery("#wdform_'.$id1.'_city'.$form_id.'").val()=="" || wdformjQuery("#wdform_'.$id1.'_state'.$form_id.'").val()=="" || wdformjQuery("#wdform_'.$id1.'_postal'.$form_id.'").val()=="" || wdformjQuery("#wdform_'.$id1.'_country'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_street1'.$form_id.'").focus(); + + return false; + + } + + + + } + + '; + + + + $post=$input_get->getString('wdform_'.($id1+5).'_country'.$form_id); + + if(isset($post)) + + $onload_js .=' wdformjQuery("#wdform_'.$id1.'_country'.$form_id.'").val("'.$input_get->getString('wdform_'.($id1+5)."_country".$form_id, '').'");'; + + + + if($w_disabled_fields[6]=='yes') + + $onload_js .=' wdformjQuery("#wdform_'.$id1.'_country'.$form_id.'").change(function() { + + if( wdformjQuery(this).val()=="United States") + + { + + wdformjQuery("#wdform_'.$id1.'_state'.$form_id.'").parent().append(""); + + wdformjQuery("#wdform_'.$id1.'_state'.$form_id.'").parent().children("input:first, label:first").remove(); + + } + + else + + { + + if(wdformjQuery("#wdform_'.$id1.'_state'.$form_id.'").prop("tagName")=="SELECT") + + { + + + + wdformjQuery("#wdform_'.$id1.'_state'.$form_id.'").parent().append("getString('wdform_'.($id1+3).'_state'.$form_id).'\" style=\"width: 100%;\" '.$param['attributes'].'>"); + + wdformjQuery("#wdform_'.$id1.'_state'.$form_id.'").parent().children("select:first, label:first").remove(); + + } + + } + + + + });'; + + + + break; + + } + + + + case 'type_submitter_mail': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + + + $param['w_first_val']=$input_get->getString('wdform_'.$id1.'_element'.$form_id, $param['w_first_val']); + + + + $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size'])); + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active"); + + $required = ($param['w_required']=="yes" ? true : false); + + + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="'.$param['w_title'].'" || wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" ); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").focus(); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( wdformjQuery(this).val()!="" ) wdformjQuery(this).removeClass("form-error"); else wdformjQuery(this).addClass("form-error");}); + + return false; + + } + + } + + '; + + + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + + + if(wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()!="" && wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val().search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1 ) + + { + + alert("'.JText::_("WDF_INVALID_EMAIL").'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").focus(); + + return false; + + } + + + + } + + '; + + + + break; + + } + + + + case 'type_checkbox': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + $param['w_choices'] = explode('***',$param['w_choices']); + + $param['w_choices_checked'] = explode('***',$param['w_choices_checked']); + + + + $post_value=$input_get->getString("counter".$form_id); + + $is_other=false; + + + + if(isset($post_value)) + + { + + if($param['w_allow_other']=="yes") + + { + + $is_other=false; + + $other_element=$input_get->getString('wdform_'.$id1."_other_input".$form_id); + + if(isset($other_element)) + + $is_other=true; + + } + + } + + else + + $is_other=($param['w_allow_other']=="yes" && $param['w_choices_checked'][$param['w_allow_other_num']]=='true') ; + + + + $rep='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + $rep.='
'; + + + + foreach($param['w_choices'] as $key => $choice) + + { + + if($key%$param['w_rowcol']==0 && $key>0) + + $rep.='
'; + + if(!isset($post_value)) + + $param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : ''); + + else + + { + + $post_valuetemp=$input_get->getString('wdform_'.$id1."_element".$form_id.$key); + + $param['w_choices_checked'][$key]=(isset($post_valuetemp) ? 'checked="checked"' : ''); + + } + + + + $rep.='
'; + + } + + $rep.='
'; + + + + $rep.='
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(x.find(wdformjQuery("div[wdid='.$id1.'] input:checked")).length == 0 || wdformjQuery("#wdform_'.$id1.'_other_input'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + + + return false; + + } + + } + + '; + + if($is_other) + + $onload_js .='show_other_input("wdform_'.$id1.'","'.$form_id.'"); wdformjQuery("#wdform_'.$id1.'_other_input'.$form_id.'").val("'.$input_get->getString('wdform_'.$id1."_other_input".$form_id, '').'");'; + + if($param['w_randomize']=='yes') + { + $onload_js .='wdformjQuery("#form'.$form_id.' div[wdid='.$id1.'] .wdform-element-section> div").shuffle(); + '; + } + + + + $onsubmit_js.=' + + wdformjQuery("").appendTo("#form'.$form_id.'"); + + wdformjQuery("").appendTo("#form'.$form_id.'"); + + '; + + + + break; + + } + + + + case 'type_radio': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + $param['w_choices'] = explode('***',$param['w_choices']); + + $param['w_choices_checked'] = explode('***',$param['w_choices_checked']); + + + + $post_value=$input_get->getString("counter".$form_id); + + $is_other=false; + + + + if(isset($post_value)) + + { + + if($param['w_allow_other']=="yes") + + { + + $is_other=false; + + $other_element=$input_get->getString('wdform_'.$id1."_other_input".$form_id); + + if(isset($other_element)) + + $is_other=true; + + } + + } + + else + + $is_other=($param['w_allow_other']=="yes" && $param['w_choices_checked'][$param['w_allow_other_num']]=='true') ; + + + + $rep='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + $rep.='
'; + + + + foreach($param['w_choices'] as $key => $choice) + + { + + if($key%$param['w_rowcol']==0 && $key>0) + + $rep.='
'; + + if(!isset($post_value)) + + $param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : ''); + + else + + $param['w_choices_checked'][$key]=(htmlspecialchars($choice)==htmlspecialchars($input_get->getString('wdform_'.$id1."_element".$form_id)) ? 'checked="checked"' : ''); + + + + $rep.='
'; + + } + + $rep.='
'; + + + + $rep.='
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(x.find(wdformjQuery("div[wdid='.$id1.'] input:checked")).length == 0) + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + + + return false; + + } + + } + + '; + + if($is_other) + + $onload_js .='show_other_input("wdform_'.$id1.'","'.$form_id.'"); wdformjQuery("#wdform_'.$id1.'_other_input'.$form_id.'").val("'.$input_get->getString('wdform_'.$id1."_other_input".$form_id, '').'");'; + + + if($param['w_randomize']=='yes') + { + $onload_js .='wdformjQuery("#form'.$form_id.' div[wdid='.$id1.'] .wdform-element-section> div").shuffle(); + '; + } + + + $onsubmit_js.=' + + wdformjQuery("").appendTo("#form'.$form_id.'"); + + wdformjQuery("").appendTo("#form'.$form_id.'"); + + '; + + + + break; + + } + + + + case 'type_own_select': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled','w_required','w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + + + $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size'])); + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + $param['w_choices'] = explode('***',$param['w_choices']); + + $param['w_choices_checked'] = explode('***',$param['w_choices_checked']); + + $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']); + + + + $post_value=$input_get->getString("counter".$form_id); + + + + + + $rep='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if( wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" ); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").focus(); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( wdformjQuery(this).val()!="" ) wdformjQuery(this).removeClass("form-error"); else wdformjQuery(this).addClass("form-error");}); + + return false; + + } + + } + + '; + + + + break; + + } + + + + case 'type_country': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_countries','w_required','w_class'); + + $temp=$params; + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' add_'.$attr; + + } + + + + $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size'])); + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + $param['w_countries'] = explode('***',$param['w_countries']); + + + + $post_value=$input_get->getString("counter".$form_id); + + $selected=''; + + + + $rep='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if( wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" ); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").focus(); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( wdformjQuery(this).val()!="" ) wdformjQuery(this).removeClass("form-error"); else wdformjQuery(this).addClass("form-error");}); + + return false; + + } + + } + + '; + + + + break; + + } + + + + case 'type_time': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_time_type','w_am_pm','w_sec','w_hh','w_mm','w_ss','w_mini_labels','w_required','w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + $w_mini_labels = explode('***',$param['w_mini_labels']); + + + + $w_sec = ''; + + $w_sec_label=''; + + + + if($param['w_sec']=='1') + + { + + $w_sec = '
 : 
'; + + + + $w_sec_label='
'; + + } + + + + + + if($param['w_time_type']=='12') + + { + + if($input_get->getString('wdform_'.$id1."_am_pm".$form_id, $param['w_am_pm'])=='am') + + { + + $am_ = "selected=\"selected\""; + + $pm_ = ""; + + } + + else + + { + + $am_ = ""; + + $pm_ = "selected=\"selected\""; + + + + } + + + + $w_time_type = '
'; + + + + $w_time_type_label = '
'; + + + + } + + else + + { + + $w_time_type=''; + + $w_time_type_label = ''; + + } + + + + + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
 : 
'.$w_sec.$w_time_type.'
'.$w_sec_label.$w_time_type_label.'
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_mm'.$form_id.'").val()=="" || wdformjQuery("#wdform_'.$id1.'_hh'.$form_id.'").val()=="" || (wdformjQuery("#wdform_'.$id1.'_ss'.$form_id.'").length != 0 ? wdformjQuery("#wdform_'.$id1.'_ss'.$form_id.'").val()=="" : false)) + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_hh'.$form_id.'").focus(); + + return false; + + } + + } + + '; + + break; + + } + + + + case 'type_date': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + + + $param['w_date']=$input_get->getString('wdform_'.$id1."_element".$form_id, $param['w_date']); + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" ); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").focus(); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( wdformjQuery(this).val()!="" ) wdformjQuery(this).removeClass("form-error"); else wdformjQuery(this).addClass("form-error");}); + + return false; + + } + + } + + '; + + + + $onload_js.= 'Calendar.setup({inputField: "wdform_'.$id1.'_element'.$form_id.'", ifFormat: "'.$param['w_format'].'",button: "wdform_'.$id1.'_button'.$form_id.'",align: "Tl",singleClick: true,firstDay: 0});'; + + + + break; + + } + + + + case 'type_date_fields': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_day','w_month','w_year','w_day_type','w_month_type','w_year_type','w_day_label','w_month_label','w_year_label','w_day_size','w_month_size','w_year_size','w_required','w_class','w_from','w_to','w_divider'); + + + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $param['w_day']=$input_get->getString('wdform_'.$id1."_day".$form_id, $param['w_day']); + + $param['w_month']=$input_get->getString('wdform_'.$id1."_month".$form_id, $param['w_month']); + + $param['w_year']=$input_get->getString('wdform_'.$id1."_year".$form_id, $param['w_year']); + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + + + + + if($param['w_day_type']=="SELECT") + + { + + $w_day_type = ''; + + + + } + + else + + { + + $w_day_type = ''; + + $onload_js .='wdformjQuery("#wdform_'.$id1.'_day'.$form_id.'").blur(function() {if (wdformjQuery(this).val()=="0") wdformjQuery(this).val(""); else add_0(this)});'; + + $onload_js .='wdformjQuery("#wdform_'.$id1.'_day'.$form_id.'").keypress(function() {return check_day(event, this)});'; + + } + + + + + + if($param['w_month_type']=="SELECT") + + { + + + + $w_month_type = ''; + + + + } + + else + + { + + $w_month_type = ''; + + $onload_js .='wdformjQuery("#wdform_'.$id1.'_month'.$form_id.'").blur(function() {if (wdformjQuery(this).val()=="0") wdformjQuery(this).val(""); else add_0(this)});'; + + $onload_js .='wdformjQuery("#wdform_'.$id1.'_month'.$form_id.'").keypress(function() {return check_month(event, this)});'; + + } + + + + + + if($param['w_year_type']=="SELECT" ) + + { + + $w_year_type = ''; + + } + + else + + { + + $w_year_type = ''; + + $onload_js .='wdformjQuery("#wdform_'.$id1.'_year'.$form_id.'").keypress(function() {return check_year1(event, this)});'; + + $onload_js .='wdformjQuery("#wdform_'.$id1.'_year'.$form_id.'").change(function() {change_year(this)});'; + + } + + + + + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'.$w_day_type.'
'.$param['w_divider'].'
'.$w_month_type.'
'.$param['w_divider'].'
'.$w_year_type.'
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_day'.$form_id.'").val()=="" || wdformjQuery("#wdform_'.$id1.'_month'.$form_id.'").val()=="" || wdformjQuery("#wdform_'.$id1.'_year'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_day'.$form_id.'").focus(); + + return false; + + } + + } + + '; + + + + break; + + } + + + + case 'type_file_upload': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_destination','w_extension','w_max_size','w_required','w_multiple','w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + $multiple = ($param['w_multiple']=="yes" ? "multiple='multiple'" : ""); + + + + + + + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").focus(); + + return false; + + } + + } + + '; + + + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + ext_available=getfileextension(wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val(),"'.$param['w_extension'].'"); + + if(!ext_available) + + { + + alert("'.JText::_("WDF_FILE_TYPE_ERROR").'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").focus(); + + return false; + + } + + } + + '; + + + + break; + + } + + + + case 'type_captcha': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_digit','w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + + + $rep ='
'.$label.'
'; + + + + $onload_js .='wdformjQuery("#wd_captcha'.$form_id.'").click(function() {captcha_refresh("wd_captcha","'.$form_id.'")});'; + + $onload_js .='wdformjQuery("#_element_refresh'.$form_id.'").click(function() {captcha_refresh("wd_captcha","'.$form_id.'")});'; + + + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wd_captcha_input'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wd_captcha_input'.$form_id.'").focus(); + + return false; + + } + + } + + '; + + + + $onload_js.= 'captcha_refresh("wd_captcha", "'.$form_id.'");'; + + + + break; + + } + + + + case 'type_recaptcha': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + + + $publickey=($row->public_key ? $row->public_key : '0'); + + $error = null; + + + + $rep ='
'.$label.'
+ +
'.recaptcha_get_html($publickey, $error).'
'; + + + + $document->addScriptDeclaration('var RecaptchaOptions = {theme: "'.$param['w_theme'].'"};'); + + + + + + break; + + } + + + + case 'type_hidden': + + { + + $params_names=array('w_name','w_value'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $rep ='
'; + + + + break; + + } + + + + case 'type_mark_map': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class'); + + + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_width']) : max($param['w_field_label_size'], $param['w_width'])); + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + + + $rep ='
'.$label.'
'; + + + + $onload_js .='if_gmap_init("wdform_'.$id1.'", '.$form_id.');'; + + $onload_js .='add_marker_on_map("wdform_'.$id1.'", 0, "'.$param['w_long'].'", "'.$param['w_lat'].'", "'.$param['w_info'].'", '.$form_id.',true);'; + + + + break; + + } + + + + case 'type_map': + + { + + $params_names=array('w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class'); + + + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $marker=''; + + + + $param['w_long'] = explode('***',$param['w_long']); + + $param['w_lat'] = explode('***',$param['w_lat']); + + $param['w_info'] = explode('***',$param['w_info']); + + foreach($param['w_long'] as $key => $w_long ) + + { + + $marker.='long'.$key.'="'.$w_long.'" lat'.$key.'="'.$param['w_lat'][$key].'" info'.$key.'="'.$param['w_info'][$key].'"'; + + } + + + + $rep ='
'; + + + + $onload_js .='if_gmap_init("wdform_'.$id1.'", '.$form_id.');'; + + + + foreach($param['w_long'] as $key => $w_long ) + + { + + $onload_js .='add_marker_on_map("wdform_'.$id1.'",'.$key.', "'.$w_long.'", "'.$param['w_lat'][$key].'", "'.$param['w_info'][$key].'", '.$form_id.',false);'; + + } + + + + break; + + } + + + + case 'type_paypal_price': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_title', 'w_mini_labels','w_size','w_required','w_hide_cents','w_class','w_range_min','w_range_max'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $w_first_val = explode('***',$param['w_first_val']); + + $w_title = explode('***',$param['w_title']); + + + + $param['w_first_val']=$input_get->getString('wdform_'.$id1.'_element_dollars'.$form_id, $w_first_val[0]).'***'.$input_get->getString('wdform_'.$id1.'_element_cents'.$form_id, $w_first_val[1]); + + + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active"); + + $required = ($param['w_required']=="yes" ? true : false); + + $hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;"); + + + + $w_first_val = explode('***',$param['w_first_val']); + + $w_title = explode('***',$param['w_title']); + + $w_mini_labels = explode('***',$param['w_mini_labels']); + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + + + $rep.='
 '.$form_currency.' 
 . 
'; + + + + $onload_js .='wdformjQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").blur(function() {add_0(this)});'; + + $onload_js .='wdformjQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").keypress(function() {return check_isnum_interval(event,this,0,99)});'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val()=="'.$w_title[0].'" || wdformjQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").focus(); + + return false; + + } + + } + + '; + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + dollars=0; + + cents=0; + + + + if(wdformjQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val()!="'.$w_title[0].'" || wdformjQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val()) + + dollars =wdformjQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val(); + + + + if(wdformjQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").val()!="'.$w_title[1].'" || wdformjQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").val()) + + cents =wdformjQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").val(); + + + + var price=dollars+"."+cents; + + + + if(isNaN(price)) + + { + + alert("Invalid value of number field"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").focus(); + + return false; + + } + + + + var range_min='.($param['w_range_min'] ? $param['w_range_min'] : 0).'; + + var range_max='.($param['w_range_max'] ? $param['w_range_max'] : -1).'; + + + + + + if('.($required ? 'true' : 'false').' || wdformjQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val()!="'.$w_title[0].'" || wdformjQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").val()!="'.$w_title[1].'") + + if((range_max!=-1 && parseFloat(price)>range_max) || parseFloat(price)getString('wdform_'.$id1."_element".$form_id); + + + + if(isset($post_value)) + + foreach($param['w_choices'] as $key => $choice) + + { + + if($param['w_choices_disabled'][$key]=="true") + + $choice_value=''; + + else + + $choice_value=$param['w_choices_price'][$key]; + + + + if($post_value==$choice_value && $choice==$input_get->getString("wdform_".$id1."_element_label".$form_id)) + + $param['w_choices_checked'][$key]='selected="selected"'; + + else + + $param['w_choices_checked'][$key]=''; + + + + + + } + + else + + foreach($param['w_choices_checked'] as $key => $choices_checked ) + + { + + if($choices_checked=='true') + + $param['w_choices_checked'][$key]='selected="selected"'; + + else + + $param['w_choices_checked'][$key]=''; + + } + + + + $rep='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + if($param['w_quantity']=="yes") + + { + + $rep.='
'; + + } + + if($param['w_property'][0]) + + foreach($param['w_property'] as $key => $property) + + { + + + + $rep.=' + +
+ +
+ + + +
'; + + } + + + + $rep.='
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" ); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").focus(); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( wdformjQuery(this).val()!="" ) wdformjQuery(this).removeClass("form-error"); else wdformjQuery(this).addClass("form-error");}); + + return false; + + } + + } + + '; + + + + $onsubmit_js.=' + + wdformjQuery("").val(wdformjQuery("#wdform_'.$id1.'_element'.$form_id.' option:selected").text()).appendTo("#form'.$form_id.'"); + + '; + + $onsubmit_js.=' + + wdformjQuery("").val("'.JText::_("WDF_QUANTITY").'").appendTo("#form'.$form_id.'"); + + '; + + $onsubmit_js.=' + + wdformjQuery("").val("'.$param['w_property'][0].'").appendTo("#form'.$form_id.'"); + + '; + + break; + + } + + + + case 'type_paypal_checkbox': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + $param['w_choices'] = explode('***',$param['w_choices']); + + $param['w_choices_price'] = explode('***',$param['w_choices_price']); + + $param['w_choices_checked'] = explode('***',$param['w_choices_checked']); + + $param['w_property'] = explode('***',$param['w_property']); + + $param['w_property_values'] = explode('***',$param['w_property_values']); + + + + + + foreach($param['w_choices_checked'] as $key => $choices_checked ) + + $param['w_choices_checked'][$key]=($choices_checked=='true' ? 'checked="checked"' : ''); + + + + $rep='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + + + foreach($param['w_choices'] as $key => $choice) + + { + + $post_value=$input_get->getString("counter".$form_id); + + + + if(isset($post_value)) + + { + + $param['w_choices_checked'][$key]=""; + + $post_value=$input_get->getString('wdform_'.$id1."_element".$form_id.$key); + + if(isset($post_value)) + + $param['w_choices_checked'][$key]='checked="checked"'; + + } + + + + $rep.='
'; + + } + + + + $rep.='
'; + + if($param['w_quantity']=="yes") + + $rep.='
'; + + + + if($param['w_property'][0]) + + foreach($param['w_property'] as $key => $property) + + { + + + + $rep.=' + +
+ +
+ + + +
'; + + } + + + + $rep.='
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(x.find(wdformjQuery("div[wdid='.$id1.'] input:checked")).length == 0) + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + + + return false; + + } + + } + + '; + + + + $onsubmit_js.=' + + wdformjQuery("").val((x.find(wdformjQuery("div[wdid='.$id1.'] input:checked")).length != 0) ? wdformjQuery("#"+x.find(wdformjQuery("div[wdid='.$id1.'] input:checked")).prop("id").replace("element", "elementlabel_")) : "").appendTo("#form'.$form_id.'"); + + '; + + + + $onsubmit_js.=' + + wdformjQuery("").val("'.JText::_("WDF_QUANTITY").'").appendTo("#form'.$form_id.'"); + + '; + + $onsubmit_js.=' + + wdformjQuery("").val("'.$param['w_property'][0].'").appendTo("#form'.$form_id.'"); + + '; + + + + + + + + break; + + } + + + + case 'type_paypal_radio': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + $param['w_choices'] = explode('***',$param['w_choices']); + + $param['w_choices_price'] = explode('***',$param['w_choices_price']); + + $param['w_choices_checked'] = explode('***',$param['w_choices_checked']); + + $param['w_property'] = explode('***',$param['w_property']); + + $param['w_property_values'] = explode('***',$param['w_property_values']); + + + + foreach($param['w_choices_checked'] as $key => $choices_checked ) + + $param['w_choices_checked'][$key]=($choices_checked=='true' ? 'checked="checked"' : ''); + + + + $rep='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + + + foreach($param['w_choices'] as $key => $choice) + + { + + $post_value=$input_get->getString('wdform_'.$id1."_element".$form_id); + + if(isset($post_value)) + + $param['w_choices_checked'][$key]=(($post_value==$param['w_choices_price'][$key] && htmlspecialchars($choice)==htmlspecialchars($input_get->getString('wdform_'.$id1."_element_label".$form_id))) ? 'checked="checked"' : ''); + + + + $rep.='
'; + + + + } + + + + $rep.='
'; + + if($param['w_quantity']=="yes") + + $rep.='
'; + + + + if($param['w_property'][0]) + + foreach($param['w_property'] as $key => $property) + + { + + + + $rep.=' + +
+ +
+ + + +
'; + + } + + + + $rep.='
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(x.find(wdformjQuery("div[wdid='.$id1.'] input:checked")).length == 0) + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + + + return false; + + } + + } + + '; + + + + $onsubmit_js.=' + + wdformjQuery("").val( + + wdformjQuery("label[for=\'"+wdformjQuery("input[name^=\'wdform_'.$id1.'_element'.$form_id.'\']:checked").prop("id")+"\']").eq(0).text() + + ).appendTo("#form'.$form_id.'"); + + + + '; + + + + $onsubmit_js.=' + + wdformjQuery("").val("'.JText::_("WDF_QUANTITY").'").appendTo("#form'.$form_id.'"); + + '; + + $onsubmit_js.=' + + wdformjQuery("").val("'.$param['w_property'][0].'").appendTo("#form'.$form_id.'"); + + '; + + break; + + } + + + + + + case 'type_paypal_shipping': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + $param['w_choices'] = explode('***',$param['w_choices']); + + $param['w_choices_price'] = explode('***',$param['w_choices_price']); + + $param['w_choices_checked'] = explode('***',$param['w_choices_checked']); + + + + foreach($param['w_choices_checked'] as $key => $choices_checked ) + + $param['w_choices_checked'][$key]=($choices_checked=='true' ? 'checked="checked"' : ''); + + + + $rep='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'; + + + + foreach($param['w_choices'] as $key => $choice) + + { + + $post_value=$input_get->getString('wdform_'.$id1."_element".$form_id); + + + + if(isset($post_value)) + + $param['w_choices_checked'][$key]=(($post_value==$param['w_choices_price'][$key] && htmlspecialchars($choice)==htmlspecialchars($input_get->getString('wdform_'.$id1."_element_label".$form_id))) ? 'checked="checked"' : ''); + + + + $rep.='
'; + + + + } + + + + $rep.='
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(x.find(wdformjQuery("div[wdid='.$id1.'] input:checked")).length == 0) + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + + + return false; + + } + + } + + '; + + + + + + $onsubmit_js.=' + + wdformjQuery("").val( + + wdformjQuery("label[for=\'"+wdformjQuery("input[name^=\'wdform_'.$id1.'_element'.$form_id.'\']:checked").prop("id")+"\']").eq(0).text() + + ).appendTo("#form'.$form_id.'"); + + + + '; + + + + break; + + } + + + + case 'type_submit_reset': + + { + + + + $params_names=array('w_submit_title','w_reset_title','w_class','w_act'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + + + $param['w_act'] = ($param['w_act']=="false" ? 'style="display: none;"' : ""); + + + + $rep='
'; + + + + break; + + } + + + + case 'type_button': + + { + + + + $params_names=array('w_title','w_func','w_class'); + + $temp=$params; + + + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' '.$attr; + + } + + + + $param['w_title'] = explode('***',$param['w_title']); + + $param['w_func'] = explode('***',$param['w_func']); + + + + + + $rep.='
button_'.$id1.'
'; + + + + foreach($param['w_title'] as $key => $title) + + { + + $rep.=''; + + } + + $rep.='
'; + + break; + + } + + + + + + case 'type_star_rating': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class'); + + $temp=$params; + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' add_'.$attr; + + } + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + + + + + $images = ''; + + for($i=0; $i<$param['w_star_amount']; $i++) + + { + + $images .= ''; + + + + $onload_js .='wdformjQuery("#wdform_'.$id1.'_star_'.$i.'_'.$form_id.'").mouseover(function() {change_src('.$i.',"wdform_'.$id1.'", '.$form_id.', "'.$param['w_field_label_col'].'");});'; + + $onload_js .='wdformjQuery("#wdform_'.$id1.'_star_'.$i.'_'.$form_id.'").mouseout(function() {reset_src('.$i.',"wdform_'.$id1.'", '.$form_id.');});'; + + $onload_js .='wdformjQuery("#wdform_'.$id1.'_star_'.$i.'_'.$form_id.'").click(function() {select_star_rating('.$i.',"wdform_'.$id1.'", '.$form_id.',"'.$param['w_field_label_col'].'", "'.$param['w_star_amount'].'");});'; + + } + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + $rep.='
'.$images.'
'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_selected_star_amount'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + return false; + + } + + } + + '; + + + + + + + + $post=$input_get->getString('wdform_'.$id1.'_selected_star_amount'.$form_id); + + if(isset($post)) + + $onload_js .=' select_star_rating('.($post-1).',"wdform_'.$id1.'", '.$form_id.',"'.$param['w_field_label_col'].'", "'.$param['w_star_amount'].'");'; + + + + $onsubmit_js.=' + + wdformjQuery("").appendTo("#form'.$form_id.'"); + + '; + + break; + + } + + case 'type_scale_rating': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class'); + + $temp=$params; + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' add_'.$attr; + + } + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + + + $w_mini_labels = explode('***',$param['w_mini_labels']); + + + + $numbers = ''; + + $radio_buttons = ''; + + $to_check=0; + + $post_value=$input_get->getString('wdform_'.$id1.'_scale_radio'.$form_id); + + + + if(isset($post_value)) + + $to_check=$post_value; + + + + for($i=1; $i<=$param['w_scale_amount']; $i++) + + { + + $numbers.= '
'.$i.'
'; + + $radio_buttons.= '
'; + + } + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + + + $rep.='
'.$numbers.'
'.$radio_buttons.'
'; + + + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(x.find(wdformjQuery("div[wdid='.$id1.'] input:checked")).length == 0) + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + + + return false; + + } + + } + + '; + + + + $onsubmit_js.=' + + wdformjQuery("").appendTo("#form'.$form_id.'"); + + '; + + + + break; + + } + + + + case 'type_spinner': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_step', 'w_field_value', 'w_required','w_class'); + + $temp=$params; + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' add_'.$attr; + + } + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + $param['w_field_value']=$input_get->getString('wdform_'.$id1.'_element'.$form_id, $param['w_field_value']); + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + + + $rep.='
'; + + + + $onload_js .=' + + wdformjQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'")[0].spin = null; + + spinner = wdformjQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner(); + + spinner.spinner( "value", "'.($param['w_field_value']!= 'null' ? $param['w_field_value'] : '').'"); + + wdformjQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ min: "'.$param['w_field_min_value'].'"}); + + wdformjQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ max: "'.$param['w_field_max_value'].'"}); + + wdformjQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ step: "'.$param['w_field_step'].'"}); + + '; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" ); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").focus(); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( wdformjQuery(this).val()!="" ) wdformjQuery(this).removeClass("form-error"); else wdformjQuery(this).addClass("form-error");}); + + return false; + + } + + } + + '; + + + + break; + + } + + + + case 'type_slider': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_value', 'w_required','w_class'); + + $temp=$params; + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' add_'.$attr; + + } + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + $param['w_field_value']=$input_get->getString('wdform_'.$id1.'_slider_value'.$form_id, $param['w_field_value']); + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + + + + + $rep.='
'.$param['w_field_min_value'].'
'.$param['w_field_value'].'
'.$param['w_field_max_value'].'
'; + + + + + + $onload_js .=' + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'")[0].slide = null; + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'").slider({ + + range: "min", + + value: eval('.$param['w_field_value'].'), + + min: eval('.$param['w_field_min_value'].'), + + max: eval('.$param['w_field_max_value'].'), + + slide: function( event, ui ) { + + + + wdformjQuery("#wdform_'.$id1.'_element_value'.$form_id.'").html("" + ui.value) + + wdformjQuery("#wdform_'.$id1.'_slider_value'.$form_id.'").val("" + ui.value) + + + + } + + }); + + '; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_slider_value'.$form_id.'").val()=='.$param['w_field_min_value'].') + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + return false; + + } + + } + + '; + + + + break; + + } + + + + + + case 'type_range': + + { + + $params_names=array('w_field_label_size','w_field_label_pos','w_field_range_width','w_field_range_step','w_field_value1', 'w_field_value2', 'w_mini_labels', 'w_required','w_class'); + + $temp=$params; + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' add_'.$attr; + + } + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + $param['w_field_value1']=$input_get->getString('wdform_'.$id1.'_element'.$form_id.'0', $param['w_field_value1']); + + $param['w_field_value2']=$input_get->getString('wdform_'.$id1.'_element'.$form_id.'1', $param['w_field_value2']); + + + + $w_mini_labels = explode('***',$param['w_mini_labels']); + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + + + + + $rep.='
'; + + + + + + + + + + $onload_js .=' + + wdformjQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'0")[0].spin = null; + + wdformjQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'1")[0].spin = null; + + + + spinner0 = wdformjQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'0").spinner(); + + spinner0.spinner( "value", "'.($param['w_field_value1']!= 'null' ? $param['w_field_value1'] : '').'"); + + wdformjQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ step: '.$param['w_field_range_step'].'}); + + + + spinner1 = wdformjQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'1").spinner(); + + spinner1.spinner( "value", "'.($param['w_field_value2']!= 'null' ? $param['w_field_value2'] : '').'"); + + wdformjQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ step: '.$param['w_field_range_step'].'}); + + '; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'0").val()=="" || wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'1").val()=="") + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'0").focus(); + + return false; + + } + + } + + '; + + + + break; + + } + + + + case 'type_grading': + + { + + $params_names=array('w_field_label_size','w_field_label_pos', 'w_items', 'w_total', 'w_required','w_class'); + + $temp=$params; + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' add_'.$attr; + + } + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + + + $w_items = explode('***',$param['w_items']); + + $required_check='true'; + + $w_items_labels =implode(':',$w_items); + + + + $grading_items =''; + + + + + + for($i=0; $igetString('wdform_'.$id1.'_element'.$form_id.'_'.$i, ''); + + + + $grading_items .= '
'; + + + + $required_check.=' && wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'_'.$i.'").val()==""'; + + } + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + + + + + $rep.='
'.$grading_items.'
Total: 0/'.$param['w_total'].'
'; + + + + $onload_js.=' + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.' input").change(function() {sum_grading_values("wdform_'.$id1.'",'.$form_id.');});'; + + + + $onload_js.=' + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.' input").keyup(function() {sum_grading_values("wdform_'.$id1.'",'.$form_id.');});'; + + + + $onload_js.=' + + sum_grading_values("wdform_'.$id1.'",'.$form_id.');'; + + + + if($required) + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if('.$required_check.') + + { + + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + + wdformjQuery("#wdform_'.$id1.'_element'.$form_id.'0").focus(); + + return false; + + } + + } + + + + '; + + + + $check_js.=' + + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + + { + + if(parseInt(wdformjQuery("#wdform_'.$id1.'_sum_element'.$form_id.'").html()) > '.$param['w_total'].') + + { + + alert("'.addslashes(JText::sprintf('WDF_INVALID_GRADING', '"'.$label.'"', $param['w_total'] )).'"); + + return false; + + } + + } + + '; + + + + $onsubmit_js.=' + + wdformjQuery("").appendTo("#form'.$form_id.'"); + + '; + + + + break; + + } + + case 'type_matrix': + + { + + $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class'); + + $temp=$params; + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' add_'.$attr; + + } + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + $required = ($param['w_required']=="yes" ? true : false); + + + + + + $w_rows = explode('***',$param['w_rows']); + + $w_columns = explode('***',$param['w_columns']); + + + + + + $column_labels =''; + + + + for($i=1; $i
'; + + } + + + + $rows_columns = ''; + + + + + + + + for($i=1; $i
'; + + + + + + for($k=1; $kgetString('wdform_'.$id1.'_input_element'.$form_id.''.$i); + + + + if(isset($post_value)) + + $to_check=$post_value; + + + + $rows_columns .= '
'; + + + + } + + else + + if($param['w_field_input_type']=='checkbox') + + { + + $to_check=0; + + $post_value=$input_get->getString('wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k); + + + + if(isset($post_value)) + + $to_check=$post_value; + + + + $rows_columns .= '
'; + + } + + else + + if($param['w_field_input_type']=='text') + + $rows_columns .= ''; + + else + + if($param['w_field_input_type']=='select') + + $rows_columns .= ''; + + $rows_columns.=''; + + } + + + + $rows_columns .= ''; + + } + + + + $rep ='
'.$label.''; + + if($required) + + $rep.=''.$required_sym.''; + + + + + + + + $rep.='
'.$column_labels.'
'.$rows_columns.'
'; + + + + $onsubmit_js.=' + + wdformjQuery("").appendTo("#form'.$form_id.'"); + + '; + if($required) + { + if($param['w_field_input_type']=='radio') + { + $check_js.=' + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + { + var radio_checked=true; + for(var k=1; k<'.count($w_rows).';k++) + { + if(x.find(wdformjQuery("div[wdid='.$id1.']")).find(wdformjQuery("div[row="+k+"]")).find(wdformjQuery("input[type=\'radio\']:checked")).length == 0) + { + radio_checked=false; + break; + } + } + + if(radio_checked==false) + { + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + return false; + } + } + '; + } + + if($param['w_field_input_type']=='checkbox') + { + $check_js.=' + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + { + if(x.find(wdformjQuery("div[wdid='.$id1.']")).find(wdformjQuery("input[type=\'checkbox\']:checked")).length == 0) + { + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + return false; + } + } + + '; + } + + if($param['w_field_input_type']=='text') + { + $check_js.=' + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + { + if(x.find(wdformjQuery("div[wdid='.$id1.']")).find(wdformjQuery("input[type=\'text\']")).filter(function() {return this.value.length !== 0;}).length == 0) + { + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + return false; + } + } + + '; + } + + if($param['w_field_input_type']=='select') + { + $check_js.=' + if(x.find(wdformjQuery("div[wdid='.$id1.']")).length != 0 && x.find(wdformjQuery("div[wdid='.$id1.']")).css("display") != "none") + { + if(x.find(wdformjQuery("div[wdid='.$id1.']")).find(wdformjQuery("select")).filter(function() {return this.value.length !== 0;}).length == 0) + { + alert("'.addslashes(JText::sprintf('WDF_REQUIRED_FIELD', '"'.$label.'"') ).'"); + old_bg=x.find(wdformjQuery("div[wdid='.$id1.']")).css("background-color"); + x.find(wdformjQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false }); + return false; + } + } + + '; + } + } + + + break; + + } + + + + case 'type_paypal_total': + + { + + + + + + $params_names=array('w_field_label_size','w_field_label_pos','w_class'); + + $temp=$params; + + foreach($params_names as $params_name ) + + { + + $temp=explode('*:*'.$params_name.'*:*',$temp); + + $param[$params_name] = $temp[0]; + + $temp=$temp[1]; + + } + + + + if($temp) + + { + + $temp =explode('*:*w_attr_name*:*',$temp); + + $attrs = array_slice($temp,0, count($temp)-1); + + foreach($attrs as $attr) + + $param['attributes'] = $param['attributes'].' add_'.$attr; + + } + + + + $param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : ""); + + $param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;"); + + + + + + + + $rep ='
'.$label.''; + + + + $rep.='
'; + + + + $onload_js .='set_total_value('.$form_id.');'; + + + + break; + + } + + + + + + + + } + + + + $form=str_replace('%'.$id1.' - '.$labels[$id1s_key].'%', $rep, $form); + + } + + + + } + + + $onsubmit_js.=' + var disabled_fields =""; + wdformjQuery("div[wdid]").each(function() { + if(wdformjQuery(this).css("display")=="none") + { + disabled_fields += wdformjQuery(this).attr("wdid"); + disabled_fields += ","; + } + + if(disabled_fields) + wdformjQuery("").appendTo("#form'.$form_id.'"); + + })'; + + + $rep1=array('form_id_temp'); + + $rep2=array($id); + + + + $form = str_replace($rep1,$rep2,$form); + + + + echo $form; + +?> + + + +
+ + + + + + + + Title", + + "First", + + "Last", + + "Middle", + + "January", + + "February", + + "March", + + "April", + + "May", + + "June", + + "July", + + "August", + + "September", + + "October", + + "November", + + "December", + + "Street Address", + + "Street Address Line 2", + + "City", + + "State / Province / Region", + + "Postal / Zip Code", + + "Country", + + "Area Code", + + "Phone Number", + + "Dollars", + + + + "Cents", + + + + " $ ", + + + + "Quantity", + + "From", + + "To", + + "$300", + + "product 1 $100", + + "product 2 $200", + + + + 'class="captcha_img"', + + + + 'form_id_temp', + + '../index.php?option=com_formmaker&view=wdcaptcha', + + 'style="padding-right:170px"'); + + + + $rep2=array( + + JText::_("WDF_NAME_TITLE_LABEL"), + + JText::_("WDF_FIRST_NAME_LABEL"), + + JText::_("WDF_LAST_NAME_LABEL"), + + JText::_("WDF_MIDDLE_NAME_LABEL"), + + JText::_("January"), + + JText::_("February"), + + JText::_("March"), + + JText::_("April"), + + JText::_("May"), + + JText::_("June"), + + JText::_("July"), + + JText::_("August"), + + JText::_("September"), + + JText::_("October"), + + JText::_("November"), + + JText::_("December"), + + JText::_("WDF_STREET_ADDRESS"), + + JText::_("WDF_STREET_ADDRESS2"), + + JText::_("WDF_CITY"), + + JText::_("WDF_STATE"), + + JText::_("WDF_POSTAL"), + + JText::_("WDF_COUNTRY"), + + JText::_("WDF_AREA_CODE"), + + JText::_("WDF_PHONE_NUMBER"), + + JText::_("WDF_DOLLARS"), + + + + JText::_("WDF_CENTS"), + + + + ' '.$form_currency.' ', + + + + JText::_("WDF_QUANTITY"), + + JText::_("WDF_FROM"), + + JText::_("WDF_TO"), + + '', + + '', + + '', + + 'class="captcha_img" style="display:none"', + + + + $id, + + 'index.php?option=com_formmaker&view=wdcaptcha', + + ''); + + + + $untilupload = str_replace($rep1,$rep2,$row->form_front); + + while(strpos($untilupload, "***destinationskizb")>0) + + { + + $pos1 = strpos($untilupload, "***destinationskizb"); + + $pos2 = strpos($untilupload, "***destinationverj"); + + $untilupload=str_replace(substr($untilupload, $pos1, $pos2-$pos1+22), "", $untilupload); + + } + +echo $untilupload; + + + +$is_recaptcha=false; + + + +?> + + + + + + + +addScriptDeclaration('var RecaptchaOptions = { + +theme: "'.$row->recaptcha_theme.'" + +}; + +'); + + + +?> + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/content/loadformmaker/loadformmaker.xml b/plugins/content/loadformmaker/loadformmaker.xml new file mode 100644 index 0000000..2167de7 --- /dev/null +++ b/plugins/content/loadformmaker/loadformmaker.xml @@ -0,0 +1,18 @@ + + + Content - Load Form Maker + Web Dorado + February 2012 + Web-Dorado + GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html + Copyright (C) 2014 Web-Dorado.com All rights reserved. + info@web-dorado.com + http://web-dorado.com/ + 3.4 + Form Maker is a modern and advanced tool for creating Joomla! forms easily and fast. + + + loadformmaker.php + index.html + + diff --git a/plugins/content/loadmodule/index.html b/plugins/content/loadmodule/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/content/loadmodule/index.html @@ -0,0 +1 @@ + diff --git a/plugins/content/loadmodule/loadmodule.php b/plugins/content/loadmodule/loadmodule.php new file mode 100644 index 0000000..7e166cd --- /dev/null +++ b/plugins/content/loadmodule/loadmodule.php @@ -0,0 +1,190 @@ +text is also available + * @param mixed &$params The article params + * @param integer $page The 'page' number + * + * @return mixed true if there is an error. Void otherwise. + * + * @since 1.6 + */ + public function onContentPrepare($context, &$article, &$params, $page = 0) + { + // Don't run this plugin when the content is being indexed + if ($context === 'com_finder.indexer') + { + return true; + } + + // Simple performance check to determine whether bot should process further + if (strpos($article->text, 'loadposition') === false && strpos($article->text, 'loadmodule') === false) + { + return true; + } + + // Expression to search for (positions) + $regex = '/{loadposition\s(.*?)}/i'; + $style = $this->params->def('style', 'none'); + + // Expression to search for(modules) + $regexmod = '/{loadmodule\s(.*?)}/i'; + $stylemod = $this->params->def('style', 'none'); + + // Find all instances of plugin and put in $matches for loadposition + // $matches[0] is full pattern match, $matches[1] is the position + preg_match_all($regex, $article->text, $matches, PREG_SET_ORDER); + + // No matches, skip this + if ($matches) + { + foreach ($matches as $match) + { + $matcheslist = explode(',', $match[1]); + + // We may not have a module style so fall back to the plugin default. + if (!array_key_exists(1, $matcheslist)) + { + $matcheslist[1] = $style; + } + + $position = trim($matcheslist[0]); + $style = trim($matcheslist[1]); + + $output = $this->_load($position, $style); + + // We should replace only first occurrence in order to allow positions with the same name to regenerate their content: + $article->text = preg_replace("|$match[0]|", addcslashes($output, '\\$'), $article->text, 1); + $style = $this->params->def('style', 'none'); + } + } + + // Find all instances of plugin and put in $matchesmod for loadmodule + preg_match_all($regexmod, $article->text, $matchesmod, PREG_SET_ORDER); + + // If no matches, skip this + if ($matchesmod) + { + foreach ($matchesmod as $matchmod) + { + $matchesmodlist = explode(',', $matchmod[1]); + + // We may not have a specific module so set to null + if (!array_key_exists(1, $matchesmodlist)) + { + $matchesmodlist[1] = null; + } + + // We may not have a module style so fall back to the plugin default. + if (!array_key_exists(2, $matchesmodlist)) + { + $matchesmodlist[2] = $stylemod; + } + + $module = trim($matchesmodlist[0]); + $name = htmlspecialchars_decode(trim($matchesmodlist[1])); + $stylemod = trim($matchesmodlist[2]); + + // $match[0] is full pattern match, $match[1] is the module,$match[2] is the title + $output = $this->_loadmod($module, $name, $stylemod); + + // We should replace only first occurrence in order to allow positions with the same name to regenerate their content: + $article->text = preg_replace(addcslashes("|$matchmod[0]|", '()'), addcslashes($output, '\\$'), $article->text, 1); + $stylemod = $this->params->def('style', 'none'); + } + } + } + + /** + * Loads and renders the module + * + * @param string $position The position assigned to the module + * @param string $style The style assigned to the module + * + * @return mixed + * + * @since 1.6 + */ + protected function _load($position, $style = 'none') + { + self::$modules[$position] = ''; + $document = JFactory::getDocument(); + $renderer = $document->loadRenderer('module'); + $modules = JModuleHelper::getModules($position); + $params = array('style' => $style); + ob_start(); + + foreach ($modules as $module) + { + echo $renderer->render($module, $params); + } + + self::$modules[$position] = ob_get_clean(); + + return self::$modules[$position]; + } + + /** + * This is always going to get the first instance of the module type unless + * there is a title. + * + * @param string $module The module title + * @param string $title The title of the module + * @param string $style The style of the module + * + * @return mixed + * + * @since 1.6 + */ + protected function _loadmod($module, $title, $style = 'none') + { + self::$mods[$module] = ''; + $document = JFactory::getDocument(); + $renderer = $document->loadRenderer('module'); + $mod = JModuleHelper::getModule($module, $title); + + // If the module without the mod_ isn't found, try it with mod_. + // This allows people to enter it either way in the content + if (!isset($mod)) + { + $name = 'mod_' . $module; + $mod = JModuleHelper::getModule($name, $title); + } + + $params = array('style' => $style); + ob_start(); + + if ($mod->id) + { + echo $renderer->render($mod, $params); + } + + self::$mods[$module] = ob_get_clean(); + + return self::$mods[$module]; + } +} diff --git a/plugins/content/loadmodule/loadmodule.xml b/plugins/content/loadmodule/loadmodule.xml new file mode 100644 index 0000000..8618790 --- /dev/null +++ b/plugins/content/loadmodule/loadmodule.xml @@ -0,0 +1,38 @@ + + + plg_content_loadmodule + Joomla! Project + November 2005 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_LOADMODULE_XML_DESCRIPTION + + loadmodule.php + + + en-GB.plg_content_loadmodule.ini + en-GB.plg_content_loadmodule.sys.ini + + + +
+ + + + + + + +
+
+
+
diff --git a/plugins/content/pagebreak/index.html b/plugins/content/pagebreak/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/content/pagebreak/index.html @@ -0,0 +1 @@ + diff --git a/plugins/content/pagebreak/pagebreak.php b/plugins/content/pagebreak/pagebreak.php new file mode 100644 index 0000000..4ba6641 --- /dev/null +++ b/plugins/content/pagebreak/pagebreak.php @@ -0,0 +1,381 @@ +Usage: + *
+ *
+ * or + *
+ * or + *
+ * or + *
+ * + * @since 1.6 + */ +class PlgContentPagebreak extends JPlugin +{ + /** + * Plugin that adds a pagebreak into the text and truncates text at that point + * + * @param string $context The context of the content being passed to the plugin. + * @param object &$row The article object. Note $article->text is also available + * @param mixed &$params The article params + * @param integer $page The 'page' number + * + * @return mixed Always returns void or true + * + * @since 1.6 + */ + public function onContentPrepare($context, &$row, &$params, $page = 0) + { + $canProceed = $context === 'com_content.article'; + + if (!$canProceed) + { + return; + } + + $style = $this->params->get('style', 'pages'); + + // Expression to search for. + $regex = '##iU'; + + $input = JFactory::getApplication()->input; + + $print = $input->getBool('print'); + $showall = $input->getBool('showall'); + + if (!$this->params->get('enabled', 1)) + { + $print = true; + } + + if ($print) + { + $row->text = preg_replace($regex, '
', $row->text); + + return true; + } + + // Simple performance check to determine whether bot should process further. + if (StringHelper::strpos($row->text, 'class="system-pagebreak') === false) + { + if ($page > 0) + { + throw new Exception(JText::_('JERROR_PAGE_NOT_FOUND'), 404); + } + + return true; + } + + $view = $input->getString('view'); + $full = $input->getBool('fullview'); + + if (!$page) + { + $page = 0; + } + + if ($full || $view !== 'article' || $params->get('intro_only') || $params->get('popup')) + { + $row->text = preg_replace($regex, '', $row->text); + + return; + } + + // Load plugin language files only when needed (ex: not needed if no system-pagebreak class exists). + $this->loadLanguage(); + + // Find all instances of plugin and put in $matches. + $matches = array(); + preg_match_all($regex, $row->text, $matches, PREG_SET_ORDER); + + if ($showall && $this->params->get('showall', 1)) + { + $hasToc = $this->params->get('multipage_toc', 1); + + if ($hasToc) + { + // Display TOC. + $page = 1; + $this->_createToc($row, $matches, $page); + } + else + { + $row->toc = ''; + } + + $row->text = preg_replace($regex, '
', $row->text); + + return true; + } + + // Split the text around the plugin. + $text = preg_split($regex, $row->text); + + if (!isset($text[$page])) + { + throw new Exception(JText::_('JERROR_PAGE_NOT_FOUND'), 404); + } + + // Count the number of pages. + $n = count($text); + + // We have found at least one plugin, therefore at least 2 pages. + if ($n > 1) + { + $title = $this->params->get('title', 1); + $hasToc = $this->params->get('multipage_toc', 1); + + // Adds heading or title to Title. + if ($title && $page && isset($matches[$page - 1], $matches[$page - 1][2])) + { + $attrs = JUtility::parseAttributes($matches[$page - 1][1]); + + if (isset($attrs['title'])) + { + $row->page_title = $attrs['title']; + } + } + + // Reset the text, we already hold it in the $text array. + $row->text = ''; + + if ($style === 'pages') + { + // Display TOC. + if ($hasToc) + { + $this->_createToc($row, $matches, $page); + } + else + { + $row->toc = ''; + } + + // Traditional mos page navigation + $pageNav = new JPagination($n, $page, 1); + + // Page counter. + $row->text .= ''; + + // Page text. + $text[$page] = str_replace('
', '', $text[$page]); + $row->text .= $text[$page]; + + // $row->text .= '
'; + $row->text .= '
'; + + // Adds navigation between pages to bottom of text. + if ($hasToc) + { + $this->_createNavigation($row, $page, $n); + } + + // Page links shown at bottom of page if TOC disabled. + if (!$hasToc) + { + $row->text .= $pageNav->getPagesLinks(); + } + + $row->text .= '
'; + } + else + { + $t[] = $text[0]; + + $t[] = (string) JHtml::_($style . '.start', 'article' . $row->id . '-' . $style); + + foreach ($text as $key => $subtext) + { + if ($key >= 1) + { + $match = $matches[$key - 1]; + $match = (array) JUtility::parseAttributes($match[0]); + + if (isset($match['alt'])) + { + $title = stripslashes($match['alt']); + } + elseif (isset($match['title'])) + { + $title = stripslashes($match['title']); + } + else + { + $title = JText::sprintf('PLG_CONTENT_PAGEBREAK_PAGE_NUM', $key + 1); + } + + $t[] = (string) JHtml::_($style . '.panel', $title, 'article' . $row->id . '-' . $style . $key); + } + + $t[] = (string) $subtext; + } + + $t[] = (string) JHtml::_($style . '.end'); + + $row->text = implode(' ', $t); + } + } + + return true; + } + + /** + * Creates a Table of Contents for the pagebreak + * + * @param object &$row The article object. Note $article->text is also available + * @param array &$matches Array of matches of a regex in onContentPrepare + * @param integer &$page The 'page' number + * + * @return void + * + * @since 1.6 + */ + protected function _createToc(&$row, &$matches, &$page) + { + $heading = isset($row->title) ? $row->title : JText::_('PLG_CONTENT_PAGEBREAK_NO_TITLE'); + $input = JFactory::getApplication()->input; + $limitstart = $input->getUInt('limitstart', 0); + $showall = $input->getInt('showall', 0); + + // TOC header. + $row->toc = '
'; + + if ($this->params->get('article_index') == 1) + { + $headingtext = JText::_('PLG_CONTENT_PAGEBREAK_ARTICLE_INDEX'); + + if ($this->params->get('article_index_text')) + { + $headingtext = htmlspecialchars($this->params->get('article_index_text'), ENT_QUOTES, 'UTF-8'); + } + + $row->toc .= '

' . $headingtext . '

'; + } + + // TOC first Page link. + $class = ($limitstart === 0 && $showall === 0) ? 'toclink active' : 'toclink'; + $row->toc .= '
'; + } + + /** + * Creates the navigation for the item + * + * @param object &$row The article object. Note $article->text is also available + * @param int $page The total number of pages + * @param int $n The page number + * + * @return void + * + * @since 1.6 + */ + protected function _createNavigation(&$row, $page, $n) + { + $pnSpace = ''; + + if (JText::_('JGLOBAL_LT') || JText::_('JGLOBAL_LT')) + { + $pnSpace = ' '; + } + + if ($page < $n - 1) + { + $page_next = $page + 1; + + $link_next = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid, $row->language) . '&showall=&limitstart=' . $page_next); + + // Next >> + $next = '' . JText::_('JNEXT') . $pnSpace . JText::_('JGLOBAL_GT') . JText::_('JGLOBAL_GT') . ''; + } + else + { + $next = JText::_('JNEXT'); + } + + if ($page > 0) + { + $page_prev = $page - 1 === 0 ? '' : $page - 1; + + $link_prev = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid, $row->language) . '&showall=&limitstart=' . $page_prev); + + // << Prev + $prev = '' . JText::_('JGLOBAL_LT') . JText::_('JGLOBAL_LT') . $pnSpace . JText::_('JPREV') . ''; + } + else + { + $prev = JText::_('JPREV'); + } + + $row->text .= '
  • ' . $prev . '
  • ' . $next . '
'; + } +} diff --git a/plugins/content/pagebreak/pagebreak.xml b/plugins/content/pagebreak/pagebreak.xml new file mode 100644 index 0000000..3361bb8 --- /dev/null +++ b/plugins/content/pagebreak/pagebreak.xml @@ -0,0 +1,95 @@ + + + plg_content_pagebreak + Joomla! Project + November 2005 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_CONTENT_PAGEBREAK_XML_DESCRIPTION + + pagebreak.php + + + en-GB.plg_content_pagebreak.ini + en-GB.plg_content_pagebreak.sys.ini + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
diff --git a/plugins/content/pagenavigation/index.html b/plugins/content/pagenavigation/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/content/pagenavigation/index.html @@ -0,0 +1 @@ + diff --git a/plugins/content/pagenavigation/pagenavigation.php b/plugins/content/pagenavigation/pagenavigation.php new file mode 100644 index 0000000..015c405 --- /dev/null +++ b/plugins/content/pagenavigation/pagenavigation.php @@ -0,0 +1,263 @@ +input->get('view'); + $print = $app->input->getBool('print'); + + if ($print) + { + return false; + } + + if ($context === 'com_content.article' && $view === 'article' && $params->get('show_item_navigation')) + { + $db = JFactory::getDbo(); + $user = JFactory::getUser(); + $lang = JFactory::getLanguage(); + $nullDate = $db->getNullDate(); + + $date = JFactory::getDate(); + $now = $date->toSql(); + + $uid = $row->id; + $option = 'com_content'; + $canPublish = $user->authorise('core.edit.state', $option . '.article.' . $row->id); + + /** + * The following is needed as different menu items types utilise a different param to control ordering. + * For Blogs the `orderby_sec` param is the order controlling param. + * For Table and List views it is the `orderby` param. + **/ + $params_list = $params->toArray(); + + if (array_key_exists('orderby_sec', $params_list)) + { + $order_method = $params->get('orderby_sec', ''); + } + else + { + $order_method = $params->get('orderby', ''); + } + + // Additional check for invalid sort ordering. + if ($order_method === 'front') + { + $order_method = ''; + } + + // Get the order code + $orderDate = $params->get('order_date'); + $queryDate = $this->getQueryDate($orderDate); + + // Determine sort order. + switch ($order_method) + { + case 'date' : + $orderby = $queryDate; + break; + case 'rdate' : + $orderby = $queryDate . ' DESC '; + break; + case 'alpha' : + $orderby = 'a.title'; + break; + case 'ralpha' : + $orderby = 'a.title DESC'; + break; + case 'hits' : + $orderby = 'a.hits'; + break; + case 'rhits' : + $orderby = 'a.hits DESC'; + break; + case 'order' : + $orderby = 'a.ordering'; + break; + case 'author' : + $orderby = 'a.created_by_alias, u.name'; + break; + case 'rauthor' : + $orderby = 'a.created_by_alias DESC, u.name DESC'; + break; + case 'front' : + $orderby = 'f.ordering'; + break; + default : + $orderby = 'a.ordering'; + break; + } + + $xwhere = ' AND (a.state = 1 OR a.state = -1)' + . ' AND (publish_up = ' . $db->quote($nullDate) . ' OR publish_up <= ' . $db->quote($now) . ')' + . ' AND (publish_down = ' . $db->quote($nullDate) . ' OR publish_down >= ' . $db->quote($now) . ')'; + + // Array of articles in same category correctly ordered. + $query = $db->getQuery(true); + + // Sqlsrv changes + $case_when = ' CASE WHEN ' . $query->charLength('a.alias', '!=', '0'); + $a_id = $query->castAsChar('a.id'); + $case_when .= ' THEN ' . $query->concatenate(array($a_id, 'a.alias'), ':'); + $case_when .= ' ELSE ' . $a_id . ' END as slug'; + + $case_when1 = ' CASE WHEN ' . $query->charLength('cc.alias', '!=', '0'); + $c_id = $query->castAsChar('cc.id'); + $case_when1 .= ' THEN ' . $query->concatenate(array($c_id, 'cc.alias'), ':'); + $case_when1 .= ' ELSE ' . $c_id . ' END as catslug'; + $query->select('a.id, a.title, a.catid, a.language,' . $case_when . ',' . $case_when1) + ->from('#__content AS a') + ->join('LEFT', '#__categories AS cc ON cc.id = a.catid'); + + if ($order_method === 'author' || $order_method === 'rauthor') + { + $query->select('a.created_by, u.name'); + $query->join('LEFT', '#__users AS u ON u.id = a.created_by'); + } + + $query->where( + 'a.catid = ' . (int) $row->catid . ' AND a.state = ' . (int) $row->state + . ($canPublish ? '' : ' AND a.access IN (' . implode(',', JAccess::getAuthorisedViewLevels($user->id)) . ') ') . $xwhere + ); + $query->order($orderby); + + if ($app->isClient('site') && $app->getLanguageFilter()) + { + $query->where('a.language in (' . $db->quote($lang->getTag()) . ',' . $db->quote('*') . ')'); + } + + $db->setQuery($query); + $list = $db->loadObjectList('id'); + + // This check needed if incorrect Itemid is given resulting in an incorrect result. + if (!is_array($list)) + { + $list = array(); + } + + reset($list); + + // Location of current content item in array list. + $location = array_search($uid, array_keys($list)); + $rows = array_values($list); + + $row->prev = null; + $row->next = null; + + if ($location - 1 >= 0) + { + // The previous content item cannot be in the array position -1. + $row->prev = $rows[$location - 1]; + } + + if (($location + 1) < count($rows)) + { + // The next content item cannot be in an array position greater than the number of array postions. + $row->next = $rows[$location + 1]; + } + + if ($row->prev) + { + $row->prev_label = ($this->params->get('display', 0) == 0) ? JText::_('JPREV') : $row->prev->title; + $row->prev = JRoute::_(ContentHelperRoute::getArticleRoute($row->prev->slug, $row->prev->catid, $row->prev->language)); + } + else + { + $row->prev_label = ''; + $row->prev = ''; + } + + if ($row->next) + { + $row->next_label = ($this->params->get('display', 0) == 0) ? JText::_('JNEXT') : $row->next->title; + $row->next = JRoute::_(ContentHelperRoute::getArticleRoute($row->next->slug, $row->next->catid, $row->next->language)); + } + else + { + $row->next_label = ''; + $row->next = ''; + } + + // Output. + if ($row->prev || $row->next) + { + // Get the path for the layout file + $path = JPluginHelper::getLayoutPath('content', 'pagenavigation'); + + // Render the pagenav + ob_start(); + include $path; + $row->pagination = ob_get_clean(); + + $row->paginationposition = $this->params->get('position', 1); + + // This will default to the 1.5 and 1.6-1.7 behavior. + $row->paginationrelative = $this->params->get('relative', 0); + } + } + } + + /** + * Translate an order code to a field for primary ordering. + * + * @param string $orderDate The ordering code. + * + * @return string The SQL field(s) to order by. + * + * @since 3.3 + */ + private static function getQueryDate($orderDate) + { + $db = JFactory::getDbo(); + + switch ($orderDate) + { + // Use created if modified is not set + case 'modified' : + $queryDate = ' CASE WHEN a.modified = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.modified END'; + break; + + // Use created if publish_up is not set + case 'published' : + $queryDate = ' CASE WHEN a.publish_up = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_up END '; + break; + + // Use created as default + case 'created' : + default : + $queryDate = ' a.created '; + break; + } + + return $queryDate; + } +} diff --git a/plugins/content/pagenavigation/pagenavigation.xml b/plugins/content/pagenavigation/pagenavigation.xml new file mode 100644 index 0000000..d550286 --- /dev/null +++ b/plugins/content/pagenavigation/pagenavigation.xml @@ -0,0 +1,60 @@ + + + plg_content_pagenavigation + Joomla! Project + January 2006 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_PAGENAVIGATION_XML_DESCRIPTION + + pagenavigation.php + tmpl + + + en-GB.plg_content_pagenavigation.ini + en-GB.plg_content_pagenavigation.sys.ini + + + + +
+ + + + + + + + + + + + + + + +
+
+
+
diff --git a/plugins/content/pagenavigation/tmpl/default.php b/plugins/content/pagenavigation/tmpl/default.php new file mode 100644 index 0000000..be90841 --- /dev/null +++ b/plugins/content/pagenavigation/tmpl/default.php @@ -0,0 +1,31 @@ + + + diff --git a/plugins/content/pagenavigation/tmpl/index.html b/plugins/content/pagenavigation/tmpl/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/content/pagenavigation/tmpl/index.html @@ -0,0 +1 @@ + diff --git a/plugins/content/phocadownload/index.html b/plugins/content/phocadownload/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/plugins/content/phocadownload/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/content/phocadownload/phocadownload.php b/plugins/content/phocadownload/phocadownload.php new file mode 100644 index 0000000..62a5e13 --- /dev/null +++ b/plugins/content/phocadownload/phocadownload.php @@ -0,0 +1,640 @@ +loadLanguage(); + } + + public function onContentPrepare($context, &$article, &$params, $page = 0) { + + $document = JFactory::getDocument(); + $db = JFactory::getDBO(); + $iSize = $this->params->get('icon_size', 32); + $iMime = $this->params->get('file_icon_mime', 0); + $component = 'com_phocadownload'; + $paramsC = JComponentHelper::getParams($component) ; + $ordering = $paramsC->get( 'file_ordering', 1 ); + + + // Start Plugin + $regex_one = '/({phocadownload\s*)(.*?)(})/si'; + $regex_all = '/{phocadownload\s*.*?}/si'; + $matches = array(); + $count_matches = preg_match_all($regex_all,$article->text,$matches,PREG_OFFSET_CAPTURE | PREG_PATTERN_ORDER); + + JHTML::stylesheet( 'media/com_phocadownload/css/main/phocadownload.css' ); + JHTML::stylesheet( 'media/plg_content_phocadownload/css/phocadownload.css' ); + + + // Start if count_matches + if ($count_matches != 0) { + + $l = new PhocaDownloadLayout(); + + // Start CSS + for($i = 0; $i < $count_matches; $i++) { + + $view = ''; + $id = ''; + $text = ''; + $target = ''; + $playerwidth = $paramsC->get( 'player_width', 328 ); + $playerheight = $paramsC->get( 'player_height', 200 ); + $previewwidth = $paramsC->get( 'preview_width', 640 ); + $previewheight = $paramsC->get( 'preview_height', 480 ); + $playerheightmp3 = $paramsC->get( 'player_mp3_height', 30 ); + $url = ''; + $youtubewidth = 448; + $youtubeheight = 336; + $fileView = $paramsC->get( 'display_file_view', 0 ); + $previewWindow = $paramsC->get( 'preview_popup_window', 0 ); + $playWindow = $paramsC->get( 'play_popup_window', 0 ); + $limit = 5; + + + // Get plugin parameters + $phocadownload = $matches[0][$i][0]; + preg_match($regex_one,$phocadownload,$phocadownload_parts); + $parts = explode("|", $phocadownload_parts[2]); + $values_replace = array ("/^'/", "/'$/", "/^'/", "/'$/", "/
/"); + + + foreach($parts as $key => $value) { + $values = explode("=", $value, 2); + + foreach ($values_replace as $key2 => $values2) { + $values = preg_replace($values2, '', $values); + } + + // Get plugin parameters from article + if($values[0]=='view') {$view = $values[1];} + else if($values[0]=='id') {$id = $values[1];} + else if($values[0]=='text') {$text = $values[1];} + else if($values[0]=='target') {$target = $values[1];} + else if($values[0]=='playerwidth') {$playerwidth = (int)$values[1];} + else if($values[0]=='playerheight') {$playerheight = (int)$values[1];} + else if($values[0]=='playerheightmp3') {$playerheightmp3 = (int)$values[1];} + + else if($values[0]=='previewwidth') {$previewwidth = (int)$values[1];} + else if($values[0]=='previewheight') {$previewheight = (int)$values[1];} + + else if($values[0]=='youtubewidth') {$youtubewidth = (int)$values[1];} + else if($values[0]=='youtubeheight') {$youtubeheight = (int)$values[1];} + + else if($values[0]=='previewwindow') {$previewWindow = (int)$values[1];} + else if($values[0]=='playwindow') {$playWindow = (int)$values[1];} + else if($values[0]=='limit') {$limit = (int)$values[1];} + + else if($values[0]=='url') {$url = $values[1];} + + } + + switch($target) { + case 'b': + $targetOutput = 'target="_blank" '; + break; + case 't': + $targetOutput = 'target="_top" '; + break; + case 'p': + $targetOutput = 'target="_parent" '; + break; + case 's': + $targetOutput = 'target="_self" '; + break; + default: + $targetOutput = ''; + break; + } + + $output = ''; + /* + //Itemid + $menu =& JSite::getMenu(); + $itemSection= $menu->getItems('link', 'index.php?option=com_phocadownload&view=sections'); + if(isset($itemSection[0])) { + $itemId = $itemSection[0]->id; + } else { + $itemId = JRequest::getVar('Itemid', 1, 'get', 'int'); + } + */ + switch($view) { + /* + // - - - - - - - - - - - - - - - - + // SECTIONS + // - - - - - - - - - - - - - - - - + case 'sections': + if ($text !='') { + $textOutput = $text; + } else { + $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_DOWNLOAD_SECTIONS'); + } + + $link = PhocaDownloadRoute::getSectionsRoute(); + + $output .= ''; + break; + + // - - - - - - - - - - - - - - - - + // SECTION + // - - - - - - - - - - - - - - - - + case 'section': + if ((int)$id > 0) { + $query = 'SELECT a.id, a.title, a.alias,' + . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug' + . ' FROM #__phocadownload_sections AS a' + . ' WHERE a.id = '.(int)$id; + + $db->setQuery($query); + $item = $db->loadObject(); + + if (isset($item->id) && isset($item->slug)) { + + if ($text !='') { + $textOutput = $text; + } else if (isset($item->title) && $item->title != '') { + $textOutput = $item->title; + } else { + $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_DOWNLOAD_SECTION'); + } + $link = PhocaDownloadRoute::getSectionRoute($item->id, $item->alias); + // 'index.php?option=com_phocadownload&view=section&id='.$item->slug.'&Itemid='. $itemId + + $output .= ''; + } + } + break; + */ + + // - - - - - - - - - - - - - - - - + // CATEGORIES + // - - - - - - - - - - - - - - - - + case 'categories': + if ($text !='') { + $textOutput = $text; + } else { + $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_DOWNLOAD_CATEGORIES'); + } + + $link = PhocaDownloadRoute::getCategoriesRoute(); + + $output .= ''; + break; + + // - - - - - - - - - - - - - - - - + // CATEGORY + // - - - - - - - - - - - - - - - - + case 'category': + if ((int)$id > 0) { + $query = 'SELECT a.id, a.title, a.alias,' + . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug' + . ' FROM #__phocadownload_categories AS a' + . ' WHERE a.id = '.(int)$id; + + $db->setQuery($query); + $item = $db->loadObject(); + + if (isset($item->id) && isset($item->slug)) { + + if ($text !='') { + $textOutput = $text; + } else if (isset($item->title) && $item->title != '') { + $textOutput = $item->title; + } else { + $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_DOWNLOAD_CATEGORY'); + } + $link = PhocaDownloadRoute::getCategoryRoute($item->id, $item->alias); + //'index.php?option=com_phocadownload&view=category&id='.$item->slug.'&Itemid='. $itemId + $output .= ''; + } + + } + break; + + + // - - - - - - - - - - - - - - - - + // FILELIST + // - - - - - - - - - - - - - - - - + case 'filelist': + + $fileOrdering = PhocaDownloadOrdering::getOrderingText($ordering); + + $query = 'SELECT a.id, a.title, a.alias, a.filename_play, a.filename_preview, a.link_external, a.image_filename, a.filename, c.id as catid, a.confirm_license, c.title as cattitle, c.alias as catalias,' + . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug,' + . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as catslug' + . ' FROM #__phocadownload AS a' + . ' LEFT JOIN #__phocadownload_categories AS c ON a.catid = c.id'; + + if ((int)$id > 0) { + $query .= ' WHERE c.id = '.(int)$id; + //$query .= ' WHERE c.id = '.(int)$id . ' AND a.published = 1 AND a.approved = 1'; + } else { + //$query .= ' WHERE a.published = 1 AND a.approved = 1'; + } + + $query .= ' ORDER BY a.'.$fileOrdering; + $query .= ' LIMIT 0, '.(int)$limit; + + $db->setQuery($query); + $items = $db->loadObjectList(); + + if (!empty($items)) { + $output .= '
'; + foreach ($items as $item) { + $imageFileName = $l->getImageFileName($item->image_filename, $item->filename, 3, (int)$iSize); + + if (isset($item->id) && isset($item->slug) && isset($item->catid) && isset($item->catslug)) { + + if ($text !='') { + $textOutput = $text; + } else if (isset($item->title) && $item->title != '') { + $textOutput = $item->title; + } else { + $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_DOWNLOAD_FILE'); + } + + if ((isset($item->confirm_license) && $item->confirm_license > 0) || $fileView == 1) { + $link = PhocaDownloadRoute::getFileRoute($item->id,$item->catid,$item->alias, $item->catalias,0, 'file'); + + if ($iMime == 1) { + $output .= '
'. $imageFileName['filenamethumb']. '
'; + } else { + $output .= ''; + } + + } else { + if ($item->link_external != '') { + $link = $item->link_external; + } else { + $link = PhocaDownloadRoute::getFileRoute($item->id,$item->catid,$item->alias,$item->catalias, 0, 'download'); + } + + if ($iMime == 1) { + $output .= '
'. $imageFileName['filenamethumb']. '
'; + } else { + $output .= ''; + } + + } + + } + } + $output .= '
'; + + } + break; + + + + + + // - - - - - - - - - - - - - - - - + // FILE + // - - - - - - - - - - - - - - - - + case 'file': + case 'fileplay': + case 'fileplaylink': + case 'filepreviewlink': + if ((int)$id > 0) { + $query = 'SELECT a.id, a.title, a.alias, a.filename_play, a.filename_preview, a.link_external, a.image_filename, a.filename, c.id as catid, a.confirm_license, c.title as cattitle, c.alias as catalias,' + . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug,' + . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as catslug' + . ' FROM #__phocadownload AS a' + . ' LEFT JOIN #__phocadownload_categories AS c ON a.catid = c.id' + . ' WHERE a.id = '.(int)$id; + + $db->setQuery($query); + $item = $db->loadObject(); + + if (isset($item->id) && isset($item->slug) && isset($item->catid) && isset($item->catslug)) { + + if ($text !='') { + $textOutput = $text; + } else if (isset($item->title) && $item->title != '') { + $textOutput = $item->title; + } else { + if ($view == 'fileplay') { + $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_PLAY_FILE'); + } else { + $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_DOWNLOAD_FILE'); + } + } + + $imageFileName = $l->getImageFileName($item->image_filename, $item->filename, 3, (int)$iSize); + + // - - - - - + // PLAY + // - - - - - + if ($view == 'fileplay') { + $play = 1; + $fileExt = ''; + $filePath = PhocaDownloadPath::getPathSet('fileplay'); + + $filePath = str_replace ( '../', JURI::base(true).'/', $filePath['orig_rel_ds']); + if (isset($item->filename_play) && $item->filename_play != '') { + $fileExt = PhocaDownloadFile::getExtension($item->filename_play); + $canPlay = PhocaDownloadFile::canPlay($item->filename_play); + if ($canPlay) { + $tmpl['playfilewithpath'] = $filePath . $item->filename_play; + $tmpl['playerpath'] = JURI::base().'components/com_phocadownload/assets/flowplayer/'; + } else { + $output .= JText::_('PLG_CONTENT_PHOCADOWNLOAD_NO_CORRECT_FILE_FOR_PLAYING_FOUND'); + $play = 0; + } + } else { + $output .= JText::_('PLG_CONTENT_PHOCADOWNLOAD_NO_FILE_FOR_PLAYING_FOUND'); + $play = 0; + } + + if ($play == 1) { + + //Correct MP3 + $tmpl['filetype'] = ''; + if ($fileExt == 'mp3') { + $tmpl['filetype'] = 'mp3'; + $playerheight = $playerheightmp3; + } + $versionFLP = '3.2.2'; + $versionFLPJS = '3.2.2'; + + //Flow Player + + $document->addScript($tmpl['playerpath'].'flowplayer-'.$versionFLPJS.'.min.js'); + + $output .= '
'. "\n" + .'
'. "\n"; + + if ($tmpl['filetype'] == 'mp3') { + $output .= ''. "\n"; + } else { + + $output .= ''. "\n"; + } + + $output .= '
'. "\n"; + } + + } else if ($view == 'fileplaylink') { + + // PLAY - - - - - - - - - - - - + $windowWidthPl = (int)$playerwidth + 30; + $windowHeightPl = (int)$playerheight + 30; + $windowHeightPlMP3 = (int)$playerheightmp3 + 30; + //$playWindow = $paramsC->get( 'play_popup_window', 0 ); + if ($playWindow == 1) { + $buttonPl = new JObject(); + $buttonPl->set('methodname', 'js-button'); + $buttonPl->set('options', "window.open(this.href,'win2','width=".$windowWidthPl.",height=".$windowHeightPl.",scrollbars=yes,menubar=no,resizable=yes'); return false;"); + $buttonPl->set('optionsmp3', "window.open(this.href,'win2','width=".$windowWidthPl.",height=".$windowHeightPlMP3.",scrollbars=yes,menubar=no,resizable=yes'); return false;"); + } else { + JHTML::_('behavior.modal', 'a.modal-button'); + $document->addCustomTag( " \n"); + $buttonPl = new JObject(); + $buttonPl->set('name', 'image'); + $buttonPl->set('modal', true); + $buttonPl->set('methodname', 'modal-button'); + $buttonPl->set('options', "{handler: 'iframe', size: {x: ".$windowWidthPl.", y: ".$windowHeightPl."}, overlayOpacity: 0.7, classWindow: 'phocadownloadplaywindow', classOverlay: 'phocadownloadplayoverlay'}"); + $buttonPl->set('optionsmp3', "{handler: 'iframe', size: {x: ".$windowWidthPl.", y: ".$windowHeightPlMP3."}, overlayOpacity: 0.7, classWindow: 'phocadownloadplaywindow', classOverlay: 'phocadownloadplayoverlay'}"); + } + // - - - - - - - - - - - - - - - + + $fileExt = ''; + $filePath = PhocaDownloadPath::getPathSet('fileplay'); + + $filePath = str_replace ( '../', JURI::base(true).'/', $filePath['orig_rel_ds']); + if (isset($item->filename_play) && $item->filename_play != '') { + $fileExt = PhocaDownloadFile::getExtension($item->filename_play); + + + $canPlay = PhocaDownloadFile::canPlay($item->filename_play); + if ($canPlay) { + // Special height for music only + $buttonPlOptions = $buttonPl->options; + if ($fileExt == 'mp3') { + $buttonPlOptions = $buttonPl->optionsmp3; + } + /*if ($text == '') { + $text = JText::_('PLG_CONTENT_PHOCADOWNLOAD_PLAY'); + }*/ + + if ($text !='') { + $textOutput = $text; + //} else if (isset($item->title) && $item->title != '') { + // $textOutput = $item->title; + } else { + $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_PLAY'); + } + + $playLink = JRoute::_(PhocaDownloadRoute::getFileRoute($item->id,$item->catid,$item->alias, $item->catalias,0, 'play')); + + + if ($iMime == 1) { + $output .= '
'. $imageFileName['filenamethumb']. '
'; + } else { + $output .= '
'; + } + + if ($playWindow == 1) { + $output .= ''. $textOutput.''; + } else { + $output .= ''. $textOutput.''; + } + $output .= '
'; + } + } else { + $output .= JText::_('PLG_CONTENT_PHOCADOWNLOAD_NO_FILE_FOR_PLAYING_FOUND'); + } + + + + + } else if ($view == 'filepreviewlink') { + + + if (isset($item->filename_preview) && $item->filename_preview != '') { + $fileExt = PhocaDownloadFile::getExtension($item->filename_preview); + if ($fileExt == 'pdf' || $fileExt == 'jpeg' || $fileExt == 'jpg' || $fileExt == 'png' || $fileExt == 'gif') { + + $filePath = PhocaDownloadPath::getPathSet('filepreview'); + $filePath = str_replace ( '../', JURI::base(true).'/', $filePath['orig_rel_ds']); + $previewLink = $filePath . $item->filename_preview; + //$previewWindow = $paramsC->get( 'preview_popup_window', 0 ); + + // PREVIEW - - - - - - - - - - - - + $windowWidthPr = (int)$previewwidth + 20; + $windowHeightPr = (int)$previewheight + 20; + if ($previewWindow == 1) { + $buttonPr = new JObject(); + $buttonPr->set('methodname', 'js-button'); + $buttonPr->set('options', "window.open(this.href,'win2','width=".$windowWidthPr.",height=".$windowHeightPr.",scrollbars=yes,menubar=no,resizable=yes'); return false;"); + } else { + JHTML::_('behavior.modal', 'a.modal-button'); + $document->addCustomTag( " \n"); + $buttonPr = new JObject(); + $buttonPr->set('name', 'image'); + $buttonPr->set('modal', true); + $buttonPr->set('methodname', 'modal-button'); + $buttonPr->set('options', "{handler: 'iframe', size: {x: ".$windowWidthPr.", y: ".$windowHeightPr."}, overlayOpacity: 0.7, classWindow: 'phocadownloadpreviewwindow', classOverlay: 'phocadownloadpreviewoverlay'}"); + $buttonPr->set('optionsimg', "{handler: 'image', size: {x: 200, y: 150}, overlayOpacity: 0.7, classWindow: 'phocadownloadpreviewwindow', classOverlay: 'phocadownloadpreviewoverlay'}"); + } + // - - - - - - - - - - - - - - - + + + + /*if ($text == '') { + $text = JText::_('PLG_CONTENT_PHOCADOWNLOAD_PREVIEW'); + }*/ + + if ($text !='') { + $textOutput = $text; + //} else if (isset($item->title) && $item->title != '') { + // $textOutput = $item->title; + } else { + $textOutput = JText::_('PLG_CONTENT_PHOCADOWNLOAD_PREVIEW'); + } + if ($iMime == 1) { + $output .= '
'. $imageFileName['filenamethumb']. '
'; + } else { + $output .= '
'; + } + + if ($previewWindow == 1) { + $output .= ''. $text.''; + } else { + if ($fileExt == 'pdf') { + // Iframe - modal + $output .= ''. $textOutput.''; + } else { + // Image - modal + $output .= ''. $textOutput.''; + } + } + $output .= '
'; + } + } else { + $output .= JText::_('PLG_CONTENT_PHOCADOWNLOAD_NO_FILE_FOR_PREVIEWING_FOUND'); + } + + } else { + if ((isset($item->confirm_license) && $item->confirm_license > 0) || $fileView == 1) { + $link = PhocaDownloadRoute::getFileRoute($item->id,$item->catid,$item->alias, $item->catalias,0, 'file'); + //'index.php?option=com_phocadownload&view=file&id='.$item->slug.'&Itemid='.$itemId + + if ($iMime == 1) { + $output .= '
'. $imageFileName['filenamethumb']. '
'; + } else { + $output .= ''; + } + + } else { + if ($item->link_external != '') { + $link = $item->link_external; + } else { + $link = PhocaDownloadRoute::getFileRoute($item->id,$item->catid,$item->alias,$item->catalias,0, 'download'); + } + //$link = PhocaDownloadRoute::getCategoryRoute($item->catid,$item->catalias,$item->sectionid); + + //'index.php?option=com_phocadownload&view=category&id='. $item->catslug. '&download='. $item->slug. '&Itemid=' . $itemId + + if ($iMime == 1) { + $output .= '
'. $imageFileName['filenamethumb']. '
'; + } else { + $output .= ''; + } + } + } + } + + } + break; + + // - - - - - - - - - - - - - - - - + // YOUTUBE + // - - - - - - - - - - - - - - - - + case 'youtube': + + if ($url != '' && PhocaDownloadUtils::isURLAddress($url) ) { + $l = new PhocaDownloadLayout(); + $pdVideo = $l->displayVideo($url, 0, $youtubewidth, $youtubeheight); + $output .= $pdVideo; + } else { + $output .= JText::_('PLG_CONTENT_PHOCADOWNLOAD_WRONG_YOUTUBE_URL'); + } + break; + + + } + $article->text = preg_replace($regex_all, $output, $article->text, 1); + } + }// end if count_matches + return true; + } +} +?> \ No newline at end of file diff --git a/plugins/content/phocadownload/phocadownload.xml b/plugins/content/phocadownload/phocadownload.xml new file mode 100644 index 0000000..248ea93 --- /dev/null +++ b/plugins/content/phocadownload/phocadownload.xml @@ -0,0 +1,64 @@ + + + plg_content_phocadownload + 19/07/2014 + Jan Pavelka (www.phoca.cz) + + www.phoca.cz + Jan Pavelka + GNU/GPL + 3.0.2 + + PLG_CONTENT_PHOCADOWNLOAD_DESCRIPTION + + + phocadownload.php + index.html + + + + index.html + css + images + + + + language/en-GB/en-GB.plg_content_phocadownload.ini + language/en-GB/en-GB.plg_content_phocadownload.sys.ini + + + + + language/en-GB/en-GB.plg_content_phocadownload.ini + language/en-GB/en-GB.plg_content_phocadownload.sys.ini + + + + + + + +
+ + + + + + + + + + + + + + + + +
+
+
+ + + +
\ No newline at end of file diff --git a/plugins/content/podcastmanager/index.html b/plugins/content/podcastmanager/index.html new file mode 100644 index 0000000..3af6301 --- /dev/null +++ b/plugins/content/podcastmanager/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/content/podcastmanager/language/en-GB/en-GB.plg_content_podcastmanager.ini b/plugins/content/podcastmanager/language/en-GB/en-GB.plg_content_podcastmanager.ini new file mode 100644 index 0000000..3af6bc0 --- /dev/null +++ b/plugins/content/podcastmanager/language/en-GB/en-GB.plg_content_podcastmanager.ini @@ -0,0 +1,13 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_CONTENT_PODCASTMANAGER="Content - Podcast Manager" +PLG_CONTENT_PODCASTMANAGER_ERROR_INVALID_FILETYPE="The file type for the file %s is not supported by this plugin" +PLG_CONTENT_PODCASTMANAGER_ERROR_INVALID_PLAYER="The %s player specified is not a supported player type" +PLG_CONTENT_PODCASTMANAGER_ERROR_NO_FILEPATH="Could not render the media player, no file path available" +PLG_CONTENT_PODCASTMANAGER_ERROR_PULLING_DATABASE="Could not get the information for the podcast %s from the database." +PLG_CONTENT_PODCASTMANAGER_FIELDSET_ADVANCED_LOADJQUERY_DESCRIPTION="Choose whether to load jQuery with the media player. NOTE: This will only load jQuery once and currently loads version 1.8.3. If another extension (for example, your template) loads jQuery, you can safely disable this option without impacting the media player's performance." +PLG_CONTENT_PODCASTMANAGER_FIELDSET_ADVANCED_LOADJQUERY_LABEL="Load jQuery with Media Player" +PLG_CONTENT_PODCASTMANAGER_XML_DESCRIPTION="The Podcast Manager plugin turns {podcast ...} tags into players and links" diff --git a/plugins/content/podcastmanager/language/en-GB/en-GB.plg_content_podcastmanager.sys.ini b/plugins/content/podcastmanager/language/en-GB/en-GB.plg_content_podcastmanager.sys.ini new file mode 100644 index 0000000..c03a1ea --- /dev/null +++ b/plugins/content/podcastmanager/language/en-GB/en-GB.plg_content_podcastmanager.sys.ini @@ -0,0 +1,10 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_CONTENT_PODCASTMANAGER="Content - Podcast Manager" +PLG_CONTENT_PODCASTMANAGER_ERROR_ACTIVATING_PLUGIN="Could not automatically activate the "_QQ_"Content - Podcast Manager"_QQ_" plugin" +PLG_CONTENT_PODCASTMANAGER_ERROR_COMPONENT="You do not have Podcast Manager installed. Please install it before installing this plugin." +PLG_CONTENT_PODCASTMANAGER_ERROR_INSTALL_UPDATE="Could not retrieve the version from the database, unable to remove old media folders." +PLG_CONTENT_PODCASTMANAGER_XML_DESCRIPTION="The Podcast Manager plugin turns {podcast ...} tags into players and links" diff --git a/plugins/content/podcastmanager/language/en-GB/index.html b/plugins/content/podcastmanager/language/en-GB/index.html new file mode 100644 index 0000000..3af6301 --- /dev/null +++ b/plugins/content/podcastmanager/language/en-GB/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/content/podcastmanager/language/fr-CA/fr-CA.plg_content_podcastmanager.ini b/plugins/content/podcastmanager/language/fr-CA/fr-CA.plg_content_podcastmanager.ini new file mode 100644 index 0000000..d824bb3 --- /dev/null +++ b/plugins/content/podcastmanager/language/fr-CA/fr-CA.plg_content_podcastmanager.ini @@ -0,0 +1,13 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_CONTENT_PODCASTMANAGER="Contenu - Gestionnaire de balados" +PLG_CONTENT_PODCASTMANAGER_ERROR_INVALID_FILETYPE="Le type du fichier %s n'est pas pris en charge par ce plugiciel." +PLG_CONTENT_PODCASTMANAGER_ERROR_INVALID_PLAYER="Le lecteur %s spécifié n'est pas d'un type pris en charge." +PLG_CONTENT_PODCASTMANAGER_ERROR_NO_FILEPATH="Le lecteur de médias ne peut pas fonctionner, aucun chemin de fichier de disponible." +PLG_CONTENT_PODCASTMANAGER_ERROR_PULLING_DATABASE="Impossible de récupérer les informations de la balado %s depuis la base de données." +PLG_CONTENT_PODCASTMANAGER_FIELDSET_ADVANCED_LOADJQUERY_DESCRIPTION="Choisir le chargement de JQuery avec le lecteur de médias, ou non. NOTE : Ceci ne chargera JQuery qu'une fois et actuellement dans sa version 1.8.3. Si une autre extension (par exemple votre modèle) charge JQuery, vous pouvez désactiver cette option sans conséquence sur la performance du lecteur de médias." +PLG_CONTENT_PODCASTMANAGER_FIELDSET_ADVANCED_LOADJQUERY_LABEL="Charger JQuery avec le lecteur de médias." +PLG_CONTENT_PODCASTMANAGER_XML_DESCRIPTION="Le plugiciel de gestion des balados change les balises {podcast ...} en lecteurs et en liens." diff --git a/plugins/content/podcastmanager/language/fr-CA/fr-CA.plg_content_podcastmanager.sys.ini b/plugins/content/podcastmanager/language/fr-CA/fr-CA.plg_content_podcastmanager.sys.ini new file mode 100644 index 0000000..4fbaa97 --- /dev/null +++ b/plugins/content/podcastmanager/language/fr-CA/fr-CA.plg_content_podcastmanager.sys.ini @@ -0,0 +1,10 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_CONTENT_PODCASTMANAGER="Contenu - Gestionnaire de balados" +PLG_CONTENT_PODCASTMANAGER_ERROR_ACTIVATING_PLUGIN="Impossible d'activer automatiquement le plugiciel « Contenu - Gestionnaire de balados »" +PLG_CONTENT_PODCASTMANAGER_ERROR_COMPONENT="Le gestionnaire de balados n'est pas installé. Veuillez le faire avant d'installer ce plugiciel." +PLG_CONTENT_PODCASTMANAGER_ERROR_INSTALL_UPDATE="Récupération de la version depuis la base de données, et suppression des anciens dossiers de médias impossibles." +PLG_CONTENT_PODCASTMANAGER_XML_DESCRIPTION="Le plugiciel du gestion des balados change les balises {podcast ...} en lecteurs et en liens." diff --git a/plugins/content/podcastmanager/language/fr-CA/index.html b/plugins/content/podcastmanager/language/fr-CA/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/content/podcastmanager/language/fr-CA/index.html @@ -0,0 +1 @@ + diff --git a/plugins/content/podcastmanager/language/fr-FR/fr-FR.plg_content_podcastmanager.ini b/plugins/content/podcastmanager/language/fr-FR/fr-FR.plg_content_podcastmanager.ini new file mode 100644 index 0000000..e6aba6b --- /dev/null +++ b/plugins/content/podcastmanager/language/fr-FR/fr-FR.plg_content_podcastmanager.ini @@ -0,0 +1,13 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_CONTENT_PODCASTMANAGER="Contenu - Podcast Manager" +PLG_CONTENT_PODCASTMANAGER_ERROR_INVALID_FILETYPE="Le type de fichier du fichier %s n'est pas supporté par ce plugin." +PLG_CONTENT_PODCASTMANAGER_ERROR_INVALID_PLAYER="Le lecteur %s spécifié ne fait pas parti des types de lecteurs supportés." +PLG_CONTENT_PODCASTMANAGER_ERROR_NO_FILEPATH="Impossible d'afficher le lecteur, chemin du fichier introuvable." +PLG_CONTENT_PODCASTMANAGER_ERROR_PULLING_DATABASE="Impossible de récupérer les informations du podcast %s depuis la base de données." +PLG_CONTENT_PODCASTMANAGER_FIELDSET_ADVANCED_LOADJQUERY_DESCRIPTION="Choisissez si vous souhaitez charger jQuery avec le lecteur multimédia. NOTE : Cela ne chargera jQuery qu'une fois et chargera la version 1.8.3. Si une autre extension (par exemple votre template) charge jQuery, vous pouvez désactiver cette option en toute sécurité sans affecter les performances du lecteur multimédia." +PLG_CONTENT_PODCASTMANAGER_FIELDSET_ADVANCED_LOADJQUERY_LABEL="Charge jQuery avec le lecteur multimédia." +PLG_CONTENT_PODCASTMANAGER_XML_DESCRIPTION="Le plugin Podcast Manager affiche à la place de la balise {podcast ...} les lecteurs et les liens." diff --git a/plugins/content/podcastmanager/language/fr-FR/fr-FR.plg_content_podcastmanager.sys.ini b/plugins/content/podcastmanager/language/fr-FR/fr-FR.plg_content_podcastmanager.sys.ini new file mode 100644 index 0000000..3b3511c --- /dev/null +++ b/plugins/content/podcastmanager/language/fr-FR/fr-FR.plg_content_podcastmanager.sys.ini @@ -0,0 +1,10 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_CONTENT_PODCASTMANAGER="Contenu - Podcast Manager" +PLG_CONTENT_PODCASTMANAGER_ERROR_ACTIVATING_PLUGIN="Impossible d'activer automatiquement le plugin "_QQ_"Contenu - Podcast Manager"_QQ_"" +PLG_CONTENT_PODCASTMANAGER_ERROR_COMPONENT="Podcast Manager n'a pas été installé. Veuillez l'installer avant d'installer ce plugin." +PLG_CONTENT_PODCASTMANAGER_ERROR_INSTALL_UPDATE="Impossible de récupérer la version depuis la base de données, impossible de supprimer les anciens dossiers media." +PLG_CONTENT_PODCASTMANAGER_XML_DESCRIPTION="Le plugin Podcast Manager affiche à la place de la balise {podcast ...} les lecteurs et les liens." diff --git a/plugins/content/podcastmanager/language/fr-FR/index.html b/plugins/content/podcastmanager/language/fr-FR/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/content/podcastmanager/language/fr-FR/index.html @@ -0,0 +1 @@ + diff --git a/plugins/content/podcastmanager/language/id-ID/id-ID.plg_content_podcastmanager.ini b/plugins/content/podcastmanager/language/id-ID/id-ID.plg_content_podcastmanager.ini new file mode 100644 index 0000000..2837fd8 --- /dev/null +++ b/plugins/content/podcastmanager/language/id-ID/id-ID.plg_content_podcastmanager.ini @@ -0,0 +1,13 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_CONTENT_PODCASTMANAGER="Konten - Podcast Manager" +PLG_CONTENT_PODCASTMANAGER_ERROR_INVALID_FILETYPE="Tipe berkas untuk %s ini tidak didukung oleh plugin" +PLG_CONTENT_PODCASTMANAGER_ERROR_INVALID_PLAYER="Pemutar %s yang ditentukan bukanlah tipe pemutar yang didukung" +PLG_CONTENT_PODCASTMANAGER_ERROR_NO_FILEPATH="Tidak bisa merender pemutar media, tidak ada jalur berkas yang tersedia" +PLG_CONTENT_PODCASTMANAGER_ERROR_PULLING_DATABASE="Tidak bisa mendapatkan informasi untuk podcast %s dari database." +PLG_CONTENT_PODCASTMANAGER_FIELDSET_ADVANCED_LOADJQUERY_DESCRIPTION="Pilih apakah akan memuat jQuery bersama pemutar medianya. CATATAN: Hal ini hanya akan memuat jQuery sekali saja dan saat ini memuat versi 1.8.3. Kalau ekstensi lain (sebagai contoh, templat Anda) memuat jQuery, maka Anda bisa menonaktifkan opsi ini dengan aman tanpa berdampak pada performa pemutar media." +PLG_CONTENT_PODCASTMANAGER_FIELDSET_ADVANCED_LOADJQUERY_LABEL="Muat jQuery bersama Pemutar Media" +PLG_CONTENT_PODCASTMANAGER_XML_DESCRIPTION="Plugin Podcast Manager membuat tagar {podcast ...} untuk pemutar dan tautan" diff --git a/plugins/content/podcastmanager/language/id-ID/id-ID.plg_content_podcastmanager.sys.ini b/plugins/content/podcastmanager/language/id-ID/id-ID.plg_content_podcastmanager.sys.ini new file mode 100644 index 0000000..1b9e5db --- /dev/null +++ b/plugins/content/podcastmanager/language/id-ID/id-ID.plg_content_podcastmanager.sys.ini @@ -0,0 +1,10 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_CONTENT_PODCASTMANAGER="Konten - Podcast Manager" +PLG_CONTENT_PODCASTMANAGER_ERROR_ACTIVATING_PLUGIN="Tidak bisa mengaktifkan plugin 'Konten - Podcast Manager' secara otomatis" +PLG_CONTENT_PODCASTMANAGER_ERROR_COMPONENT="Anda tidak memiliki Podcast Manager yang terpasang. Silakan pasang sebelum memasang plugin ini." +PLG_CONTENT_PODCASTMANAGER_ERROR_INSTALL_UPDATE="Tidak bisa mengembalikan versi database, tidak dapat membuang folder-folder media yang lama" +PLG_CONTENT_PODCASTMANAGER_XML_DESCRIPTION="Plugin Podcast Manager membuat tagar {podcast ...} untuk pemutar dan tautan" diff --git a/plugins/content/podcastmanager/language/id-ID/index.html b/plugins/content/podcastmanager/language/id-ID/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/content/podcastmanager/language/id-ID/index.html @@ -0,0 +1 @@ + diff --git a/plugins/content/podcastmanager/language/index.html b/plugins/content/podcastmanager/language/index.html new file mode 100644 index 0000000..3af6301 --- /dev/null +++ b/plugins/content/podcastmanager/language/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/content/podcastmanager/language/pt-BR/index.html b/plugins/content/podcastmanager/language/pt-BR/index.html new file mode 100644 index 0000000..3af6301 --- /dev/null +++ b/plugins/content/podcastmanager/language/pt-BR/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/content/podcastmanager/language/pt-BR/pt-BR.plg_content_podcastmanager.ini b/plugins/content/podcastmanager/language/pt-BR/pt-BR.plg_content_podcastmanager.ini new file mode 100644 index 0000000..257067a --- /dev/null +++ b/plugins/content/podcastmanager/language/pt-BR/pt-BR.plg_content_podcastmanager.ini @@ -0,0 +1,13 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_CONTENT_PODCASTMANAGER="Content - Podcast Manager" +PLG_CONTENT_PODCASTMANAGER_ERROR_INVALID_FILETYPE="O tipo de arquivo para o arquivo %s não é suportado por este plugin" +PLG_CONTENT_PODCASTMANAGER_ERROR_INVALID_PLAYER="O reprodutor %s especificado não é suportado" +PLG_CONTENT_PODCASTMANAGER_ERROR_NO_FILEPATH="Não foi possível executar o mídia player, nenhum caminho de arquivos disponível" +PLG_CONTENT_PODCASTMANAGER_ERROR_PULLING_DATABASE="Não foi possível obter a informação para o podcast %s da base de dados." +PLG_CONTENT_PODCASTMANAGER_FIELDSET_ADVANCED_LOADJQUERY_DESCRIPTION="Escolha se quer carregar jQuery com o mídia player. NOTA: O jQuery será carregado apenas uma vez a versão carregada é a 1.8.3. Se uma outra extensão (por exemplo, o seu template) carrega o jQuery, você pode desativar essa opção sem afetar o desempenho do mídia player." +PLG_CONTENT_PODCASTMANAGER_FIELDSET_ADVANCED_LOADJQUERY_LABEL="Carregar o jQuery com o mídia player." +PLG_CONTENT_PODCASTMANAGER_XML_DESCRIPTION="O plugin Podcast Manager transforma {podcast ...} tags em players e links" diff --git a/plugins/content/podcastmanager/language/pt-BR/pt-BR.plg_content_podcastmanager.sys.ini b/plugins/content/podcastmanager/language/pt-BR/pt-BR.plg_content_podcastmanager.sys.ini new file mode 100644 index 0000000..0415e07 --- /dev/null +++ b/plugins/content/podcastmanager/language/pt-BR/pt-BR.plg_content_podcastmanager.sys.ini @@ -0,0 +1,10 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_CONTENT_PODCASTMANAGER="Conteúdo - Podcast Manger" +PLG_CONTENT_PODCASTMANAGER_ERROR_ACTIVATING_PLUGIN="Não foi possível ativar automaticamente o plugin "_QQ_"_QQ_"_QQ_"Conteúdo - Podcast Manager"_QQ_"_QQ_"_QQ_"" +PLG_CONTENT_PODCASTMANAGER_ERROR_COMPONENT="Você não tem o Podcast Manager instalado. Favor instalá-lo antes de instalar este plugin." +PLG_CONTENT_PODCASTMANAGER_ERROR_INSTALL_UPDATE="Não foi possível recuperar a versão do banco de dados, não foi possível remover as pastas de mídias antigas." +PLG_CONTENT_PODCASTMANAGER_XML_DESCRIPTION="O plugin Podcast Manager transforma {enclose ...} tags em players e links" diff --git a/plugins/content/podcastmanager/player.php b/plugins/content/podcastmanager/player.php new file mode 100644 index 0000000..21f874d --- /dev/null +++ b/plugins/content/podcastmanager/player.php @@ -0,0 +1,316 @@ + 'audio/x-m4a', + 'm4v' => 'video/x-m4v', + 'mov' => 'video/quicktime', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4' + ); + + /** + * The class constructor + * + * @param JRegistry $podmanparams The Podcast Manager parameters + * @param string $podfilepath The path to the file being processed + * @param string $podtitle The title of the podcast being processed + * @param array $options An array of options + * @param JRegistry $pluginParams The Podcast Manager Content Plugin parameters + * + * @since 1.6 + * @throws RuntimeException + */ + public function __construct($podmanparams, $podfilepath, $podtitle, $options, $pluginParams) + { + $this->podmanparams = $podmanparams; + $this->podfilepath = $podfilepath; + $this->options = $options; + $this->pluginParams = $pluginParams; + + if (in_array($this->options['playerType'], $this->validTypes)) + { + $this->playerType = $this->options['playerType']; + } + else + { + throw new RuntimeException('Invalid Player', 500); + } + + $this->fileURL = $this->determineURL($podfilepath); + $this->podtitle = $podtitle; + } + + /** + * Function to generate the player + * + * @return string The player for the article + * + * @since 1.6 + */ + public function generate() + { + $func = $this->playerType; + + return $this->$func(); + } + + /** + * Function to create the URL for a podcast episode file + * + * @param object $podfilepath The filename of the podcast file. + * + * @return string The URL to the file + * + * @since 1.6 + */ + protected function determineURL($podfilepath) + { + // Convert the file path to a string + $tempfile = $podfilepath; + + if (isset($tempfile->filename)) + { + $filepath = $tempfile->filename; + } + else + { + $filepath = $tempfile; + } + + $filename = $filepath; + + // Check if the file is from off site + if (!preg_match('/^http/', $filename)) + { + // The file is stored on site, check if it exists + $filepath = JPATH_ROOT . '/' . $filename; + + // Check if the file exists + if (is_file($filepath)) + { + $filename = JUri::base() . $filename; + } + } + + // Process the URL through the helper to get the stat tracking details if applicable + $filename = PodcastManagerHelper::getMediaUrl($filename); + + return $filename; + } + + /** + * Function to generate a custom player + * + * @return string A link to the podcast as defined by the user + * + * @since 1.7 + */ + protected function custom() + { + $linkcode = $this->podmanparams->get('customcode', ''); + + return preg_replace('/\{podcast\}/', $this->fileURL, $linkcode); + } + + /** + * Function to generate a link player + * + * @return string A HTML link to the podcast + * + * @since 1.6 + */ + protected function link() + { + return '' . htmlspecialchars($this->podmanparams->get('linktitle', 'Listen Now!')) . ''; + } + + /** + * Function to generate a media player + * + * @return string A media player containing the podcast episode + * + * @since 1.6 + * @throws RuntimeException + */ + protected function player() + { + // Player height and width + $width = $this->options['width']; + $audioheight = $this->options['audioHeight']; + $videoheight = $this->options['videoHeight']; + $style = $this->options['style']; + + // Valid extensions to determine correct player + $validAudio = array('m4a', 'mp3'); + $validVideo = array('m4v', 'mov', 'mp4'); + + // Get the file's extension + $extension = strtolower(substr($this->fileURL, -3, 3)); + + // Set the element's ID + $ID = 'player-' . $this->options['podcastID']; + + // Process audio file + if (in_array($extension, $validAudio)) + { + $player = ''; + } + + // Process video file + elseif (in_array($extension, $validVideo)) + { + $player = ''; + } + + // Invalid file type + else + { + throw new RuntimeException('Invalid File Type', 500); + } + + /* + * Check if we should load jQuery + * First, set our default value based on the version of Joomla! + * Default enabled for 2.5, disabled for 3.x (due to core inclusion) + */ + if (version_compare(JVERSION, '3.0', 'lt')) + { + $default = '1'; + } + else + { + $default = '0'; + } + + if ($this->pluginParams->get('loadJQuery', $default) == '1') + { + // Load jQuery via JHtml in 3.x, use Google API in 2.5 (use the same version of jQuery as shipped in latest CMS 3.x) + if (version_compare(JVERSION, '3.0', 'lt')) + { + JFactory::getDocument()->addScript('http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'); + + // Ensure jQuery.noConflict() is set, just in case ;-) + JHtml::_('script', 'mediaelements/jquery-noconflict.js', false, true); + } + else + { + JHtml::_('jquery.framework'); + } + } + + // Set the default file names + $jsFile = 'mediaelement-and-player.min.js'; + $cssFile = 'mediaelementplayer.min.css'; + + // Use the non-minimized files if JDEBUG is set (must set manually for 2.5) + if (version_compare(JVERSION, '3.0', 'lt') && JDEBUG) + { + $jsFile = 'mediaelement-and-player.js'; + $cssFile = 'mediaelementplayer.css'; + } + + // And finally, load in MediaElement.JS + JHtml::_('script', 'mediaelements/' . $jsFile, false, true); + JHtml::_('stylesheet', 'mediaelements/' . $cssFile, false, true, false); + $player .= "
"; + + return $player; + } +} diff --git a/plugins/content/podcastmanager/podcastmanager.php b/plugins/content/podcastmanager/podcastmanager.php new file mode 100644 index 0000000..f0f92ba --- /dev/null +++ b/plugins/content/podcastmanager/podcastmanager.php @@ -0,0 +1,298 @@ +loadLanguage(); + } + + /** + * Plugin that loads a podcast player within content + * + * @param string $context The context of the content being passed to the plugin. + * @param object &$article The article object. Note $article->text is also available + * @param mixed &$params The article params + * @param integer $page The 'page' number + * + * @return mixed Player object on success, notice on failure + * + * @since 1.6 + */ + public function onContentPrepare($context, &$article, &$params, $page = 0) + { + static $log; + + // Check if we're in the site app, otherwise, do nothing + if (!JFactory::getApplication()->isSite()) + { + return true; + } + + $podmanparams = JComponentHelper::getParams('com_podcastmanager'); + + if ($podmanparams->get('enableLogging', '0') == '1') + { + if ($log == null) + { + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; + $options['text_file'] = 'podcastmanager.php'; + $log = JLog::addLogger($options); + } + } + + // Handle instances coming from Podcast Manager extensions + $podManContexts = array('com_podcastmanager.feed', 'mod_podcastmanagerfeed.module'); + + if (in_array($context, $podManContexts)) + { + // If the player isn't enabled, return + if ($params->get('show_item_player', '1') == '0') + { + return true; + } + + $article->text = $article->player; + $feedView = $context; + } + + // Special handling for com_tags if needed + if ($context == 'com_tags.tag') + { + // If there isn't a text element, set it as that's what we're using + if (!isset($article->text) || !$article->text) + { + $article->text = $article->core_body; + } + } + + // Simple performance check to determine whether plugin should process further + if (strpos($article->text, 'podcast') === false) + { + return true; + } + + // Expression to search for + $regex = '/\{(podcast)\s+(.*?)}/i'; + + // Find all instances of plugin and put in $matches + preg_match_all($regex, $article->text, $matches); + + foreach ($matches as $id => $podcast) + { + // Set $i for multiple {podcast instances + $i = 0; + + // We only want to process ID 0 + if ($id > 0) + { + return true; + } + + foreach ($podcast as $episode) + { + // Initialize the options array + $options = array(); + + // Set the default player type and size from the component params + $options['playerType'] = $podmanparams->get('linkhandling', 'player'); + $options['width'] = (int) $podmanparams->get('playerwidth', 400); + $options['audioHeight'] = (int) $podmanparams->get('playerheight', 30); + $options['videoHeight'] = (int) $podmanparams->get('videoheight', 400); + $options['style'] = $podmanparams->get('playerstyle', ''); + + // Check if we're in a Podcast Manager instance; if so, extract data from the object + if ((isset($feedView)) && ($feedView == $context)) + { + $podtitle = $article->title; + $podfilepath = $article->filename; + $options['podcastID'] = (int) $article->id; + } + else + { + // Retrieve the title from the object and prepare it for a DB query + // 9 offset for {podcast marker, -1 offset for closing } + $podtitle = substr($episode, 9, -1); + + // Fix for K2 Item when {podcast marker is last text in an item with no readmore + // -17 offset removes '}

{K2Splitter' + if ($context == 'com_k2.item' && strpos($episode, '{K2Splitter')) + { + $podtitle = substr($episode, 9, -17); + } + + // Check if we've received an ID + if (strpos($podtitle, 'id') === 0) + { + // Explode the tag into separate elements to process overrides + $articleTag = explode(';', $podtitle); + + // Remove the id= portion and cast as an integer + $podtitle = (int) substr($articleTag[0], 3); + + // Check if we have element 1, the player override, and if the string has anything + if (isset($articleTag[1]) && strpos($articleTag[1], 'player') === 0 && strlen($articleTag[1]) >= 8) + { + // Remove the player= portion and set the player type + $options['playerType'] = substr($articleTag[1], 7); + } + + // Check if we have element 2, the width override, and if the string has anything + if (isset($articleTag[2]) && strpos($articleTag[2], 'width') === 0 && strlen($articleTag[2]) >= 7) + { + // Remove the width= portion and set the player width + $options['width'] = (int) substr($articleTag[2], 6); + } + + // Check if we have element 3, the height override, and if the string has anything + if (isset($articleTag[3]) && strpos($articleTag[3], 'height') === 0 && strlen($articleTag[3]) >= 8) + { + // Remove the height= portion and set the player height for both audio and video for this instance + $options['audioHeight'] = (int) substr($articleTag[3], 7); + $options['videoHeight'] = (int) substr($articleTag[3], 7); + } + + // Check if we have element 4, the style override, and if the string has anything + if (isset($articleTag[4]) && strpos($articleTag[4], 'style') === 0 && strlen($articleTag[4]) >= 5) + { + // Remove the height= portion and set the player height for both audio and video for this instance + $options['style'] = substr($articleTag[4], 6); + } + } + + // Query the DB for the title string, returning the filename + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + + // Common query fields regardless of method + $query->select($db->quoteName(array('filename', 'id'))); + $query->from($db->quoteName('#__podcastmanager')); + + // If the title is a string, use the "classic" lookup method + if (is_string($podtitle)) + { + $query->where($db->quoteName('title') . ' = ' . $db->quote($podtitle)); + } + + // If an integer, we need to also get the title of the podcast, as well as search on the ID + elseif (is_int($podtitle)) + { + $query->select($db->quoteName('title')); + $query->where($db->quoteName('id') . ' = ' . (int) $podtitle); + } + + $db->setQuery($query); + + if (!$db->loadObject()) + { + // Write the DB error to the log + JLog::add((JText::sprintf('PLG_CONTENT_PODCASTMANAGER_ERROR_PULLING_DATABASE', $podtitle) . ' ' . $db->stderr(true)), JLog::ERROR); + } + else + { + $dbResult = $db->loadObject(); + $podfilepath = $dbResult->filename; + $options['podcastID'] = (int) $dbResult->id; + + // Set the title if we searched by ID + if (isset($dbResult->title)) + { + $podtitle = $dbResult->title; + } + } + } + + // If the document isn't HTML, remove the marker + if (JFactory::getDocument()->getType() != 'html') + { + // Remove the {podcast marker + $article->text = JString::str_ireplace($matches[0][$i], '', $article->text); + } + elseif (isset($podfilepath)) + { + try + { + // Get the player + $player = new PodcastManagerPlayer($podmanparams, $podfilepath, $podtitle, $options, $this->params); + + // Fix for K2 Item + if ($context == 'com_k2.item' && strpos($matches[0][$i], '{K2Splitter')) + { + $string = JString::str_ireplace($matches[0][$i], '{K2Splitter}', substr($matches[0][$i], 0, -16)); + } + else + { + $string = $matches[0][$i]; + } + + try + { + // Replace the {podcast marker with the player + $article->text = JString::str_ireplace($string, $player->generate(), $article->text); + } + catch (RuntimeException $e) + { + // Write the error to the log + JLog::add(JText::sprintf('PLG_CONTENT_PODCASTMANAGER_ERROR_INVALID_FILETYPE', $podfilepath), JLog::INFO); + + // Remove the {podcast marker + $article->text = JString::str_ireplace($matches[0][$i], '', $article->text); + } + } + catch (RuntimeException $e) + { + // Write the error to the log + JLog::add(JText::sprintf('PLG_CONTENT_PODCASTMANAGER_ERROR_INVALID_PLAYER', $options['playerType']), JLog::INFO); + + // Remove the {podcast marker + $article->text = JString::str_ireplace($matches[0][$i], '', $article->text); + } + } + else + { + // Write the error to the log + JLog::add(JText::_('PLG_CONTENT_PODCASTMANAGER_ERROR_NO_FILEPATH'), JLog::INFO); + + // Remove the {podcast marker + $article->text = JString::str_ireplace($matches[0][$i], '', $article->text); + } + + $i++; + } + } + + return true; + } +} diff --git a/plugins/content/podcastmanager/podcastmanager.xml b/plugins/content/podcastmanager/podcastmanager.xml new file mode 100644 index 0000000..636d388 --- /dev/null +++ b/plugins/content/podcastmanager/podcastmanager.xml @@ -0,0 +1,42 @@ + + + plg_content_podcastmanager + 2015-06-22 + Michael Babker + (C) 2011-2015 Michael Babker + mbabker@flbab.com + https://www.babdev.com + 2.2.0 + GNU/GPL Version 2 or later + PLG_CONTENT_PODCASTMANAGER_XML_DESCRIPTION + script.php + + podcastmanager.php + player.php + index.html + language + + + css + js + index.html + + + +
+ + + + +
+
+
+
diff --git a/plugins/content/podcastmanager/script.php b/plugins/content/podcastmanager/script.php new file mode 100644 index 0000000..901441d --- /dev/null +++ b/plugins/content/podcastmanager/script.php @@ -0,0 +1,180 @@ +activateButton(); + } + + /** + * Function to perform changes during update + * + * @param JInstallerPlugin $parent The class calling this method + * + * @return void + * + * @since 2.0 + */ + public function update($parent) + { + // Get the pre-update version + $version = $this->_getVersion(); + + // If in error, throw a message about the language files + if ($version == 'Error') + { + JError::raiseNotice(null, JText::_('COM_PODCASTMANAGER_ERROR_INSTALL_UPDATE')); + + return; + } + + // If coming from 1.x, remove old media folders + if (version_compare($version, '2.0', 'lt')) + { + $this->_removeMediaFolders(); + } + } + + /** + * Function to activate the button at installation + * + * @return void + * + * @since 1.7 + */ + protected function activateButton() + { + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->update($db->quoteName('#__extensions')); + $query->set($db->quoteName('enabled') . ' = 1'); + $query->where($db->quoteName('name') . ' = ' . $db->quote('plg_content_podcastmanager')); + $db->setQuery($query); + + if (!$db->query()) + { + JError::raiseNotice(1, JText::_('PLG_CONTENT_PODCASTMANAGER_ERROR_ACTIVATING_PLUGIN')); + } + } + + /** + * Function to get the currently installed version from the manifest cache + * + * @return string The version that is installed + * + * @since 2.0 + */ + private function _getVersion() + { + // Get the record from the database + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->select($db->quoteName('manifest_cache')); + $query->from($db->quoteName('#__extensions')); + $query->where($db->quoteName('element') . ' = ' . $db->quote('podcastmanager'), 'AND'); + $query->where($db->quoteName('folder') . ' = ' . $db->quote('content'), 'AND'); + $db->setQuery($query); + + if (!$db->loadObject()) + { + JError::raiseWarning(1, JText::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $db->stderr(true))); + $version = 'Error'; + + return $version; + } + else + { + $manifest = $db->loadObject(); + } + + // Decode the JSON + $record = json_decode($manifest->manifest_cache); + + // Get the version + $version = $record->version; + + return $version; + } + + /** + * Function to remove old media folders for players removed in 2.0 + * + * @return void + * + * @since 2.0 + */ + private function _removeMediaFolders() + { + jimport('joomla.filesystem.folder'); + + $base = JPATH_SITE . '/plugins/content/podcastmanager/'; + + // The folders to remove + $folders = array('podcast', 'soundmanager'); + + // Remove the folders + foreach ($folders as $folder) + { + if (is_dir($base . $folder)) + { + JFolder::delete($base . $folder); + } + } + } +} diff --git a/plugins/content/socialsharebuttons/assets/img/index.html b/plugins/content/socialsharebuttons/assets/img/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/plugins/content/socialsharebuttons/assets/img/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/content/socialsharebuttons/assets/img/primi_sui_motori.png b/plugins/content/socialsharebuttons/assets/img/primi_sui_motori.png new file mode 100644 index 0000000..78fb7d5 Binary files /dev/null and b/plugins/content/socialsharebuttons/assets/img/primi_sui_motori.png differ diff --git a/plugins/content/socialsharebuttons/assets/index.html b/plugins/content/socialsharebuttons/assets/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/plugins/content/socialsharebuttons/assets/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/content/socialsharebuttons/index.html b/plugins/content/socialsharebuttons/index.html new file mode 100644 index 0000000..6bfc798 --- /dev/null +++ b/plugins/content/socialsharebuttons/index.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/plugins/content/socialsharebuttons/socialsharebuttons.php b/plugins/content/socialsharebuttons/socialsharebuttons.php new file mode 100644 index 0000000..0b9dea1 --- /dev/null +++ b/plugins/content/socialsharebuttons/socialsharebuttons.php @@ -0,0 +1,608 @@ +params->get("fbDynamicLocale", 0)) { + $lang = JFactory::getLanguage(); + $locale = $lang->getTag(); + $this->fbLocale = str_replace("-","_",$locale); + } else { + $this->fbLocale = $this->params->get("fbLocale", "en_US"); + } + + } + + /** + * Add social buttons into the article + * + * Method is called by the view + * + * @param string The context of the content being passed to the plugin. + * @param object The content object. Note $article->text is also available + * @param object The content params + * @param int The 'page' number + * @since 1.6 + */ + public function onContentPrepare($context, &$article, &$params, $limitstart) { + + $app = JFactory::getApplication(); + /* @var $app JApplication */ + + if($app->isAdmin()) { + return; + } + + $doc = JFactory::getDocument(); + /* @var $doc JDocumentHtml */ + $docType = $doc->getType(); + + // Check document type + if(strcmp("html", $docType) != 0){ + return; + } + + $currentOption = JRequest::getCmd("option"); + + if( ($currentOption != "com_content") OR !isset($this->params)) { + return; + } + $custom = $this->params->get('custom'); + if ($custom) { + $ok = strstr ($article->text, '{socialsharebuttons}'); + } + else { + $ok=0; + } + $this->currentView = JRequest::getCmd("view"); + + /** Check for selected views, which will display the buttons. **/ + /** If there is a specific set and do not match, return an empty string.**/ + $showInArticles = $this->params->get('showInArticles'); + + if(!$showInArticles AND (strcmp("article", $this->currentView) == 0)){ + return ""; + } + + // Check for category view + $showInCategories = $this->params->get('showInCategories'); + + if(!$showInCategories AND (strcmp("category", $this->currentView) == 0)){ + return; + } + + if($showInCategories AND ($this->currentView == "category")) { + $articleData = $this->getArticle($article); + $article->id = $articleData['id']; + $article->catid = $articleData['catid']; + $article->title = $articleData['title']; + $article->slug = $articleData['slug']; + $article->catslug = $articleData['catslug']; + } + + if(!isset($article) OR empty($article->id) ) { + return; + } + + $excludeArticles = $this->params->get('excludeArticles'); + if(!empty($excludeArticles)){ + $excludeArticles = explode(',', $excludeArticles); + } + settype($excludeArticles, 'array'); + JArrayHelper::toInteger($excludeArticles); + + // Exluded categories + $excludedCats = $this->params->get('excludeCats'); + if(!empty($excludedCats)){ + $excludedCats = explode(',', $excludedCats); + } + settype($excludedCats, 'array'); + JArrayHelper::toInteger($excludedCats); + + // Included Articles + $includedArticles = $this->params->get('includeArticles'); + if(!empty($includedArticles)){ + $includedArticles = explode(',', $includedArticles); + } + settype($includedArticles, 'array'); + JArrayHelper::toInteger($includedArticles); + + if(!in_array($article->id, $includedArticles)) { + // Check exluded places + if(in_array($article->id, $excludeArticles) OR in_array($article->catid, $excludedCats)){ + return ""; + } + } + + // Generate content + $content = $this->getContent($article, $params); + $position = $this->params->get('position'); + + switch($position){ + case 0: + $article->text = $content . $article->text . $content; + break; + case 1: + $article->text = $content . $article->text; + break; + case 2: + $article->text = $article->text . $content; + break; + default: + break; + } + if ($ok) { + $article->text = str_replace('{socialsharebuttons}', $content, $article->text); + } + return; + } + + /** + * Generate content + * @param object The article object. Note $article->text is also available + * @param object The article params + * @return string Returns html code or empty string. + */ + private function getContent(&$article, &$params){ + + $doc = JFactory::getDocument(); + /* @var $doc JDocumentHtml */ + + $doc->addStyleSheet(JURI::root() . "plugins/content/socialsharebuttons/style/style.css"); + + $url = JURI::getInstance(); + $root= $url->getScheme() ."://" . $url->getHost(); + + $url = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug), false); + $url = $root.$url; + $title= htmlentities($article->title, ENT_QUOTES, "UTF-8"); + + $html = ' + +
+ '; + + $credits = $this->params->get('credits'); + if ($credits) { + $html .= ''; + } + else { + $html .= ''; + } + $html .= ''; + + return $html; + } + + private function getArticle(&$article) { + + $db = JFactory::getDbo(); + + $query = " + SELECT + `#__content`.`id`, + `#__content`.`catid`, + `#__content`.`alias`, + `#__content`.`title`, + `#__categories`.`alias` as category_alias + FROM + `#__content` + INNER JOIN + `#__categories` + ON + `#__content`.`catid`=`#__categories`.`id` + WHERE + `#__content`.`introtext` = " . $db->Quote($article->text); + + $db->setQuery($query); + $result = $db->loadAssoc(); + + if ($db->getErrorNum() != 0) { + JError::raiseError(500, "System error!", $db->getErrorMsg()); + } + + if(!empty($result)) { + $result['slug'] = $result['alias'] ? ($result['id'].':'.$result['alias']) : $result['id']; + $result['catslug'] = $result['category_alias'] ? ($result['catid'].':'.$result['category_alias']) : $result['catid']; + } + + return $result; + } + + private function getTwitter($params, $url, $title){ + + $html = ""; + if($params->get("twitterButton")) { + $html = ' + + '; + } + + return $html; + } + + private function getGooglePlusOne($params, $url, $title){ + $type = ""; + $language = ""; + if($params->get("plusType")) { + $type = 'size="' . $params->get("plusType") . '"'; + } + + if($params->get("plusLocale")) { + $language = " {lang: '" . $params->get("plusLocale") . "'}"; + } + + $html = ""; + if($params->get("plusButton")) { + $html = ' + + '; + } + + return $html; + } + + private function getFacebookLike($params, $url, $title){ + + $html = ""; + if($params->get("facebookLikeButton")) { + + $faces = (!$params->get("facebookLikeFaces")) ? "false" : "true"; + + $layout = $params->get("facebookLikeType","button_count"); + if(strcmp("box_count", $layout)==0){ + $height = "80"; + } else { + $height = "25"; + } + + if(!$params->get("facebookLikeRenderer")){ // iframe + $html = ' + + '; + } else {//XFBML + $html = ' + '; + } + } + + return $html; + } + + private function getDigg($params, $url, $title){ + $title = html_entity_decode($title,ENT_QUOTES, "UTF-8"); + + $html = ""; + if($params->get("diggButton")) { + + $html = ' + + '; + } + + return $html; + } + + private function getStumbpleUpon($params, $url, $title){ + + $html = ""; + if($params->get("stumbleButton")) { + + $html = ' + + '; + } + + return $html; + } + + private function getTumblr($params, $url, $title){ + + $html = ""; + if($params->get("tumblrButton")) { + + if ($params->get("tumblrType") == '1') { $tumblr_style= 'width:81px; background:url(\'http://platform.tumblr.com/v1/share_1.png\')'; } + else if ($params->get("tumblrType") == '2') { $tumblr_style= 'width:81px; background:url(\'http://platform.tumblr.com/v1/share_1T.png\')'; } + else if ($params->get("tumblrType") == '3') { $tumblr_style= 'width:61px; background:url(\'http://platform.tumblr.com/v1/share_2.png\')'; } + else if ($params->get("tumblrType") == '4') { $tumblr_style= 'width:61px; background:url(\'http://platform.tumblr.com/v1/share_2T.png\')'; } + else if ($params->get("tumblrType") == '5') { $tumblr_style= 'width:129px; background:url(\'http://platform.tumblr.com/v1/share_3.png\')'; } + else if ($params->get("tumblrType") == '6') { $tumblr_style= 'width:129px; background:url(\'http://platform.tumblr.com/v1/share_3T.png\')'; } + else if ($params->get("tumblrType") == '7') { $tumblr_style= 'width:20px; background:url(\'http://platform.tumblr.com/v1/share_4.png\')'; } + else if ($params->get("tumblrType") == '8') { $tumblr_style= 'width:20px; background:url(\'http://platform.tumblr.com/v1/share_4T.png\')'; } + + $html = ' + + '; + } + + return $html; + } + + private function getReddit($params, $url, $title){ + + $html = ""; + if($params->get("redditButton")) { + + if ($params->get("redditType") == '1') { $reddit_style= ' submit to reddit '; } + else if ($params->get("redditType") == '2') { $reddit_style= ' submit to reddit '; } + else if ($params->get("redditType") == '3') { $reddit_style= ''; } + else if ($params->get("redditType") == '4') { $reddit_style= ''; } + + $html = ' + + '; + } + + return $html; + } + + private function getPinterest($params, $url, $title){ + + $html = ""; + $article_title = JTable::getInstance("content"); + $article_title->load(JRequest::getInt("id")); + + $image_pin = ""; + $pinterestDesc = ""; + + if ($params->get("pinterestStaticImage")) { + $image_pin = $params->get("pinterestImage"); + } + else { + $first_image = ""; + $text = $article_title->get("introtext"); + $output = preg_match_all('//i', $text, $matches); + if ($output) { + $image_pin = JURI::base().$matches[1][0]; + } + else { + $image_pin = $params->get("pinterestImage"); + } + } + + if ($params->get("pinterestStaticDesc")) { + $pinterestDesc = $params->get("pinterestDesc"); + } + else { + $pinterestDesc = $article_title->get("metadesc"); + if ($pinterestDesc == "") { + $pinterestDesc = $params->get("pinterestDesc"); + } + } + + if($params->get("pinterestButton")) { + + $html = ' + + '; + } + + return $html; + } + + private function getBufferApp($params, $url, $title){ + + $html = ""; + if($params->get("bufferappButton")) { + + $html = ' + + '; + } + + return $html; + } + + private function getLinkedIn($params, $url, $title){ + + $html = ""; + if($params->get("linkedInButton")) { + + $html = ' + + '; + } + + return $html; + } + + private function getBuzz($params, $url, $title){ + + $html = ""; + if($params->get("buzzButton")) { + + $html = ' + + '; + } + + return $html; + } + + private function getReTweetMeMe($params, $url, $title){ + + $html = ""; + if($params->get("retweetmeButton")) { + + $html = ' + '; + } + + return $html; + } + + private function getFacebookShareMe($params, $url, $title){ + + $html = ""; + if($params->get("facebookShareMeButton")) { + + $html = ' + + '; + } + + return $html; + } + +} \ No newline at end of file diff --git a/plugins/content/socialsharebuttons/socialsharebuttons.xml b/plugins/content/socialsharebuttons/socialsharebuttons.xml new file mode 100644 index 0000000..bf56c76 --- /dev/null +++ b/plugins/content/socialsharebuttons/socialsharebuttons.xml @@ -0,0 +1,528 @@ + + + Content - Social Share Buttons + E-max + Aug 2013 + Copyright (C) 2008 - 2013 e-max.it. All rights reserved. + http://www.gnu.org/copyleft/gpl.html GNU/GPL + webmaster@e-max.it + http://www.e-max.it + 1.2.2 + PLG_CONTENT_SOCIALSHAREBUTTONS_DESCRIPTION + + socialsharebuttons.php + assets + style + index.html + + + language/en-GB/en-GB.plg_content_socialsharebuttons.ini + language/en-GB/en-GB.plg_content_socialsharebuttons.sys.ini + language/it-IT/it-IT.plg_content_socialsharebuttons.ini + language/it-IT/it-IT.plg_content_socialsharebuttons.sys.ini + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + +
+
+
+ + http://updates.e-max.it/joomla/updates.xml + +
diff --git a/plugins/content/socialsharebuttons/style/index.html b/plugins/content/socialsharebuttons/style/index.html new file mode 100644 index 0000000..6bfc798 --- /dev/null +++ b/plugins/content/socialsharebuttons/style/index.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/plugins/content/socialsharebuttons/style/style.css b/plugins/content/socialsharebuttons/style/style.css new file mode 100644 index 0000000..57ed737 --- /dev/null +++ b/plugins/content/socialsharebuttons/style/style.css @@ -0,0 +1,85 @@ +@CHARSET "UTF-8"; +.social-share-buttons-share{ + display:block !important; +} + +.social-share-buttons-share-tw{ + float:left; + margin:5px; +} + +.social-share-buttons-share-fbsh{ + float:left; + margin:5px; +} +.social-share-buttons-share-fbl{ + float:left; + margin:5px; +} +.social-share-buttons-share-digg{ + float:left; + margin:5px; +} +.social-share-buttons-share-su{ + float:left; + margin:5px; +} +.social-share-buttons-share-red{ + float:left; + margin:5px; +} + +.social-share-buttons-share-pin{ + float:left; + margin:5px; +} + +.social-share-buttons-share-buf{ + float:left; + margin:5px; +} + +.social-share-buttons-share-tum{ + float:left; + margin:5px; +} +.social-share-buttons-share-lin{ + float:left; + margin:5px; +} +.social-share-buttons-share-buzz{ + float:left; + margin:5px; +} + +.social-share-buttons-share-gone{ + float:left; + margin:5px; +} + +.social-share-buttons-share-retweetme{ + float:left; + margin:5px; +} + +div.sharemebutton{ padding: 0px 0px 0px 0px; float: right; width: 56px; max-height: 195px; text-align: center;} +td.sharemebutton{ padding-right: 0px; padding-top: 10px; padding-bottom:0px; margin-bottom:0px; margin-top: 0px; vertical-align:top; } +td.space_right{padding: 0px 0px 0px 0px;} +div.sharemebuttont{ padding: 0px 2px 0px 0px; float: right; } +td.sharemebuttont{ padding-right: 0px; padding-top: 10px; padding-bottom:0px; margin-bottom:0px; margin-top: 0px; vertical-align:top; } +td.space_right{ padding: 0px 0px 0px 0px;} +div.sharemebuttonf{ padding: 2px 2px 0px 0px; float: right;} +td.sharemebuttonf{ padding-right: 2px; padding-top: 10px; padding-bottom:0px; margin-bottom:0px; margin-top: 0px; vertical-align:top;} +.fb_share_large .fb_sharecount_zero { + -moz-border-radius: 2px 2px 2px 2px; + background: url("http://static.fbshare.me/f_only.png") no-repeat scroll 20px 5px #3B5998; + display: block; + height: 47px; + margin-bottom: 2px; + width: 53px; +} +.social_share_buttons_credits { + width: 100%; + text-align: right; + clear:both; +} \ No newline at end of file diff --git a/plugins/content/vote/index.html b/plugins/content/vote/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/content/vote/index.html @@ -0,0 +1 @@ + diff --git a/plugins/content/vote/tmpl/rating.php b/plugins/content/vote/tmpl/rating.php new file mode 100644 index 0000000..acbc752 --- /dev/null +++ b/plugins/content/vote/tmpl/rating.php @@ -0,0 +1,53 @@ +rating; + +// Look for images in template if available +$starImageOn = JHtml::_('image', 'system/rating_star.png', JText::_('PLG_VOTE_STAR_ACTIVE'), null, true); +$starImageOff = JHtml::_('image', 'system/rating_star_blank.png', JText::_('PLG_VOTE_STAR_INACTIVE'), null, true); + +$img = ''; +for ($i = 0; $i < $rating; $i++) +{ + $img .= $starImageOn; +} + +for ($i = $rating; $i < 5; $i++) +{ + $img .= $starImageOff; +} + +?> +
+

+ ' . $rating . '', '5'); ?> + + +

+ +
diff --git a/plugins/content/vote/tmpl/vote.php b/plugins/content/vote/tmpl/vote.php new file mode 100644 index 0000000..3e27ed6 --- /dev/null +++ b/plugins/content/vote/tmpl/vote.php @@ -0,0 +1,45 @@ +setVar('hitcount', '0'); + +// Create option list for voting select box +$options = array(); + +for ($i = 1; $i < 6; $i++) +{ + $options[] = JHtml::_('select.option', $i, JText::sprintf('PLG_VOTE_VOTE', $i)); +} + +?> +
+ + + id); ?> +   + + + + + +
diff --git a/plugins/content/vote/vote.php b/plugins/content/vote/vote.php new file mode 100644 index 0000000..82b5cc5 --- /dev/null +++ b/plugins/content/vote/vote.php @@ -0,0 +1,144 @@ +votingPosition = $this->params->get('position', 'top'); + } + + /** + * Displays the voting area when viewing an article and the voting section is displayed before the article + * + * @param string $context The context of the content being passed to the plugin + * @param object &$row The article object + * @param object &$params The article params + * @param integer $page The 'page' number + * + * @return string|boolean HTML string containing code for the votes if in com_content else boolean false + * + * @since 1.6 + */ + public function onContentBeforeDisplay($context, &$row, &$params, $page = 0) + { + if ($this->votingPosition !== 'top') + { + return ''; + } + + return $this->displayVotingData($context, $row, $params, $page); + } + + /** + * Displays the voting area when viewing an article and the voting section is displayed after the article + * + * @param string $context The context of the content being passed to the plugin + * @param object &$row The article object + * @param object &$params The article params + * @param integer $page The 'page' number + * + * @return string|boolean HTML string containing code for the votes if in com_content else boolean false + * + * @since 3.7.0 + */ + public function onContentAfterDisplay($context, &$row, &$params, $page = 0) + { + if ($this->votingPosition !== 'bottom') + { + return ''; + } + + return $this->displayVotingData($context, $row, $params, $page); + } + + /** + * Displays the voting area + * + * @param string $context The context of the content being passed to the plugin + * @param object &$row The article object + * @param object &$params The article params + * @param integer $page The 'page' number + * + * @return string|boolean HTML string containing code for the votes if in com_content else boolean false + * + * @since 3.7.0 + */ + private function displayVotingData($context, &$row, &$params, $page) + { + $parts = explode('.', $context); + + if ($parts[0] !== 'com_content') + { + return false; + } + + if (empty($params) || !$params->get('show_vote', null)) + { + return ''; + } + + // Load plugin language files only when needed (ex: they are not needed if show_vote is not active). + $this->loadLanguage(); + + // Get the path for the rating summary layout file + $path = JPluginHelper::getLayoutPath('content', 'vote', 'rating'); + + // Render the layout + ob_start(); + include $path; + $html = ob_get_clean(); + + if ($this->app->input->getString('view', '') === 'article' && $row->state == 1) + { + // Get the path for the voting form layout file + $path = JPluginHelper::getLayoutPath('content', 'vote', 'vote'); + + // Render the layout + ob_start(); + include $path; + $html .= ob_get_clean(); + } + + return $html; + } +} diff --git a/plugins/content/vote/vote.xml b/plugins/content/vote/vote.xml new file mode 100644 index 0000000..42881e6 --- /dev/null +++ b/plugins/content/vote/vote.xml @@ -0,0 +1,36 @@ + + + plg_content_vote + Joomla! Project + November 2005 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_VOTE_XML_DESCRIPTION + + vote.php + tmpl + + + en-GB.plg_content_vote.ini + en-GB.plg_content_vote.sys.ini + + + +
+ + + + +
+
+
+
diff --git a/plugins/editors-xtd/article/article.php b/plugins/editors-xtd/article/article.php new file mode 100644 index 0000000..3b35f75 --- /dev/null +++ b/plugins/editors-xtd/article/article.php @@ -0,0 +1,69 @@ +input; + $user = JFactory::getUser(); + + // Can create in any category (component permission) or at least in one category + $canCreateRecords = $user->authorise('core.create', 'com_content') + || count($user->getAuthorisedCategories('com_content', 'core.create')) > 0; + + // Instead of checking edit on all records, we can use **same** check as the form editing view + $values = (array) JFactory::getApplication()->getUserState('com_content.edit.article.id'); + $isEditingRecords = count($values); + + // This ACL check is probably a double-check (form view already performed checks) + $hasAccess = $canCreateRecords || $isEditingRecords; + if (!$hasAccess) + { + return; + } + + $link = 'index.php?option=com_content&view=articles&layout=modal&tmpl=component&' + . JSession::getFormToken() . '=1&editor=' . $name; + + $button = new JObject; + $button->modal = true; + $button->class = 'btn'; + $button->link = $link; + $button->text = JText::_('PLG_ARTICLE_BUTTON_ARTICLE'); + $button->name = 'file-add'; + $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; + + return $button; + } +} diff --git a/plugins/editors-xtd/article/article.xml b/plugins/editors-xtd/article/article.xml new file mode 100644 index 0000000..0586349 --- /dev/null +++ b/plugins/editors-xtd/article/article.xml @@ -0,0 +1,19 @@ + + + plg_editors-xtd_article + Joomla! Project + October 2009 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_ARTICLE_XML_DESCRIPTION + + article.php + + + en-GB.plg_editors-xtd_article.ini + en-GB.plg_editors-xtd_article.sys.ini + + diff --git a/plugins/editors-xtd/article/index.html b/plugins/editors-xtd/article/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/editors-xtd/article/index.html @@ -0,0 +1 @@ + diff --git a/plugins/editors-xtd/contact/contact.php b/plugins/editors-xtd/contact/contact.php new file mode 100644 index 0000000..d51abea --- /dev/null +++ b/plugins/editors-xtd/contact/contact.php @@ -0,0 +1,59 @@ +authorise('core.create', 'com_contact') + || $user->authorise('core.edit', 'com_contact') + || $user->authorise('core.edit.own', 'com_contact')) + { + // The URL for the contacts list + $link = 'index.php?option=com_contact&view=contacts&layout=modal&tmpl=component&' + . JSession::getFormToken() . '=1&editor=' . $name; + + $button = new JObject; + $button->modal = true; + $button->class = 'btn'; + $button->link = $link; + $button->text = JText::_('PLG_EDITORS-XTD_CONTACT_BUTTON_CONTACT'); + $button->name = 'address'; + $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; + + return $button; + } + } +} diff --git a/plugins/editors-xtd/contact/contact.xml b/plugins/editors-xtd/contact/contact.xml new file mode 100644 index 0000000..df5f47a --- /dev/null +++ b/plugins/editors-xtd/contact/contact.xml @@ -0,0 +1,19 @@ + + + plg_editors-xtd_contact + Joomla! Project + October 2016 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.7.0 + PLG_EDITORS-XTD_CONTACT_XML_DESCRIPTION + + contact.php + + + en-GB.plg_editors-xtd_contact.ini + en-GB.plg_editors-xtd_contact.sys.ini + + diff --git a/plugins/editors-xtd/fields/fields.php b/plugins/editors-xtd/fields/fields.php new file mode 100644 index 0000000..0c8f095 --- /dev/null +++ b/plugins/editors-xtd/fields/fields.php @@ -0,0 +1,71 @@ +input; + $context = $jinput->get('option') . '.' . $jinput->get('view'); + + // Validate context. + $context = implode('.', FieldsHelper::extract($context)); + if (!FieldsHelper::getFields($context)) + { + return; + } + + $link = 'index.php?option=com_fields&view=fields&layout=modal&tmpl=component&context=' + . $context . '&editor=' . $name . '&' . JSession::getFormToken() . '=1'; + + $button = new JObject; + $button->modal = true; + $button->class = 'btn'; + $button->link = $link; + $button->text = JText::_('PLG_EDITORS-XTD_FIELDS_BUTTON_FIELD'); + $button->name = 'puzzle'; + $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; + + return $button; + } +} diff --git a/plugins/editors-xtd/fields/fields.xml b/plugins/editors-xtd/fields/fields.xml new file mode 100644 index 0000000..a708f59 --- /dev/null +++ b/plugins/editors-xtd/fields/fields.xml @@ -0,0 +1,19 @@ + + + plg_editors-xtd_fields + Joomla! Project + February 2017 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.7.0 + PLG_EDITORS-XTD_FIELDS_XML_DESCRIPTION + + fields.php + + + en-GB.plg_editors-xtd_fields.ini + en-GB.plg_editors-xtd_fields.sys.ini + + diff --git a/plugins/editors-xtd/image/image.php b/plugins/editors-xtd/image/image.php new file mode 100644 index 0000000..7f424c2 --- /dev/null +++ b/plugins/editors-xtd/image/image.php @@ -0,0 +1,75 @@ +input->get('option'); + + // For categories we check the extension (ex: component.section) + if ($extension === 'com_categories') + { + $parts = explode('.', $app->input->get('extension', 'com_content')); + $extension = $parts[0]; + } + + $asset = $asset !== '' ? $asset : $extension; + + if ($user->authorise('core.edit', $asset) + || $user->authorise('core.create', $asset) + || (count($user->getAuthorisedCategories($asset, 'core.create')) > 0) + || ($user->authorise('core.edit.own', $asset) && $author === $user->id) + || (count($user->getAuthorisedCategories($extension, 'core.edit')) > 0) + || (count($user->getAuthorisedCategories($extension, 'core.edit.own')) > 0 && $author === $user->id)) + { + $link = 'index.php?option=com_media&view=images&tmpl=component&e_name=' . $name . '&asset=' . $asset . '&author=' . $author; + + $button = new JObject; + $button->modal = true; + $button->class = 'btn'; + $button->link = $link; + $button->text = JText::_('PLG_IMAGE_BUTTON_IMAGE'); + $button->name = 'pictures'; + $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; + + return $button; + } + + return false; + } +} diff --git a/plugins/editors-xtd/image/image.xml b/plugins/editors-xtd/image/image.xml new file mode 100644 index 0000000..a9b0cfd --- /dev/null +++ b/plugins/editors-xtd/image/image.xml @@ -0,0 +1,19 @@ + + + plg_editors-xtd_image + Joomla! Project + August 2004 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_IMAGE_XML_DESCRIPTION + + image.php + + + en-GB.plg_editors-xtd_image.ini + en-GB.plg_editors-xtd_image.sys.ini + + diff --git a/plugins/editors-xtd/image/index.html b/plugins/editors-xtd/image/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/editors-xtd/image/index.html @@ -0,0 +1 @@ + diff --git a/plugins/editors-xtd/index.html b/plugins/editors-xtd/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/editors-xtd/index.html @@ -0,0 +1 @@ + diff --git a/plugins/editors-xtd/menu/menu.php b/plugins/editors-xtd/menu/menu.php new file mode 100644 index 0000000..132b3d7 --- /dev/null +++ b/plugins/editors-xtd/menu/menu.php @@ -0,0 +1,60 @@ +authorise('core.create', 'com_menus') + || $user->authorise('core.edit', 'com_menus')) + { + $link = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&' + . JSession::getFormToken() . '=1&editor=' . $name; + + $button = new JObject; + $button->modal = true; + $button->class = 'btn'; + $button->link = $link; + $button->text = JText::_('PLG_EDITORS-XTD_MENU_BUTTON_MENU'); + $button->name = 'share-alt'; + $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; + + return $button; + } + } +} diff --git a/plugins/editors-xtd/menu/menu.xml b/plugins/editors-xtd/menu/menu.xml new file mode 100644 index 0000000..c3897f8 --- /dev/null +++ b/plugins/editors-xtd/menu/menu.xml @@ -0,0 +1,19 @@ + + + plg_editors-xtd_menu + Joomla! Project + August 2016 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.7.0 + PLG_EDITORS-XTD_MENU_XML_DESCRIPTION + + menu.php + + + en-GB.plg_editors-xtd_menu.ini + en-GB.plg_editors-xtd_menu.sys.ini + + diff --git a/plugins/editors-xtd/module/module.php b/plugins/editors-xtd/module/module.php new file mode 100644 index 0000000..092885b --- /dev/null +++ b/plugins/editors-xtd/module/module.php @@ -0,0 +1,62 @@ +authorise('core.create', 'com_modules') + || $user->authorise('core.edit', 'com_modules') + || $user->authorise('core.edit.own', 'com_modules')) + { + $link = 'index.php?option=com_modules&view=modules&layout=modal&tmpl=component&editor=' + . $name . '&' . JSession::getFormToken() . '=1'; + + $button = new JObject; + $button->modal = true; + $button->class = 'btn'; + $button->link = $link; + $button->text = JText::_('PLG_MODULE_BUTTON_MODULE'); + $button->name = 'file-add'; + $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; + + return $button; + } + } +} diff --git a/plugins/editors-xtd/module/module.xml b/plugins/editors-xtd/module/module.xml new file mode 100644 index 0000000..1b0b895 --- /dev/null +++ b/plugins/editors-xtd/module/module.xml @@ -0,0 +1,19 @@ + + + plg_editors-xtd_module + Joomla! Project + October 2015 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.5.0 + PLG_MODULE_XML_DESCRIPTION + + module.php + + + en-GB.plg_editors-xtd_module.ini + en-GB.plg_editors-xtd_module.sys.ini + + diff --git a/plugins/editors-xtd/pagebreak/index.html b/plugins/editors-xtd/pagebreak/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/editors-xtd/pagebreak/index.html @@ -0,0 +1 @@ + diff --git a/plugins/editors-xtd/pagebreak/pagebreak.php b/plugins/editors-xtd/pagebreak/pagebreak.php new file mode 100644 index 0000000..7100d09 --- /dev/null +++ b/plugins/editors-xtd/pagebreak/pagebreak.php @@ -0,0 +1,69 @@ +input; + $user = JFactory::getUser(); + + // Can create in any category (component permission) or at least in one category + $canCreateRecords = $user->authorise('core.create', 'com_content') + || count($user->getAuthorisedCategories('com_content', 'core.create')) > 0; + + // Instead of checking edit on all records, we can use **same** check as the form editing view + $values = (array) JFactory::getApplication()->getUserState('com_content.edit.article.id'); + $isEditingRecords = count($values); + + // This ACL check is probably a double-check (form view already performed checks) + $hasAccess = $canCreateRecords || $isEditingRecords; + if (!$hasAccess) + { + return; + } + + JFactory::getDocument()->addScriptOptions('xtd-pagebreak', array('editor' => $name)); + $link = 'index.php?option=com_content&view=article&layout=pagebreak&tmpl=component&e_name=' . $name; + + $button = new JObject; + $button->modal = true; + $button->class = 'btn'; + $button->link = $link; + $button->text = JText::_('PLG_EDITORSXTD_PAGEBREAK_BUTTON_PAGEBREAK'); + $button->name = 'copy'; + $button->options = "{handler: 'iframe', size: {x: 500, y: 300}}"; + + return $button; + } +} diff --git a/plugins/editors-xtd/pagebreak/pagebreak.xml b/plugins/editors-xtd/pagebreak/pagebreak.xml new file mode 100644 index 0000000..b42f735 --- /dev/null +++ b/plugins/editors-xtd/pagebreak/pagebreak.xml @@ -0,0 +1,19 @@ + + + plg_editors-xtd_pagebreak + Joomla! Project + August 2004 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_EDITORSXTD_PAGEBREAK_XML_DESCRIPTION + + pagebreak.php + + + en-GB.plg_editors-xtd_pagebreak.ini + en-GB.plg_editors-xtd_pagebreak.sys.ini + + diff --git a/plugins/editors-xtd/phocadownload/assets/css/index.html b/plugins/editors-xtd/phocadownload/assets/css/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/plugins/editors-xtd/phocadownload/assets/css/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/editors-xtd/phocadownload/assets/css/phocadownload.css b/plugins/editors-xtd/phocadownload/assets/css/phocadownload.css new file mode 100644 index 0000000..58b742f --- /dev/null +++ b/plugins/editors-xtd/phocadownload/assets/css/phocadownload.css @@ -0,0 +1,4 @@ + +.button2-left .phocadownload { + background: url(../images/icon-button.png) 100% 0 no-repeat; +} \ No newline at end of file diff --git a/plugins/editors-xtd/phocadownload/assets/images/icon-button.png b/plugins/editors-xtd/phocadownload/assets/images/icon-button.png new file mode 100644 index 0000000..fba8aa0 Binary files /dev/null and b/plugins/editors-xtd/phocadownload/assets/images/icon-button.png differ diff --git a/plugins/editors-xtd/phocadownload/assets/images/index.html b/plugins/editors-xtd/phocadownload/assets/images/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/plugins/editors-xtd/phocadownload/assets/images/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/editors-xtd/phocadownload/assets/index.html b/plugins/editors-xtd/phocadownload/assets/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/plugins/editors-xtd/phocadownload/assets/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/editors-xtd/phocadownload/index.html b/plugins/editors-xtd/phocadownload/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/plugins/editors-xtd/phocadownload/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/editors-xtd/phocadownload/phocadownload.php b/plugins/editors-xtd/phocadownload/phocadownload.php new file mode 100644 index 0000000..d9ec5ff --- /dev/null +++ b/plugins/editors-xtd/phocadownload/phocadownload.php @@ -0,0 +1,57 @@ +loadLanguage(); + } + + function onDisplay($name, $asset, $author) { + + $app = JFactory::getApplication(); + + $document = & JFactory::getDocument(); + $template = $app->getTemplate(); + + $enableFrontend = $this->params->get('enable_frontend', 0); + + if ($template != 'beez_20') { + JHTML::stylesheet( 'plugins/editors-xtd/phocadownload/assets/css/phocadownload.css' ); + } + + $link = 'index.php?option=com_phocadownload&view=phocadownloadlinks&tmpl=component&e_name='.$name; + + JHTML::_('behavior.modal'); + + + + $button = new JObject; + $button->modal = true; + $button->class = 'btn'; + $button->link = $link; + $button->text = JText::_('PLG_EDITORS-XTD_PHOCADOWNLOAD_FILE'); + $button->name = 'file'; + $button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; + + if ($enableFrontend == 0) { + if (!$app->isAdmin()) { + $button = null; + } + } + + return $button; + } +} \ No newline at end of file diff --git a/plugins/editors-xtd/phocadownload/phocadownload.xml b/plugins/editors-xtd/phocadownload/phocadownload.xml new file mode 100644 index 0000000..72179a3 --- /dev/null +++ b/plugins/editors-xtd/phocadownload/phocadownload.xml @@ -0,0 +1,42 @@ + + + plg_editors-xtd_phocadownload + 17/08/2013 + Jan Pavelka (www.phoca.cz) + + www.phoca.cz + Jan Pavelka + GNU/GPL + 3.0.1 + + PLG_EDITORS-XTD_PHOCADOWNLOAD_DESCRIPTION + + + phocadownload.php + index.html + assets + + + + language/en-GB/en-GB.plg_editors-xtd_phocadownload.ini + language/en-GB/en-GB.plg_editors-xtd_phocadownload.sys.ini + + + + + language/en-GB/en-GB.plg_editors-xtd_phocadownload.ini + language/en-GB/en-GB.plg_editors-xtd_phocadownload.sys.ini + + + + + +
+ + + + +
+
+
+
diff --git a/plugins/editors-xtd/phocagallery/assets/css/index.html b/plugins/editors-xtd/phocagallery/assets/css/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/plugins/editors-xtd/phocagallery/assets/css/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/editors-xtd/phocagallery/assets/css/phocagallery.css b/plugins/editors-xtd/phocagallery/assets/css/phocagallery.css new file mode 100644 index 0000000..3f13cfb --- /dev/null +++ b/plugins/editors-xtd/phocagallery/assets/css/phocagallery.css @@ -0,0 +1,4 @@ + +.button2-left .phocagallery { + background: url(../images/icon-button.png) 100% 0 no-repeat; +} \ No newline at end of file diff --git a/plugins/editors-xtd/phocagallery/assets/images/icon-button.png b/plugins/editors-xtd/phocagallery/assets/images/icon-button.png new file mode 100644 index 0000000..76ea962 Binary files /dev/null and b/plugins/editors-xtd/phocagallery/assets/images/icon-button.png differ diff --git a/plugins/editors-xtd/phocagallery/assets/images/index.html b/plugins/editors-xtd/phocagallery/assets/images/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/plugins/editors-xtd/phocagallery/assets/images/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/editors-xtd/phocagallery/assets/index.html b/plugins/editors-xtd/phocagallery/assets/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/plugins/editors-xtd/phocagallery/assets/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/editors-xtd/phocagallery/index.html b/plugins/editors-xtd/phocagallery/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/plugins/editors-xtd/phocagallery/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/editors-xtd/phocagallery/phocagallery.php b/plugins/editors-xtd/phocagallery/phocagallery.php new file mode 100644 index 0000000..510441c --- /dev/null +++ b/plugins/editors-xtd/phocagallery/phocagallery.php @@ -0,0 +1,55 @@ +loadLanguage(); + } + + function onDisplay($name, $asset, $author) { + + $app = JFactory::getApplication(); + + $document = & JFactory::getDocument(); + $template = $app->getTemplate(); + + $enableFrontend = $this->params->get('enable_frontend', 0); + + if ($template != 'beez_20') { + JHTML::stylesheet( 'plugins/editors-xtd/phocagallery/assets/css/phocagallery.css' ); + } + + $link = 'index.php?option=com_phocagallery&view=phocagallerylinks&tmpl=component&e_name='.$name; + + JHTML::_('behavior.modal'); + + $button = new JObject(); + $button->set('modal', true); + $button->set('link', $link); + $button->set('text', JText::_('PLG_EDITORS-XTD_PHOCAGALLERY_IMAGE')); + $button->set('name', 'phocagallery'); + $button->set('options', "{handler: 'iframe', size: {x: 600, y: 400}}"); + + if ($enableFrontend == 0) { + if (!$app->isAdmin()) { + $button = null; + } + } + + return $button; + } +} \ No newline at end of file diff --git a/plugins/editors-xtd/phocagallery/phocagallery.xml b/plugins/editors-xtd/phocagallery/phocagallery.xml new file mode 100644 index 0000000..010c5ef --- /dev/null +++ b/plugins/editors-xtd/phocagallery/phocagallery.xml @@ -0,0 +1,42 @@ + + + plg_editors-xtd_phocagallery + 09/06/2011 + Jan Pavelka (www.phoca.cz) + + www.phoca.cz + Jan Pavelka + GNU/GPL + 3.0.1 + + PLG_EDITORS-XTD_PHOCAGALLERY_DESCRIPTION + + + phocagallery.php + index.html + assets + + + + language/en-GB/en-GB.plg_editors-xtd_phocagallery.ini + language/en-GB/en-GB.plg_editors-xtd_phocagallery.sys.ini + + + + + language/en-GB/en-GB.plg_editors-xtd_phocagallery.ini + language/en-GB/en-GB.plg_editors-xtd_phocagallery.sys.ini + + + + + +
+ + + + +
+
+
+
diff --git a/plugins/editors-xtd/podcastmanager/index.html b/plugins/editors-xtd/podcastmanager/index.html new file mode 100644 index 0000000..3af6301 --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/editors-xtd/podcastmanager/language/en-GB/en-GB.plg_editors-xtd_podcastmanager.ini b/plugins/editors-xtd/podcastmanager/language/en-GB/en-GB.plg_editors-xtd_podcastmanager.ini new file mode 100644 index 0000000..84fe432 --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/en-GB/en-GB.plg_editors-xtd_podcastmanager.ini @@ -0,0 +1,9 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_EDITORS-XTD_PODCASTMANAGER="Button - Podcast Manager" +PLG_EDITORS-XTD_PODCASTMANAGER_BUTTON="Podcast" +PLG_EDITORS-XTD_PODCASTMANAGER_BUTTON_TOOLTIP="Select a podcast episode to be added to the article." +PLG_EDITORS-XTD_PODCASTMANAGER_XML_DESCRIPTION="The Podcast Manager Button plugin adds a Podcast button to the article editor" diff --git a/plugins/editors-xtd/podcastmanager/language/en-GB/en-GB.plg_editors-xtd_podcastmanager.sys.ini b/plugins/editors-xtd/podcastmanager/language/en-GB/en-GB.plg_editors-xtd_podcastmanager.sys.ini new file mode 100644 index 0000000..4a0a8cf --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/en-GB/en-GB.plg_editors-xtd_podcastmanager.sys.ini @@ -0,0 +1,9 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_EDITORS-XTD_PODCASTMANAGER="Button - Podcast Manager" +PLG_EDITORS-XTD_PODCASTMANAGER_ERROR_ACTIVATING_PLUGIN="Could not automatically activate the "_QQ_"Button - Podcast Manager"_QQ_" plugin" +PLG_EDITORS-XTD_PODCASTMANAGER_ERROR_COMPONENT="You do not have Podcast Manager installed. Please install it before installing this plugin." +PLG_EDITORS-XTD_PODCASTMANAGER_XML_DESCRIPTION="The Podcast Manager Button plugin adds a Podcast button to the article editor" diff --git a/plugins/editors-xtd/podcastmanager/language/en-GB/index.html b/plugins/editors-xtd/podcastmanager/language/en-GB/index.html new file mode 100644 index 0000000..3af6301 --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/en-GB/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/editors-xtd/podcastmanager/language/fr-CA/fr-CA.plg_editors-xtd_podcastmanager.ini b/plugins/editors-xtd/podcastmanager/language/fr-CA/fr-CA.plg_editors-xtd_podcastmanager.ini new file mode 100644 index 0000000..c59876f --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/fr-CA/fr-CA.plg_editors-xtd_podcastmanager.ini @@ -0,0 +1,9 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_EDITORS-XTD_PODCASTMANAGER="Bouton - Gestionnaire de balados" +PLG_EDITORS-XTD_PODCASTMANAGER_BUTTON="Balado" +PLG_EDITORS-XTD_PODCASTMANAGER_BUTTON_TOOLTIP="Choisir un épisode de balado à ajouter à l'article." +PLG_EDITORS-XTD_PODCASTMANAGER_XML_DESCRIPTION="Le plugiciel de bouton du gestionnaire de balados ajoute un bouton « Balado » à l'éditeur d'articles." diff --git a/plugins/editors-xtd/podcastmanager/language/fr-CA/fr-CA.plg_editors-xtd_podcastmanager.sys.ini b/plugins/editors-xtd/podcastmanager/language/fr-CA/fr-CA.plg_editors-xtd_podcastmanager.sys.ini new file mode 100644 index 0000000..adacd5d --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/fr-CA/fr-CA.plg_editors-xtd_podcastmanager.sys.ini @@ -0,0 +1,9 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_EDITORS-XTD_PODCASTMANAGER="Bouton - Gestionnaire de balados" +PLG_EDITORS-XTD_PODCASTMANAGER_ERROR_ACTIVATING_PLUGIN="Impossible d'activer automatiquement le plugiciel « Bouton - Gestionnaire de balados »" +PLG_EDITORS-XTD_PODCASTMANAGER_ERROR_COMPONENT="Le Gestionnaire de balados n'est pas installé. Veuillez le faire avant d'installer ce plugiciel." +PLG_EDITORS-XTD_PODCASTMANAGER_XML_DESCRIPTION="Le plugiciel « Bouton du gestionnaire de balados » ajoute un bouton « Balado » à l'éditeur d'articles." diff --git a/plugins/editors-xtd/podcastmanager/language/fr-CA/index.html b/plugins/editors-xtd/podcastmanager/language/fr-CA/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/fr-CA/index.html @@ -0,0 +1 @@ + diff --git a/plugins/editors-xtd/podcastmanager/language/fr-FR/fr-FR.plg_editors-xtd_podcastmanager.ini b/plugins/editors-xtd/podcastmanager/language/fr-FR/fr-FR.plg_editors-xtd_podcastmanager.ini new file mode 100644 index 0000000..ae30bbc --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/fr-FR/fr-FR.plg_editors-xtd_podcastmanager.ini @@ -0,0 +1,9 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_EDITORS-XTD_PODCASTMANAGER="Bouton - Podcast Manager" +PLG_EDITORS-XTD_PODCASTMANAGER_BUTTON="Podcast" +PLG_EDITORS-XTD_PODCASTMANAGER_BUTTON_TOOLTIP="Sélectionner un épisode du podcast pour l'ajouter dans l'article." +PLG_EDITORS-XTD_PODCASTMANAGER_XML_DESCRIPTION="Le plugin "_QQ_"Bouton - Podcast Manager"_QQ_" ajoute un bouton "_QQ_"Podcast"_QQ_" dans l'éditeur d'articles." diff --git a/plugins/editors-xtd/podcastmanager/language/fr-FR/fr-FR.plg_editors-xtd_podcastmanager.sys.ini b/plugins/editors-xtd/podcastmanager/language/fr-FR/fr-FR.plg_editors-xtd_podcastmanager.sys.ini new file mode 100644 index 0000000..8180636 --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/fr-FR/fr-FR.plg_editors-xtd_podcastmanager.sys.ini @@ -0,0 +1,9 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_EDITORS-XTD_PODCASTMANAGER="Bouton - Podcast Manager" +PLG_EDITORS-XTD_PODCASTMANAGER_ERROR_ACTIVATING_PLUGIN="Impossible d'activer automatiquement le plugin "_QQ_"Bouton - Podcast Manager"_QQ_"" +PLG_EDITORS-XTD_PODCASTMANAGER_ERROR_COMPONENT="Vous n'avez pas installé Podcast Manager. Veuillez l'installer avant d'installer ce plugin." +PLG_EDITORS-XTD_PODCASTMANAGER_XML_DESCRIPTION="Le plugin "_QQ_"Bouton - Podcast Manager"_QQ_" ajoute un bouton "_QQ_"Podcast"_QQ_" dans l'éditeur d'articles." diff --git a/plugins/editors-xtd/podcastmanager/language/fr-FR/index.html b/plugins/editors-xtd/podcastmanager/language/fr-FR/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/fr-FR/index.html @@ -0,0 +1 @@ + diff --git a/plugins/editors-xtd/podcastmanager/language/id-ID/id-ID.plg_editors-xtd_podcastmanager.ini b/plugins/editors-xtd/podcastmanager/language/id-ID/id-ID.plg_editors-xtd_podcastmanager.ini new file mode 100644 index 0000000..47f8711 --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/id-ID/id-ID.plg_editors-xtd_podcastmanager.ini @@ -0,0 +1,9 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_EDITORS-XTD_PODCASTMANAGER="Tombol - Podcast Manager" +PLG_EDITORS-XTD_PODCASTMANAGER_BUTTON="Podcast" +PLG_EDITORS-XTD_PODCASTMANAGER_BUTTON_TOOLTIP="Pilih episode podcast untuk ditambahakn ke dalam artikel." +PLG_EDITORS-XTD_PODCASTMANAGER_XML_DESCRIPTION="Plugin Tombol Podcast Manager menambahkan tombol Podcast ke dalam editor artikel" diff --git a/plugins/editors-xtd/podcastmanager/language/id-ID/id-ID.plg_editors-xtd_podcastmanager.sys.ini b/plugins/editors-xtd/podcastmanager/language/id-ID/id-ID.plg_editors-xtd_podcastmanager.sys.ini new file mode 100644 index 0000000..71d35bc --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/id-ID/id-ID.plg_editors-xtd_podcastmanager.sys.ini @@ -0,0 +1,9 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_EDITORS-XTD_PODCASTMANAGER="Tombol - Podcast Manager" +PLG_EDITORS-XTD_PODCASTMANAGER_ERROR_ACTIVATING_PLUGIN="Tidak bisa mengaktifkan plugin "_QQ_"Tombol - Podcast Manager"_QQ_" secara otomatis" +PLG_EDITORS-XTD_PODCASTMANAGER_ERROR_COMPONENT="Anda tidak memiliki Podcast Manager yang terpasang. Silakan pasang sebelum memasang plugin ini." +PLG_EDITORS-XTD_PODCASTMANAGER_XML_DESCRIPTION="Plugin Tombol Podcast Manager menambahkan tombol Podcast ke dalam editor artikel" diff --git a/plugins/editors-xtd/podcastmanager/language/id-ID/index.html b/plugins/editors-xtd/podcastmanager/language/id-ID/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/id-ID/index.html @@ -0,0 +1 @@ + diff --git a/plugins/editors-xtd/podcastmanager/language/index.html b/plugins/editors-xtd/podcastmanager/language/index.html new file mode 100644 index 0000000..3af6301 --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/editors-xtd/podcastmanager/language/pt-BR/index.html b/plugins/editors-xtd/podcastmanager/language/pt-BR/index.html new file mode 100644 index 0000000..3af6301 --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/pt-BR/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/editors-xtd/podcastmanager/language/pt-BR/pt-BR.plg_editors-xtd_podcastmanager.ini b/plugins/editors-xtd/podcastmanager/language/pt-BR/pt-BR.plg_editors-xtd_podcastmanager.ini new file mode 100644 index 0000000..e79f718 --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/pt-BR/pt-BR.plg_editors-xtd_podcastmanager.ini @@ -0,0 +1,9 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_EDITORS-XTD_PODCASTMANAGER="Botão - Podcast Manager" +PLG_EDITORS-XTD_PODCASTMANAGER_BUTTON="Podcast" +PLG_EDITORS-XTD_PODCASTMANAGER_BUTTON_TOOLTIP="Selecione um episódio de podcast a ser adicionado ao artigo." +PLG_EDITORS-XTD_PODCASTMANAGER_XML_DESCRIPTION="O plugin Podcast Manager Button adiciona um botão Podcast ao editor de artigos" diff --git a/plugins/editors-xtd/podcastmanager/language/pt-BR/pt-BR.plg_editors-xtd_podcastmanager.sys.ini b/plugins/editors-xtd/podcastmanager/language/pt-BR/pt-BR.plg_editors-xtd_podcastmanager.sys.ini new file mode 100644 index 0000000..2710153 --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/language/pt-BR/pt-BR.plg_editors-xtd_podcastmanager.sys.ini @@ -0,0 +1,9 @@ +; Podcast Manager for Joomla! +; Copyright (C) 2011-2015 Michael Babker. All rights reserved. +; Note : All ini files need to be saved as UTF-8 - No BOM +; Double quotes in the values have to be formatted as "_QQ_" + +PLG_EDITORS-XTD_PODCASTMANAGER="Botão - Podcast Manager" +PLG_EDITORS-XTD_PODCASTMANAGER_ERROR_ACTIVATING_PLUGIN="Não foi possível ativar automaticamente o plugin "_QQ_"_QQ_"_QQ_"Botão - Podcast Manager"_QQ_"_QQ_"_QQ_"" +PLG_EDITORS-XTD_PODCASTMANAGER_ERROR_COMPONENT="Você não tem o Podcast Manager instalado. Favor instalá-lo antes de instalar este plugin." +PLG_EDITORS-XTD_PODCASTMANAGER_XML_DESCRIPTION="O plugin Botão Podcast Manager adiciona um botão Podcast ao editor de artigos" diff --git a/plugins/editors-xtd/podcastmanager/podcastmanager.php b/plugins/editors-xtd/podcastmanager/podcastmanager.php new file mode 100644 index 0000000..9596ee7 --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/podcastmanager.php @@ -0,0 +1,86 @@ +loadLanguage(); + } + + /** + * Display the button + * + * @param string $name The name of the editor + * + * @return array Markup to display the button + * + * @since 1.6 + */ + public function onDisplay($name) + { + /* + * Javascript to insert the link + * Modal calls PodcastManagerSelectPodcast when a podcast is clicked + * PodcastManagerSelectPodcast creates the plugin syntax, sends it to the editor, + * and closes the modal. + */ + $js = " + function PodcastManagerSelectPodcast(id, object) { + var tag = '{podcast id='+id+'}'; + jInsertEditorText(tag, '" . $name . "'); + SqueezeBox.close(); + }"; + + $doc = JFactory::getDocument(); + $doc->addScriptDeclaration($js); + + JHtml::_('behavior.modal'); + + /* + * Use the modal view to select the podcast. + * Currently uses broadcast class for the image. + */ + $link = 'index.php?option=com_podcastmanager&view=podcasts&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1'; + + $button = new JObject; + $button->modal = true; + $button->link = $link; + $button->class = "btn"; + $button->text = JText::_('PLG_EDITORS-XTD_PODCASTMANAGER_BUTTON'); + $button->name = 'broadcast'; + $button->title = JText::_('PLG_EDITORS-XTD_PODCASTMANAGER_BUTTON_TOOLTIP'); + $button->options = "{handler: 'iframe', size: {x: 770, y: 400}}"; + + return $button; + } +} diff --git a/plugins/editors-xtd/podcastmanager/podcastmanager.xml b/plugins/editors-xtd/podcastmanager/podcastmanager.xml new file mode 100644 index 0000000..abbf2ec --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/podcastmanager.xml @@ -0,0 +1,18 @@ + + + plg_editors-xtd_podcastmanager + 2015-06-22 + Michael Babker + (C) 2011-2015 Michael Babker + mbabker@flbab.com + https://www.babdev.com + 2.2.0 + GNU/GPL Version 2 or later + PLG_EDITORS-XTD_PODCASTMANAGER_XML_DESCRIPTION + script.php + + podcastmanager.php + index.html + language + + diff --git a/plugins/editors-xtd/podcastmanager/script.php b/plugins/editors-xtd/podcastmanager/script.php new file mode 100644 index 0000000..bc194c3 --- /dev/null +++ b/plugins/editors-xtd/podcastmanager/script.php @@ -0,0 +1,86 @@ +activateButton(); + } + + /** + * Function to activate the button at installation + * + * @return void + * + * @since 1.7 + */ + protected function activateButton() + { + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->update($db->quoteName('#__extensions')); + $query->set($db->quoteName('enabled') . ' = 1'); + $query->where($db->quoteName('name') . ' = ' . $db->quote('plg_editors-xtd_podcastmanager')); + $db->setQuery($query); + + if (!$db->query()) + { + JError::raiseNotice(1, JText::_('PLG_EDITORS-XTD_PODCASTMANAGER_ERROR_ACTIVATING_PLUGIN')); + } + } +} diff --git a/plugins/editors-xtd/readmore/index.html b/plugins/editors-xtd/readmore/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/editors-xtd/readmore/index.html @@ -0,0 +1 @@ + diff --git a/plugins/editors-xtd/readmore/readmore.php b/plugins/editors-xtd/readmore/readmore.php new file mode 100644 index 0000000..d151ffa --- /dev/null +++ b/plugins/editors-xtd/readmore/readmore.php @@ -0,0 +1,59 @@ + 'auto', 'relative' => true)); + + // Pass some data to javascript + JFactory::getDocument()->addScriptOptions( + 'xtd-readmore', + array( + 'editor' => $this->_subject->getContent($name), + 'exists' => JText::_('PLG_READMORE_ALREADY_EXISTS', true), + ) + ); + + $button = new JObject; + $button->modal = false; + $button->class = 'btn'; + $button->onclick = 'insertReadmore(\'' . $name . '\');return false;'; + $button->text = JText::_('PLG_READMORE_BUTTON_READMORE'); + $button->name = 'arrow-down'; + $button->link = '#'; + + return $button; + } +} diff --git a/plugins/editors-xtd/readmore/readmore.xml b/plugins/editors-xtd/readmore/readmore.xml new file mode 100644 index 0000000..a658a8c --- /dev/null +++ b/plugins/editors-xtd/readmore/readmore.xml @@ -0,0 +1,19 @@ + + + plg_editors-xtd_readmore + Joomla! Project + March 2006 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_READMORE_XML_DESCRIPTION + + readmore.php + + + en-GB.plg_editors-xtd_readmore.ini + en-GB.plg_editors-xtd_readmore.sys.ini + + diff --git a/plugins/editors/codemirror/codemirror.php b/plugins/editors/codemirror/codemirror.php new file mode 100644 index 0000000..ff6f015 --- /dev/null +++ b/plugins/editors/codemirror/codemirror.php @@ -0,0 +1,358 @@ +trigger('onCodeMirrorBeforeInit', array(&$this->params)); + + $displayData = (object) array('params' => $this->params); + + // We need to do output buffering here because layouts may actually 'echo' things which we do not want. + ob_start(); + JLayoutHelper::render('editors.codemirror.init', $displayData, __DIR__ . '/layouts'); + ob_end_clean(); + + $font = $this->params->get('fontFamily', 0); + $fontInfo = $this->getFontInfo($font); + + if (isset($fontInfo)) + { + if (isset($fontInfo->url)) + { + $doc->addStyleSheet($fontInfo->url); + } + + if (isset($fontInfo->css)) + { + $displayData->fontFamily = $fontInfo->css . '!important'; + } + } + + // We need to do output buffering here because layouts may actually 'echo' things which we do not want. + ob_start(); + JLayoutHelper::render('editors.codemirror.styles', $displayData, __DIR__ . '/layouts'); + ob_end_clean(); + + $dispatcher->trigger('onCodeMirrorAfterInit', array(&$this->params)); + } + + /** + * Copy editor content to form field. + * + * @param string $id The id of the editor field. + * + * @return string Javascript + * + * @deprecated 4.0 Code executes directly on submit + */ + public function onSave($id) + { + return sprintf('document.getElementById(%1$s).value = Joomla.editors.instances[%1$s].getValue();', json_encode((string) $id)); + } + + /** + * Get the editor content. + * + * @param string $id The id of the editor field. + * + * @return string Javascript + * + * @deprecated 4.0 Use directly the returned code + */ + public function onGetContent($id) + { + return sprintf('Joomla.editors.instances[%1$s].getValue();', json_encode((string) $id)); + } + + /** + * Set the editor content. + * + * @param string $id The id of the editor field. + * @param string $content The content to set. + * + * @return string Javascript + * + * @deprecated 4.0 Use directly the returned code + */ + public function onSetContent($id, $content) + { + return sprintf('Joomla.editors.instances[%1$s].setValue(%2$s);', json_encode((string) $id), json_encode((string) $content)); + } + + /** + * Adds the editor specific insert method. + * + * @return void + * + * @deprecated 4.0 Code is loaded in the init script + */ + public function onGetInsertMethod() + { + static $done = false; + + // Do this only once. + if ($done) + { + return true; + } + + $done = true; + + JFactory::getDocument()->addScriptDeclaration(" + ;function jInsertEditorText(text, editor) { Joomla.editors.instances[editor].replaceSelection(text); } + "); + + return true; + } + + /** + * Display the editor area. + * + * @param string $name The control name. + * @param string $content The contents of the text area. + * @param string $width The width of the text area (px or %). + * @param string $height The height of the text area (px or %). + * @param int $col The number of columns for the textarea. + * @param int $row The number of rows for the textarea. + * @param boolean $buttons True and the editor buttons will be displayed. + * @param string $id An optional ID for the textarea (note: since 1.6). If not supplied the name is used. + * @param string $asset Not used. + * @param object $author Not used. + * @param array $params Associative array of editor parameters. + * + * @return string HTML + */ + public function onDisplay( + $name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null, $params = array()) + { + $id = empty($id) ? $name : $id; + + // Must pass the field id to the buttons in this editor. + $buttons = $this->displayButtons($id, $buttons, $asset, $author); + + // Only add "px" to width and height if they are not given as a percentage. + $width .= is_numeric($width) ? 'px' : ''; + $height .= is_numeric($height) ? 'px' : ''; + + // Options for the CodeMirror constructor. + $options = new stdClass; + + // Is field readonly? + if (!empty($params['readonly'])) + { + $options->readOnly = 'nocursor'; + } + + // Should we focus on the editor on load? + $options->autofocus = (boolean) $this->params->get('autoFocus', true); + + // Until there's a fix for the overflow problem, always wrap lines. + $options->lineWrapping = true; + + // Add styling to the active line. + $options->styleActiveLine = (boolean) $this->params->get('activeLine', true); + + // Add styling to the active line. + if ($this->params->get('selectionMatches', false)) + { + $options->highlightSelectionMatches = array( + 'showToken' => true, + 'annotateScrollbar' => true, + ); + } + + // Do we use line numbering? + if ($options->lineNumbers = (boolean) $this->params->get('lineNumbers', 0)) + { + $options->gutters[] = 'CodeMirror-linenumbers'; + } + + // Do we use code folding? + if ($options->foldGutter = (boolean) $this->params->get('codeFolding', 1)) + { + $options->gutters[] = 'CodeMirror-foldgutter'; + } + + // Do we use a marker gutter? + if ($options->markerGutter = (boolean) $this->params->get('markerGutter', $this->params->get('marker-gutter', 0))) + { + $options->gutters[] = 'CodeMirror-markergutter'; + } + + // Load the syntax mode. + $syntax = $this->params->get('syntax', 'html'); + $options->mode = isset($this->modeAlias[$syntax]) ? $this->modeAlias[$syntax] : $syntax; + + // Load the theme if specified. + if ($theme = $this->params->get('theme')) + { + $options->theme = $theme; + JHtml::_('stylesheet', $this->params->get('basePath', 'media/editors/codemirror/') . 'theme/' . $theme . '.css', array('version' => 'auto')); + } + + // Special options for tagged modes (xml/html). + if (in_array($options->mode, array('xml', 'html', 'php'))) + { + // Autogenerate closing tags (html/xml only). + $options->autoCloseTags = (boolean) $this->params->get('autoCloseTags', true); + + // Highlight the matching tag when the cursor is in a tag (html/xml only). + $options->matchTags = (boolean) $this->params->get('matchTags', true); + } + + // Special options for non-tagged modes. + if (!in_array($options->mode, array('xml', 'html'))) + { + // Autogenerate closing brackets. + $options->autoCloseBrackets = (boolean) $this->params->get('autoCloseBrackets', true); + + // Highlight the matching bracket. + $options->matchBrackets = (boolean) $this->params->get('matchBrackets', true); + } + + $options->scrollbarStyle = $this->params->get('scrollbarStyle', 'native'); + + // Vim Keybindings. + $options->vimMode = (boolean) $this->params->get('vimKeyBinding', 0); + + $displayData = (object) array( + 'options' => $options, + 'params' => $this->params, + 'name' => $name, + 'id' => $id, + 'cols' => $col, + 'rows' => $row, + 'content' => $content, + 'buttons' => $buttons + ); + + $dispatcher = JEventDispatcher::getInstance(); + + // At this point, displayData can be modified by a plugin before going to the layout renderer. + $results = $dispatcher->trigger('onCodeMirrorBeforeDisplay', array(&$displayData)); + + $results[] = JLayoutHelper::render('editors.codemirror.element', $displayData, __DIR__ . '/layouts', array('debug' => JDEBUG)); + + foreach ($dispatcher->trigger('onCodeMirrorAfterDisplay', array(&$displayData)) as $result) + { + $results[] = $result; + } + + return implode("\n", $results); + } + + /** + * Displays the editor buttons. + * + * @param string $name Button name. + * @param mixed $buttons [array with button objects | boolean true to display buttons] + * @param mixed $asset Unused. + * @param mixed $author Unused. + * + * @return string HTML + */ + protected function displayButtons($name, $buttons, $asset, $author) + { + $return = ''; + + $args = array( + 'name' => $name, + 'event' => 'onGetInsertMethod' + ); + + $results = (array) $this->update($args); + + if ($results) + { + foreach ($results as $result) + { + if (is_string($result) && trim($result)) + { + $return .= $result; + } + } + } + + if (is_array($buttons) || (is_bool($buttons) && $buttons)) + { + $buttons = $this->_subject->getButtons($name, $buttons, $asset, $author); + + $return .= JLayoutHelper::render('joomla.editors.buttons', $buttons); + } + + return $return; + } + + /** + * Gets font info from the json data file + * + * @param string $font A key from the $fonts array. + * + * @return object + */ + protected function getFontInfo($font) + { + static $fonts; + + if (!$fonts) + { + $fonts = json_decode(file_get_contents(__DIR__ . '/fonts.json'), true); + } + + return isset($fonts[$font]) ? (object) $fonts[$font] : null; + } +} diff --git a/plugins/editors/codemirror/codemirror.xml b/plugins/editors/codemirror/codemirror.xml new file mode 100644 index 0000000..1f5e6b1 --- /dev/null +++ b/plugins/editors/codemirror/codemirror.xml @@ -0,0 +1,326 @@ + + + plg_editors_codemirror + 5.34.0 + 28 March 2011 + Marijn Haverbeke + marijnh@gmail.com + http://codemirror.net/ + Copyright (C) 2014 - 2017 by Marijn Haverbeke <marijnh@gmail.com> and others + MIT license: http://codemirror.net/LICENSE + PLG_CODEMIRROR_XML_DESCRIPTION + + codemirror.php + styles.css + styles.min.css + fonts.json + fonts.php + + + + en-GB.plg_editors_codemirror.ini + en-GB.plg_editors_codemirror.sys.ini + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
diff --git a/plugins/editors/codemirror/fonts.json b/plugins/editors/codemirror/fonts.json new file mode 100644 index 0000000..84d7812 --- /dev/null +++ b/plugins/editors/codemirror/fonts.json @@ -0,0 +1,97 @@ +{ + "anonymous_pro": { + "name": "Anonymous Pro", + "url": "https://fonts.googleapis.com/css?family=Anonymous+Pro", + "css": "'Anonymous Pro', monospace" + }, + "cousine": { + "name": "Cousine", + "url": "https://fonts.googleapis.com/css?family=Cousine", + "css": "Cousine, monospace" + }, + "cutive_mono": { + "name": "Cutive Mono", + "url": "https://fonts.googleapis.com/css?family=Cutive+Mono", + "css": "'Cutive Mono', monospace" + }, + "droid_sans_mono": { + "name": "Droid Sans Mono", + "url": "https://fonts.googleapis.com/css?family=Droid+Sans+Mono", + "css": "'Droid Sans Mono', monospace" + }, + "fira_mono": { + "name": "Fira Mono", + "url": "https://fonts.googleapis.com/css?family=Fira+Mono", + "css": "'Fira Mono', monospace" + }, + "inconsolata": { + "name": "Inconsolata", + "url": "https://fonts.googleapis.com/css?family=Inconsolata", + "css": "Inconsolata, monospace" + }, + "lekton": { + "name": "Lekton", + "url": "https://fonts.googleapis.com/css?family=Lekton", + "css": "Lekton, monospace" + }, + "nova_mono": { + "name": "Nova Mono", + "url": "https://fonts.googleapis.com/css?family=Nova+Mono", + "css": "'Nova Mono', monospace" + }, + "overpass_mono": { + "name": "Overpass Mono", + "url": "https://fonts.googleapis.com/css?family=Overpass+Mono", + "css": "'Overpass Mono', monospace" + }, + "oxygen_mono": { + "name": "Oxygen Mono", + "url": "https://fonts.googleapis.com/css?family=Oxygen+Mono", + "css": "'Oxygen Mono', monospace" + }, + "press_start_2p": { + "name": "Press Start 2P", + "url": "https://fonts.googleapis.com/css?family=Press+Start+2P", + "css": "'Press Start 2P', monospace" + }, + "pt_mono": { + "name": "PT Mono", + "url": "https://fonts.googleapis.com/css?family=PT+Mono", + "css": "'PT Mono', monospace" + }, + "roboto_mono": { + "name": "Roboto Mono", + "url": "https://fonts.googleapis.com/css?family=Roboto+Mono", + "css": "'Roboto Mono', monospace" + }, + "rubik_mono_one": { + "name": "Rubik Mono One", + "url": "https://fonts.googleapis.com/css?family=Rubik+Mono+One", + "css": "'Rubik Mono One', monospace" + }, + "share_tech_mono": { + "name": "Share Tech Mono", + "url": "https://fonts.googleapis.com/css?family=Share+Tech+Mono", + "css": "'Share Tech Mono', monospace" + }, + "source_code_pro": { + "name": "Source Code Pro", + "url": "https://fonts.googleapis.com/css?family=Source+Code+Pro", + "css": "'Source Code Pro', monospace" + }, + "space_mono": { + "name": "Space Mono", + "url": "https://fonts.googleapis.com/css?family=Space+Mono", + "css": "'Space Mono', monospace" + }, + "ubuntu_mono": { + "name": "Ubuntu Mono", + "url": "https://fonts.googleapis.com/css?family=Ubuntu+Mono", + "css": "'Ubuntu Mono', monospace" + }, + "vt323": { + "name": "VT323", + "url": "https://fonts.googleapis.com/css?family=VT323", + "css": "'VT323', monospace" + } +} diff --git a/plugins/editors/codemirror/fonts.php b/plugins/editors/codemirror/fonts.php new file mode 100644 index 0000000..7ba4a0a --- /dev/null +++ b/plugins/editors/codemirror/fonts.php @@ -0,0 +1,52 @@ + $info) + { + $options[] = JHtml::_('select.option', $key, $info->name); + } + + // Merge any additional options in the XML definition. + return array_merge(parent::getOptions(), $options); + } +} diff --git a/plugins/editors/codemirror/index.html b/plugins/editors/codemirror/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/editors/codemirror/index.html @@ -0,0 +1 @@ + diff --git a/plugins/editors/codemirror/layouts/editors/codemirror/element.php b/plugins/editors/codemirror/layouts/editors/codemirror/element.php new file mode 100644 index 0000000..0a87c9c --- /dev/null +++ b/plugins/editors/codemirror/layouts/editors/codemirror/element.php @@ -0,0 +1,36 @@ +options; +$params = $displayData->params; +$name = $displayData->name; +$id = $displayData->id; +$cols = $displayData->cols; +$rows = $displayData->rows; +$content = $displayData->content; +$buttons = $displayData->buttons; +$modifier = $params->get('fullScreenMod', '') !== '' ? implode($params->get('fullScreenMod', ''), ' + ') . ' + ' : ''; + +JFactory::getDocument()->addScriptDeclaration(' + jQuery(function () { + var id = ' . json_encode($id) . ', options = ' . json_encode($options) . '; + /** Register Editor */ + Joomla.editors.instances[id] = CodeMirror.fromTextArea(document.getElementById(id), options); + }); +'); +?> +

+ get('fullScreen', 'F10')); ?> +

+', $content, ''; ?> + +buttons; ?> diff --git a/plugins/editors/codemirror/layouts/editors/codemirror/init.php b/plugins/editors/codemirror/layouts/editors/codemirror/init.php new file mode 100644 index 0000000..5215c3c --- /dev/null +++ b/plugins/editors/codemirror/layouts/editors/codemirror/init.php @@ -0,0 +1,85 @@ +params; +$basePath = $params->get('basePath', 'media/editors/codemirror/'); +$modePath = $params->get('modePath', 'media/editors/codemirror/mode/%N/%N'); +$extJS = JDEBUG ? '.js' : '.min.js'; +$extCSS = JDEBUG ? '.css' : '.min.css'; + +JHtml::_('script', $basePath . 'lib/codemirror' . $extJS, array('version' => 'auto')); +JHtml::_('script', $basePath . 'lib/addons' . $extJS, array('version' => 'auto')); +JHtml::_('stylesheet', $basePath . 'lib/codemirror' . $extCSS, array('version' => 'auto')); +JHtml::_('stylesheet', $basePath . 'lib/addons' . $extCSS, array('version' => 'auto')); + +$fskeys = $params->get('fullScreenMod', array()); +$fskeys[] = $params->get('fullScreen', 'F10'); +$fullScreenCombo = implode('-', $fskeys); +$fsCombo = json_encode($fullScreenCombo); +$modPath = json_encode(JUri::root(true) . '/' . $modePath . $extJS); +JFactory::getDocument()->addScriptDeclaration( +<<
'; + + echo str_replace('', implode('', $html) . '', $contents); + } + + /** + * Add a display callback to be rendered with the debug console. + * + * @param string $name The name of the callable, this is used to generate the section title. + * @param callable $callable The callback function to be added. + * + * @return boolean + * + * @since 3.7.0 + * @throws InvalidArgumentException + */ + public static function addDisplayCallback($name, $callable) + { + // TODO - When PHP 5.4 is the minimum the parameter should be typehinted "callable" and this check removed + if (!is_callable($callable)) + { + throw new InvalidArgumentException('A valid callback function must be given.'); + } + + self::$displayCallbacks[$name] = $callable; + + return true; + } + + /** + * Remove a registered display callback + * + * @param string $name The name of the callable. + * + * @return boolean + * + * @since 3.7.0 + */ + public static function removeDisplayCallback($name) + { + unset(self::$displayCallbacks[$name]); + + return true; + } + + /** + * Method to check if the current user is allowed to see the debug information or not. + * + * @return boolean True if access is allowed. + * + * @since 3.0 + */ + private function isAuthorisedDisplayDebug() + { + static $result = null; + + if ($result !== null) + { + return $result; + } + + // If the user is not allowed to view the output then end here. + $filterGroups = (array) $this->params->get('filter_groups', null); + + if (!empty($filterGroups)) + { + $userGroups = JFactory::getUser()->get('groups'); + + if (!array_intersect($filterGroups, $userGroups)) + { + $result = false; + + return false; + } + } + + $result = true; + + return true; + } + + /** + * General display method. + * + * @param string $item The item to display. + * @param array $errors Errors occurred during execution. + * + * @return string + * + * @since 2.5 + */ + protected function display($item, array $errors = array()) + { + $title = JText::_('PLG_DEBUG_' . strtoupper($item)); + + $status = ''; + + if (count($errors)) + { + $status = ' dbg-error'; + } + + $fncName = 'display' . ucfirst(str_replace('_', '', $item)); + + if (!method_exists($this, $fncName)) + { + return __METHOD__ . ' -- Unknown method: ' . $fncName . '
'; + } + + $html = array(); + + $js = "toggleContainer('dbg_container_" . $item . "');"; + + $class = 'dbg-header' . $status; + + $html[] = ''; + + // @todo set with js.. ? + $style = ' style="display: none;"'; + + $html[] = '
'; + $html[] = $this->$fncName(); + $html[] = '
'; + + return implode('', $html); + } + + /** + * Display method for callback functions. + * + * @param string $name The name of the callable. + * @param callable $callable The callable function. + * + * @return string + * + * @since 3.7.0 + */ + protected function displayCallback($name, $callable) + { + $title = JText::_('PLG_DEBUG_' . strtoupper($name)); + + $html = array(); + + $js = "toggleContainer('dbg_container_" . $name . "');"; + + $class = 'dbg-header'; + + $html[] = ''; + + // @todo set with js.. ? + $style = ' style="display: none;"'; + + $html[] = '
'; + $html[] = call_user_func($callable); + $html[] = '
'; + + return implode('', $html); + } + + /** + * Display session information. + * + * Called recursively. + * + * @param string $key A session key. + * @param mixed $session The session array, initially null. + * @param integer $id Used to identify the DIV for the JavaScript toggling code. + * + * @return string + * + * @since 2.5 + */ + protected function displaySession($key = '', $session = null, $id = 0) + { + if (!$session) + { + $session = JFactory::getSession()->getData(); + } + + $html = array(); + static $id; + + if (!is_array($session)) + { + $html[] = $key . '
' . $this->prettyPrintJSON($session) . '
' . PHP_EOL; + } + else + { + foreach ($session as $sKey => $entries) + { + $display = true; + + if (is_array($entries) && $entries) + { + $display = false; + } + + if (is_object($entries)) + { + $o = ArrayHelper::fromObject($entries); + + if ($o) + { + $entries = $o; + $display = false; + } + } + + if (!$display) + { + $js = "toggleContainer('dbg_container_session" . $id . '_' . $sKey . "');"; + + $html[] = ''; + + // @todo set with js.. ? + $style = ' style="display: none;"'; + + $html[] = '
'; + $id++; + + // Recurse... + $this->displaySession($sKey, $entries, $id); + + $html[] = '
'; + + continue; + } + + if (is_array($entries)) + { + $entries = implode($entries); + } + + if (is_string($entries)) + { + $html[] = $sKey . '
' . $this->prettyPrintJSON($entries) . '
' . PHP_EOL; + } + } + } + + return implode('', $html); + } + + /** + * Display errors. + * + * @return string + * + * @since 2.5 + */ + protected function displayErrors() + { + $html = array(); + + $html[] = '
    '; + + while ($error = JError::getError(true)) + { + $col = (E_WARNING == $error->get('level')) ? 'red' : 'orange'; + + $html[] = '
  1. '; + $html[] = '' . $error->getMessage() . '
    '; + + $info = $error->get('info'); + + if ($info) + { + $html[] = '
    ' . print_r($info, true) . '

    '; + } + + $html[] = $this->renderBacktrace($error); + $html[] = '
  2. '; + } + + $html[] = '
'; + + return implode('', $html); + } + + /** + * Display profile information. + * + * @return string + * + * @since 2.5 + */ + protected function displayProfileInformation() + { + $html = array(); + + $htmlMarks = array(); + + $totalTime = 0; + $totalMem = 0; + $marks = array(); + + foreach (JProfiler::getInstance('Application')->getMarks() as $mark) + { + $totalTime += $mark->time; + $totalMem += (float) $mark->memory; + $htmlMark = sprintf( + JText::_('PLG_DEBUG_TIME') . ': %.2f ms / %.2f ms' + . ' ' . JText::_('PLG_DEBUG_MEMORY') . ': %0.3f MB / %0.2f MB' + . ' %s: %s', + $mark->time, + $mark->totalTime, + $mark->memory, + $mark->totalMemory, + $mark->prefix, + $mark->label + ); + + $marks[] = (object) array( + 'time' => $mark->time, + 'memory' => $mark->memory, + 'html' => $htmlMark, + 'tip' => $mark->label, + ); + } + + $avgTime = $totalTime / count($marks); + $avgMem = $totalMem / count($marks); + + foreach ($marks as $mark) + { + if ($mark->time > $avgTime * 1.5) + { + $barClass = 'bar-danger'; + $labelClass = 'label-important label-danger'; + } + elseif ($mark->time < $avgTime / 1.5) + { + $barClass = 'bar-success'; + $labelClass = 'label-success'; + } + else + { + $barClass = 'bar-warning'; + $labelClass = 'label-warning'; + } + + if ($mark->memory > $avgMem * 1.5) + { + $barClassMem = 'bar-danger'; + $labelClassMem = 'label-important label-danger'; + } + elseif ($mark->memory < $avgMem / 1.5) + { + $barClassMem = 'bar-success'; + $labelClassMem = 'label-success'; + } + else + { + $barClassMem = 'bar-warning'; + $labelClassMem = 'label-warning'; + } + + $barClass .= " progress-$barClass"; + $barClassMem .= " progress-$barClassMem"; + + $bars[] = (object) array( + 'width' => round($mark->time / ($totalTime / 100), 4), + 'class' => $barClass, + 'tip' => $mark->tip . ' ' . round($mark->time, 2) . ' ms', + ); + + $barsMem[] = (object) array( + 'width' => round((float) $mark->memory / ($totalMem / 100), 4), + 'class' => $barClassMem, + 'tip' => $mark->tip . ' ' . round($mark->memory, 3) . ' MB', + ); + + $htmlMarks[] = '
' . str_replace('label-time', $labelClass, str_replace('label-memory', $labelClassMem, $mark->html)) . '
'; + } + + $html[] = '

' . JText::_('PLG_DEBUG_TIME') . '

'; + $html[] = $this->renderBars($bars, 'profile'); + $html[] = '

' . JText::_('PLG_DEBUG_MEMORY') . '

'; + $html[] = $this->renderBars($barsMem, 'profile'); + + $html[] = '
' . implode('', $htmlMarks) . '
'; + + $db = $this->db; + + // fix for support custom shutdown function via register_shutdown_function(). + $db->disconnect(); + + $log = $db->getLog(); + + if ($log) + { + $timings = $db->getTimings(); + + if ($timings) + { + $totalQueryTime = 0.0; + $lastStart = null; + + foreach ($timings as $k => $v) + { + if (!($k % 2)) + { + $lastStart = $v; + } + else + { + $totalQueryTime += $v - $lastStart; + } + } + + $totalQueryTime *= 1000; + + if ($totalQueryTime > ($totalTime * 0.25)) + { + $labelClass = 'label-important'; + } + elseif ($totalQueryTime < ($totalTime * 0.15)) + { + $labelClass = 'label-success'; + } + else + { + $labelClass = 'label-warning'; + } + + $html[] = '
' . JText::sprintf( + 'PLG_DEBUG_QUERIES_TIME', + sprintf('%.2f ms', $totalQueryTime) + ) . '
'; + + if ($this->params->get('log-executed-sql', '0')) + { + $this->writeToFile(); + } + } + } + + return implode('', $html); + } + + /** + * Display memory usage. + * + * @return string + * + * @since 2.5 + */ + protected function displayMemoryUsage() + { + $bytes = memory_get_usage(); + + return '' . JHtml::_('number.bytes', $bytes) . '' + . ' (' + . number_format($bytes, 0, JText::_('DECIMALS_SEPARATOR'), JText::_('THOUSANDS_SEPARATOR')) + . ' ' + . JText::_('PLG_DEBUG_BYTES') + . ')'; + } + + /** + * Display logged queries. + * + * @return string + * + * @since 2.5 + */ + protected function displayQueries() + { + $db = $this->db; + $log = $db->getLog(); + + if (!$log) + { + return null; + } + + $timings = $db->getTimings(); + $callStacks = $db->getCallStacks(); + + $db->setDebug(false); + + $selectQueryTypeTicker = array(); + $otherQueryTypeTicker = array(); + + $timing = array(); + $maxtime = 0; + + if (isset($timings[0])) + { + $startTime = $timings[0]; + $endTime = $timings[count($timings) - 1]; + $totalBargraphTime = $endTime - $startTime; + + if ($totalBargraphTime > 0) + { + foreach ($log as $id => $query) + { + if (isset($timings[$id * 2 + 1])) + { + // Compute the query time: $timing[$k] = array( queryTime, timeBetweenQueries ). + $timing[$id] = array( + ($timings[$id * 2 + 1] - $timings[$id * 2]) * 1000, + $id > 0 ? ($timings[$id * 2] - $timings[$id * 2 - 1]) * 1000 : 0, + ); + $maxtime = max($maxtime, $timing[$id]['0']); + } + } + } + } + else + { + $startTime = null; + $totalBargraphTime = 1; + } + + $bars = array(); + $info = array(); + $totalQueryTime = 0; + $duplicates = array(); + + foreach ($log as $id => $query) + { + $did = md5($query); + + if (!isset($duplicates[$did])) + { + $duplicates[$did] = array(); + } + + $duplicates[$did][] = $id; + + if ($timings && isset($timings[$id * 2 + 1])) + { + // Compute the query time. + $queryTime = ($timings[$id * 2 + 1] - $timings[$id * 2]) * 1000; + $totalQueryTime += $queryTime; + + // Run an EXPLAIN EXTENDED query on the SQL query if possible. + $hasWarnings = false; + $hasWarningsInProfile = false; + + if (isset($this->explains[$id])) + { + $explain = $this->tableToHtml($this->explains[$id], $hasWarnings); + } + else + { + $explain = JText::sprintf('PLG_DEBUG_QUERY_EXPLAIN_NOT_POSSIBLE', htmlspecialchars($query)); + } + + // Run a SHOW PROFILE query. + $profile = ''; + + if (isset($this->sqlShowProfileEach[$id]) && $db->getServerType() === 'mysql') + { + $profileTable = $this->sqlShowProfileEach[$id]; + $profile = $this->tableToHtml($profileTable, $hasWarningsInProfile); + } + + // How heavy should the string length count: 0 - 1. + $ratio = 0.5; + $timeScore = $queryTime / ((strlen($query) + 1) * $ratio) * 200; + + // Determine color of bargraph depending on query speed and presence of warnings in EXPLAIN. + if ($timeScore > 10) + { + $barClass = 'bar-danger'; + $labelClass = 'label-important'; + } + elseif ($hasWarnings || $timeScore > 5) + { + $barClass = 'bar-warning'; + $labelClass = 'label-warning'; + } + else + { + $barClass = 'bar-success'; + $labelClass = 'label-success'; + } + + // Computes bargraph as follows: Position begin and end of the bar relatively to whole execution time. + // TODO: $prevBar is not used anywhere. Remove? + $prevBar = $id && isset($bars[$id - 1]) ? $bars[$id - 1] : 0; + + $barPre = round($timing[$id][1] / ($totalBargraphTime * 10), 4); + $barWidth = round($timing[$id][0] / ($totalBargraphTime * 10), 4); + $minWidth = 0.3; + + if ($barWidth < $minWidth) + { + $barPre -= ($minWidth - $barWidth); + + if ($barPre < 0) + { + $minWidth += $barPre; + $barPre = 0; + } + + $barWidth = $minWidth; + } + + $bars[$id] = (object) array( + 'class' => $barClass, + 'width' => $barWidth, + 'pre' => $barPre, + 'tip' => sprintf('%.2f ms', $queryTime), + ); + $info[$id] = (object) array( + 'class' => $labelClass, + 'explain' => $explain, + 'profile' => $profile, + 'hasWarnings' => $hasWarnings, + ); + } + } + + // Remove single queries from $duplicates. + $total_duplicates = 0; + + foreach ($duplicates as $did => $dups) + { + if (count($dups) < 2) + { + unset($duplicates[$did]); + } + else + { + $total_duplicates += count($dups); + } + } + + // Fix first bar width. + $minWidth = 0.3; + + if ($bars[0]->width < $minWidth && isset($bars[1])) + { + $bars[1]->pre -= ($minWidth - $bars[0]->width); + + if ($bars[1]->pre < 0) + { + $minWidth += $bars[1]->pre; + $bars[1]->pre = 0; + } + + $bars[0]->width = $minWidth; + } + + $memoryUsageNow = memory_get_usage(); + $list = array(); + + foreach ($log as $id => $query) + { + // Start query type ticker additions. + $fromStart = stripos($query, 'from'); + $whereStart = stripos($query, 'where', $fromStart); + + if ($whereStart === false) + { + $whereStart = stripos($query, 'order by', $fromStart); + } + + if ($whereStart === false) + { + $whereStart = strlen($query) - 1; + } + + $fromString = substr($query, 0, $whereStart); + $fromString = str_replace(array("\t", "\n"), ' ', $fromString); + $fromString = trim($fromString); + + // Initialise the select/other query type counts the first time. + if (!isset($selectQueryTypeTicker[$fromString])) + { + $selectQueryTypeTicker[$fromString] = 0; + } + + if (!isset($otherQueryTypeTicker[$fromString])) + { + $otherQueryTypeTicker[$fromString] = 0; + } + + // Increment the count. + if (stripos($query, 'select') === 0) + { + $selectQueryTypeTicker[$fromString]++; + unset($otherQueryTypeTicker[$fromString]); + } + else + { + $otherQueryTypeTicker[$fromString]++; + unset($selectQueryTypeTicker[$fromString]); + } + + $text = $this->highlightQuery($query); + + if ($timings && isset($timings[$id * 2 + 1])) + { + // Compute the query time. + $queryTime = ($timings[$id * 2 + 1] - $timings[$id * 2]) * 1000; + + // Timing + // Formats the output for the query time with EXPLAIN query results as tooltip: + $htmlTiming = '
'; + $htmlTiming .= JText::sprintf( + 'PLG_DEBUG_QUERY_TIME', + sprintf( + '%.2f ms', + $info[$id]->class, + $timing[$id]['0'] + ) + ); + + if ($timing[$id]['1']) + { + $htmlTiming .= ' ' . JText::sprintf( + 'PLG_DEBUG_QUERY_AFTER_LAST', + sprintf('%.2f ms', $timing[$id]['1']) + ); + } + + $htmlTiming .= ''; + + if (isset($callStacks[$id][0]['memory'])) + { + $memoryUsed = $callStacks[$id][0]['memory'][1] - $callStacks[$id][0]['memory'][0]; + $memoryBeforeQuery = $callStacks[$id][0]['memory'][0]; + + // Determine colour of query memory usage. + if ($memoryUsed > 0.1 * $memoryUsageNow) + { + $labelClass = 'label-important'; + } + elseif ($memoryUsed > 0.05 * $memoryUsageNow) + { + $labelClass = 'label-warning'; + } + else + { + $labelClass = 'label-success'; + } + + $htmlTiming .= ' ' . '' + . JText::sprintf( + 'PLG_DEBUG_MEMORY_USED_FOR_QUERY', + sprintf('%.3f MB', $memoryUsed / 1048576), + sprintf('%.3f MB', $memoryBeforeQuery / 1048576) + ) + . ''; + + if ($callStacks[$id][0]['memory'][2] !== null) + { + // Determine colour of number or results. + $resultsReturned = $callStacks[$id][0]['memory'][2]; + + if ($resultsReturned > 3000) + { + $labelClass = 'label-important'; + } + elseif ($resultsReturned > 1000) + { + $labelClass = 'label-warning'; + } + elseif ($resultsReturned == 0) + { + $labelClass = ''; + } + else + { + $labelClass = 'label-success'; + } + + $htmlResultsReturned = '' . (int) $resultsReturned . ''; + $htmlTiming .= ' ' + . JText::sprintf('PLG_DEBUG_ROWS_RETURNED_BY_QUERY', $htmlResultsReturned) . ''; + } + } + + $htmlTiming .= '
'; + + // Bar. + $htmlBar = $this->renderBars($bars, 'query', $id); + + // Profile query. + $title = JText::_('PLG_DEBUG_PROFILE'); + + if (!$info[$id]->profile) + { + $title = '' . $title . ''; + } + + $htmlProfile = $info[$id]->profile ?: JText::_('PLG_DEBUG_NO_PROFILE'); + + $htmlAccordions = JHtml::_( + 'bootstrap.startAccordion', 'dbg_query_' . $id, array( + 'active' => $info[$id]->hasWarnings ? ('dbg_query_explain_' . $id) : '', + ) + ); + + $htmlAccordions .= JHtml::_('bootstrap.addSlide', 'dbg_query_' . $id, JText::_('PLG_DEBUG_EXPLAIN'), 'dbg_query_explain_' . $id) + . $info[$id]->explain + . JHtml::_('bootstrap.endSlide'); + + $htmlAccordions .= JHtml::_('bootstrap.addSlide', 'dbg_query_' . $id, $title, 'dbg_query_profile_' . $id) + . $htmlProfile + . JHtml::_('bootstrap.endSlide'); + + // Call stack and back trace. + if (isset($callStacks[$id])) + { + $htmlAccordions .= JHtml::_('bootstrap.addSlide', 'dbg_query_' . $id, JText::_('PLG_DEBUG_CALL_STACK'), 'dbg_query_callstack_' . $id) + . $this->renderCallStack($callStacks[$id]) + . JHtml::_('bootstrap.endSlide'); + } + + $htmlAccordions .= JHtml::_('bootstrap.endAccordion'); + + $did = md5($query); + + if (isset($duplicates[$did])) + { + $dups = array(); + + foreach ($duplicates[$did] as $dup) + { + if ($dup != $id) + { + $dups[] = '#' . ($dup + 1) . ''; + } + } + + $htmlQuery = '
' . JText::_('PLG_DEBUG_QUERY_DUPLICATES') . ': ' . implode('  ', $dups) . '
' + . '
' . $text . '
'; + } + else + { + $htmlQuery = '
' . $text . '
'; + } + + $list[] = '' + . $htmlTiming + . $htmlBar + . $htmlQuery + . $htmlAccordions; + } + else + { + $list[] = '
' . $text . '
'; + } + } + + $totalTime = 0; + + foreach (JProfiler::getInstance('Application')->getMarks() as $mark) + { + $totalTime += $mark->time; + } + + if ($totalQueryTime > ($totalTime * 0.25)) + { + $labelClass = 'label-important'; + } + elseif ($totalQueryTime < ($totalTime * 0.15)) + { + $labelClass = 'label-success'; + } + else + { + $labelClass = 'label-warning'; + } + + if ($this->totalQueries === 0) + { + $this->totalQueries = $db->getCount(); + } + + $html = array(); + + $html[] = '

' . JText::sprintf('PLG_DEBUG_QUERIES_LOGGED', $this->totalQueries) + . sprintf(' %.2f ms', $totalQueryTime) . '


'; + + if ($total_duplicates) + { + $html[] = '
' + . '

' . JText::sprintf('PLG_DEBUG_QUERY_DUPLICATES_TOTAL_NUMBER', $total_duplicates) . '

'; + + foreach ($duplicates as $dups) + { + $links = array(); + + foreach ($dups as $dup) + { + $links[] = '#' . ($dup + 1) . ''; + } + + $html[] = '
' . JText::sprintf('PLG_DEBUG_QUERY_DUPLICATES_NUMBER', count($links)) . ': ' . implode('  ', $links) . '
'; + } + + $html[] = '
'; + } + + $html[] = '
  1. ' . implode('
  2. ', $list) . '
'; + + if (!$this->params->get('query_types', 1)) + { + return implode('', $html); + } + + // Get the totals for the query types. + $totalSelectQueryTypes = count($selectQueryTypeTicker); + $totalOtherQueryTypes = count($otherQueryTypeTicker); + $totalQueryTypes = $totalSelectQueryTypes + $totalOtherQueryTypes; + + $html[] = '

' . JText::sprintf('PLG_DEBUG_QUERY_TYPES_LOGGED', $totalQueryTypes) . '

'; + + if ($totalSelectQueryTypes) + { + $html[] = '
' . JText::_('PLG_DEBUG_SELECT_QUERIES') . '
'; + + arsort($selectQueryTypeTicker); + + $list = array(); + + foreach ($selectQueryTypeTicker as $query => $occurrences) + { + $list[] = '
'
+					. JText::sprintf('PLG_DEBUG_QUERY_TYPE_AND_OCCURRENCES', $this->highlightQuery($query), $occurrences)
+					. '
'; + } + + $html[] = '
  1. ' . implode('
  2. ', $list) . '
'; + } + + if ($totalOtherQueryTypes) + { + $html[] = '
' . JText::_('PLG_DEBUG_OTHER_QUERIES') . '
'; + + arsort($otherQueryTypeTicker); + + $list = array(); + + foreach ($otherQueryTypeTicker as $query => $occurrences) + { + $list[] = '
'
+					. JText::sprintf('PLG_DEBUG_QUERY_TYPE_AND_OCCURRENCES', $this->highlightQuery($query), $occurrences)
+					. '
'; + } + + $html[] = '
  1. ' . implode('
  2. ', $list) . '
'; + } + + return implode('', $html); + } + + /** + * Render the bars. + * + * @param array &$bars Array of bar data + * @param string $class Optional class for items + * @param integer $id Id if the bar to highlight + * + * @return string + * + * @since 3.1.2 + */ + protected function renderBars(&$bars, $class = '', $id = null) + { + $html = array(); + + foreach ($bars as $i => $bar) + { + if (isset($bar->pre) && $bar->pre) + { + $html[] = '
'; + } + + $barClass = trim('bar dbg-bar progress-bar ' . (isset($bar->class) ? $bar->class : '')); + + if ($id !== null && $i == $id) + { + $barClass .= ' dbg-bar-active'; + } + + $tip = ''; + + if (isset($bar->tip) && $bar->tip) + { + $barClass .= ' hasTooltip'; + $tip = JHtml::_('tooltipText', $bar->tip, '', 0); + } + + $html[] = ''; + } + + return '
' . implode('', $html) . '
'; + } + + /** + * Render an HTML table based on a multi-dimensional array. + * + * @param array $table An array of tabular data. + * @param boolean &$hasWarnings Changes value to true if warnings are displayed, otherwise untouched + * + * @return string + * + * @since 3.1.2 + */ + protected function tableToHtml($table, &$hasWarnings) + { + if (!$table) + { + return null; + } + + $html = array(); + + $html[] = ''; + $html[] = ''; + $html[] = ''; + + foreach (array_keys($table[0]) as $k) + { + $html[] = ''; + } + + $html[] = ''; + $html[] = ''; + $html[] = ''; + $durations = array(); + + foreach ($table as $tr) + { + if (isset($tr['Duration'])) + { + $durations[] = $tr['Duration']; + } + } + + rsort($durations, SORT_NUMERIC); + + foreach ($table as $tr) + { + $html[] = ''; + + foreach ($tr as $k => $td) + { + if ($td === null) + { + // Display null's as 'NULL'. + $td = 'NULL'; + } + + // Treat special columns. + if ($k === 'Duration') + { + if ($td >= 0.001 && ($td == $durations[0] || (isset($durations[1]) && $td == $durations[1]))) + { + // Duration column with duration value of more than 1 ms and within 2 top duration in SQL engine: Highlight warning. + $html[] = ''; + } + + $html[] = ''; + } + + $html[] = ''; + $html[] = '
' . htmlspecialchars($k) . '
'; + $hasWarnings = true; + } + else + { + $html[] = ''; + } + + // Display duration in milliseconds with the unit instead of seconds. + $html[] = sprintf('%.2f ms', $td * 1000); + } + elseif ($k === 'Error') + { + // An error in the EXPLAIN query occurred, display it instead of the result (means original query had syntax error most probably). + $html[] = '' . htmlspecialchars($td); + $hasWarnings = true; + } + elseif ($k === 'key') + { + if ($td === 'NULL') + { + // Displays query parts which don't use a key with warning: + $html[] = '' . '' + . JText::_('PLG_DEBUG_WARNING_NO_INDEX') . '' . ''; + $hasWarnings = true; + } + else + { + $html[] = '' . htmlspecialchars($td) . ''; + } + } + elseif ($k === 'Extra') + { + $htmlTd = htmlspecialchars($td); + + // Replace spaces with   (non-breaking spaces) for less tall tables displayed. + $htmlTd = preg_replace('/([^;]) /', '\1 ', $htmlTd); + + // Displays warnings for "Using filesort": + $htmlTdWithWarnings = str_replace( + 'Using filesort', + '' + . JText::_('PLG_DEBUG_WARNING_USING_FILESORT') . '', + $htmlTd + ); + + if ($htmlTdWithWarnings !== $htmlTd) + { + $hasWarnings = true; + } + + $html[] = '' . $htmlTdWithWarnings; + } + else + { + $html[] = '' . htmlspecialchars($td); + } + + $html[] = '
'; + + return implode('', $html); + } + + /** + * Disconnect handler for database to collect profiling and explain information. + * + * @param JDatabaseDriver &$db Database object. + * + * @return void + * + * @since 3.1.2 + */ + public function mysqlDisconnectHandler(&$db) + { + $db->setDebug(false); + + $this->totalQueries = $db->getCount(); + + $dbVersion5037 = $db->getServerType() === 'mysql' && version_compare($db->getVersion(), '5.0.37', '>='); + + if ($dbVersion5037) + { + try + { + // Check if profiling is enabled. + $db->setQuery("SHOW VARIABLES LIKE 'have_profiling'"); + $hasProfiling = $db->loadResult(); + + if ($hasProfiling) + { + // Run a SHOW PROFILE query. + $db->setQuery('SHOW PROFILES'); + $this->sqlShowProfiles = $db->loadAssocList(); + + if ($this->sqlShowProfiles) + { + foreach ($this->sqlShowProfiles as $qn) + { + // Run SHOW PROFILE FOR QUERY for each query where a profile is available (max 100). + $db->setQuery('SHOW PROFILE FOR QUERY ' . (int) $qn['Query_ID']); + $this->sqlShowProfileEach[(int) ($qn['Query_ID'] - 1)] = $db->loadAssocList(); + } + } + } + else + { + $this->sqlShowProfileEach[0] = array(array('Error' => 'MySql have_profiling = off')); + } + } + catch (Exception $e) + { + $this->sqlShowProfileEach[0] = array(array('Error' => $e->getMessage())); + } + } + + if (in_array($db->getServerType(), array('mysql', 'postgresql'), true)) + { + $log = $db->getLog(); + + foreach ($log as $k => $query) + { + $dbVersion56 = $db->getServerType() === 'mysql' && version_compare($db->getVersion(), '5.6', '>='); + + if ((stripos($query, 'select') === 0) || ($dbVersion56 && ((stripos($query, 'delete') === 0) || (stripos($query, 'update') === 0)))) + { + try + { + $db->setQuery('EXPLAIN ' . ($dbVersion56 ? 'EXTENDED ' : '') . $query); + $this->explains[$k] = $db->loadAssocList(); + } + catch (Exception $e) + { + $this->explains[$k] = array(array('Error' => $e->getMessage())); + } + } + } + } + } + + /** + * Displays errors in language files. + * + * @return string + * + * @since 2.5 + */ + protected function displayLanguageFilesInError() + { + $errorfiles = JFactory::getLanguage()->getErrorFiles(); + + if (!count($errorfiles)) + { + return '

' . JText::_('JNONE') . '

'; + } + + $html = array(); + + $html[] = '
    '; + + foreach ($errorfiles as $file => $error) + { + $html[] = '
  • ' . $this->formatLink($file) . str_replace($file, '', $error) . '
  • '; + } + + $html[] = '
'; + + return implode('', $html); + } + + /** + * Display loaded language files. + * + * @return string + * + * @since 2.5 + */ + protected function displayLanguageFilesLoaded() + { + $html = array(); + + $html[] = '
    '; + + foreach (JFactory::getLanguage()->getPaths() as /* $extension => */ $files) + { + foreach ($files as $file => $status) + { + $html[] = '
  • '; + + $html[] = $status + ? JText::_('PLG_DEBUG_LANG_LOADED') + : JText::_('PLG_DEBUG_LANG_NOT_LOADED'); + + $html[] = ' : '; + $html[] = $this->formatLink($file); + $html[] = '
  • '; + } + } + + $html[] = '
'; + + return implode('', $html); + } + + /** + * Display untranslated language strings. + * + * @return string + * + * @since 2.5 + */ + protected function displayUntranslatedStrings() + { + $stripFirst = $this->params->get('strip-first'); + $stripPref = $this->params->get('strip-prefix'); + $stripSuff = $this->params->get('strip-suffix'); + + $orphans = JFactory::getLanguage()->getOrphans(); + + if (!count($orphans)) + { + return '

' . JText::_('JNONE') . '

'; + } + + ksort($orphans, SORT_STRING); + + $guesses = array(); + + foreach ($orphans as $key => $occurance) + { + if (is_array($occurance) && isset($occurance[0])) + { + $info = $occurance[0]; + $file = $info['file'] ?: ''; + + if (!isset($guesses[$file])) + { + $guesses[$file] = array(); + } + + // Prepare the key. + if (($pos = strpos($info['string'], '=')) > 0) + { + $parts = explode('=', $info['string']); + $key = $parts[0]; + $guess = $parts[1]; + } + else + { + $guess = str_replace('_', ' ', $info['string']); + + if ($stripFirst) + { + $parts = explode(' ', $guess); + + if (count($parts) > 1) + { + array_shift($parts); + $guess = implode(' ', $parts); + } + } + + $guess = trim($guess); + + if ($stripPref) + { + $guess = trim(preg_replace(chr(1) . '^' . $stripPref . chr(1) . 'i', '', $guess)); + } + + if ($stripSuff) + { + $guess = trim(preg_replace(chr(1) . $stripSuff . '$' . chr(1) . 'i', '', $guess)); + } + } + + $key = strtoupper(trim($key)); + $key = preg_replace('#\s+#', '_', $key); + $key = preg_replace('#\W#', '', $key); + + // Prepare the text. + $guesses[$file][] = $key . '="' . $guess . '"'; + } + } + + $html = array(); + + foreach ($guesses as $file => $keys) + { + $html[] = "\n\n# " . ($file ? $this->formatLink($file) : JText::_('PLG_DEBUG_UNKNOWN_FILE')) . "\n\n"; + $html[] = implode("\n", $keys); + } + + return '
' . implode('', $html) . '
'; + } + + /** + * Simple highlight for SQL queries. + * + * @param string $query The query to highlight. + * + * @return string + * + * @since 2.5 + */ + protected function highlightQuery($query) + { + $newlineKeywords = '#\b(FROM|LEFT|INNER|OUTER|WHERE|SET|VALUES|ORDER|GROUP|HAVING|LIMIT|ON|AND|CASE)\b#i'; + + $query = htmlspecialchars($query, ENT_QUOTES); + + $query = preg_replace($newlineKeywords, '
  \\0', $query); + + $regex = array( + + // Tables are identified by the prefix. + '/(=)/' => '$1', + + // All uppercase words have a special meaning. + '/(?)([A-Z_]{2,})(?!\w)/x' => '$1', + + // Tables are identified by the prefix. + '/(' . $this->db->getPrefix() . '[a-z_0-9]+)/' => '$1', + + ); + + $query = preg_replace(array_keys($regex), array_values($regex), $query); + + $query = str_replace('*', '*', $query); + + return $query; + } + + /** + * Render the backtrace. + * + * Stolen from JError to prevent it's removal. + * + * @param Exception $error The Exception object to be rendered. + * + * @return string Rendered backtrace. + * + * @since 2.5 + */ + protected function renderBacktrace($error) + { + return JLayoutHelper::render('joomla.error.backtrace', array('backtrace' => $error->getTrace())); + } + + /** + * Replaces the Joomla! root with "JROOT" to improve readability. + * Formats a link with a special value xdebug.file_link_format + * from the php.ini file. + * + * @param string $file The full path to the file. + * @param string $line The line number. + * + * @return string + * + * @since 2.5 + */ + protected function formatLink($file, $line = '') + { + return JHtml::_('debug.xdebuglink', $file, $line); + } + + /** + * Store log messages so they can be displayed later. + * This function is passed log entries by JLogLoggerCallback. + * + * @param JLogEntry $entry A log entry. + * + * @return void + * + * @since 3.1 + */ + public function logger(JLogEntry $entry) + { + $this->logEntries[] = $entry; + } + + /** + * Display log messages. + * + * @return string + * + * @since 3.1 + */ + protected function displayLogs() + { + $priorities = array( + JLog::EMERGENCY => 'EMERGENCY', + JLog::ALERT => 'ALERT', + JLog::CRITICAL => 'CRITICAL', + JLog::ERROR => 'ERROR', + JLog::WARNING => 'WARNING', + JLog::NOTICE => 'NOTICE', + JLog::INFO => 'INFO', + JLog::DEBUG => 'DEBUG', + ); + + $out = ''; + + $logEntriesTotal = count($this->logEntries); + + // SQL log entries + $showExecutedSQL = $this->params->get('log-executed-sql', 0); + + if (!$showExecutedSQL) + { + $logEntriesDatabasequery = count( + array_filter( + $this->logEntries, function ($logEntry) + { + return $logEntry->category === 'databasequery'; + } + ) + ); + $logEntriesTotal -= $logEntriesDatabasequery; + } + + // Deprecated log entries + $logEntriesDeprecated = count( + array_filter( + $this->logEntries, function ($logEntry) + { + return $logEntry->category === 'deprecated'; + } + ) + ); + $showDeprecated = $this->params->get('log-deprecated', 0); + + if (!$showDeprecated) + { + $logEntriesTotal -= $logEntriesDeprecated; + } + + $showEverything = $this->params->get('log-everything', 0); + + $out .= '

' . JText::sprintf('PLG_DEBUG_LOGS_LOGGED', $logEntriesTotal) . '


'; + + if ($showDeprecated && $logEntriesDeprecated > 0) + { + $out .= ' +
+

' . JText::sprintf('PLG_DEBUG_LOGS_DEPRECATED_FOUND_TITLE', $logEntriesDeprecated) . '

+
' . JText::_('PLG_DEBUG_LOGS_DEPRECATED_FOUND_TEXT') . '
+
+
'; + } + + $out .= '
    '; + $count = 1; + + foreach ($this->logEntries as $entry) + { + // Don't show database queries if not selected. + if (!$showExecutedSQL && $entry->category === 'databasequery') + { + continue; + } + + // Don't show deprecated logs if not selected. + if (!$showDeprecated && $entry->category === 'deprecated') + { + continue; + } + + // Don't show everything logs if not selected. + if (!$showEverything && !in_array($entry->category, array('deprecated', 'databasequery'), true)) + { + continue; + } + + $out .= '
  1. '; + $out .= '
    ' . $priorities[$entry->priority] . ' ' . $entry->category . '

    +
    ' . $entry->message . '
    '; + + if ($entry->callStack) + { + $out .= JHtml::_('bootstrap.startAccordion', 'dbg_logs_' . $count, array('active' => '')); + $out .= JHtml::_('bootstrap.addSlide', 'dbg_logs_' . $count, JText::_('PLG_DEBUG_CALL_STACK'), 'dbg_logs_backtrace_' . $count); + $out .= $this->renderCallStack($entry->callStack); + $out .= JHtml::_('bootstrap.endSlide'); + $out .= JHtml::_('bootstrap.endAccordion'); + } + + $out .= '
  2. '; + $count++; + } + + $out .= '
'; + + return $out; + } + + /** + * Renders call stack and back trace in HTML. + * + * @param array $callStack The call stack and back trace array. + * + * @return string The call stack and back trace in HMTL format. + * + * @since 3.5 + */ + protected function renderCallStack(array $callStack = array()) + { + $htmlCallStack = ''; + + if ($callStack !== null) + { + $htmlCallStack .= '
'; + $htmlCallStack .= ''; + $htmlCallStack .= ''; + $htmlCallStack .= ''; + $htmlCallStack .= ''; + $htmlCallStack .= ''; + $htmlCallStack .= ''; + $htmlCallStack .= ''; + $htmlCallStack .= ''; + $htmlCallStack .= ''; + + $count = count($callStack); + + foreach ($callStack as $call) + { + // Dont' back trace log classes. + if (isset($call['class']) && strpos($call['class'], 'JLog') !== false) + { + $count--; + continue; + } + + $htmlCallStack .= ''; + + $htmlCallStack .= ''; + + $htmlCallStack .= ''; + + $htmlCallStack .= ''; + + $htmlCallStack .= ''; + $count--; + } + + $htmlCallStack .= ''; + $htmlCallStack .= '
#' . JText::_('PLG_DEBUG_CALL_STACK_CALLER') . '' . JText::_('PLG_DEBUG_CALL_STACK_FILE_AND_LINE') . '
' . $count . ''; + + if (isset($call['class'])) + { + // If entry has Class/Method print it. + $htmlCallStack .= htmlspecialchars($call['class'] . $call['type'] . $call['function']) . '()'; + } + else + { + if (isset($call['args'])) + { + // If entry has args is a require/include. + $htmlCallStack .= htmlspecialchars($call['function']) . ' ' . $this->formatLink($call['args'][0]); + } + else + { + // It's a function. + $htmlCallStack .= htmlspecialchars($call['function']) . '()'; + } + } + + $htmlCallStack .= ''; + + // If entry doesn't have line and number the next is a call_user_func. + if (!isset($call['file']) && !isset($call['line'])) + { + $htmlCallStack .= JText::_('PLG_DEBUG_CALL_STACK_SAME_FILE'); + } + // If entry has file and line print it. + else + { + $htmlCallStack .= $this->formatLink(htmlspecialchars($call['file']), htmlspecialchars($call['line'])); + } + + $htmlCallStack .= '
'; + $htmlCallStack .= '
'; + + if (!$this->linkFormat) + { + $htmlCallStack .= ''; + } + } + + return $htmlCallStack; + } + + /** + * Pretty print JSON with colors. + * + * @param string $json The json raw string. + * + * @return string The json string pretty printed. + * + * @since 3.5 + */ + protected function prettyPrintJSON($json = '') + { + // In PHP 5.4.0 or later we have pretty print option. + if (version_compare(PHP_VERSION, '5.4', '>=')) + { + $json = json_encode($json, JSON_PRETTY_PRINT); + } + + // Add some colors + $json = preg_replace('#"([^"]+)":#', '"$1":', $json); + $json = preg_replace('#"(|[^"]+)"(\n|\r\n|,)#', '"$1"$2', $json); + $json = str_replace('null,', 'null,', $json); + + return $json; + } + + /** + * Write query to the log file + * + * @return void + * + * @since 3.5 + */ + protected function writeToFile() + { + $app = JFactory::getApplication(); + $domain = $app->isClient('site') ? 'site' : 'admin'; + $input = $app->input; + $file = $app->get('log_path') . '/' . $domain . '_' . $input->get('option') . $input->get('view') . $input->get('layout') . '.sql'; + + // Get the queries from log. + $current = ''; + $db = $this->db; + $log = $db->getLog(); + $timings = $db->getTimings(); + + foreach ($log as $id => $query) + { + if (isset($timings[$id * 2 + 1])) + { + $temp = str_replace('`', '', $log[$id]); + $temp = str_replace(array("\t", "\n", "\r\n"), ' ', $temp); + $current .= $temp . ";\n"; + } + } + + if (JFile::exists($file)) + { + JFile::delete($file); + } + + // Write new file. + JFile::write($file, $current); + } +} diff --git a/plugins/system/debug/debug.xml b/plugins/system/debug/debug.xml new file mode 100644 index 0000000..474d32d --- /dev/null +++ b/plugins/system/debug/debug.xml @@ -0,0 +1,270 @@ + + + plg_system_debug + Joomla! Project + December 2006 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_DEBUG_XML_DESCRIPTION + + debug.php + + + en-GB.plg_system_debug.ini + en-GB.plg_system_debug.sys.ini + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + +
+
+
+
diff --git a/plugins/system/debug/index.html b/plugins/system/debug/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/debug/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/ecom360/ecom360.php b/plugins/system/ecom360/ecom360.php new file mode 100644 index 0000000..584cf18 --- /dev/null +++ b/plugins/system/ecom360/ecom360.php @@ -0,0 +1,60 @@ + + * @date 2016-04-15 + * + * @copyright Copyright (C) 2008 - 2016 compojoom.com - Daniel Dimitrov, Yves Hoppe. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE + */ + +// No direct access +defined('_JEXEC') or die('Restricted access'); + +JLoader::discover('cmcHelper', JPATH_ADMINISTRATOR . '/components/com_cmc/helpers/'); + +/** + * Class plgSystemECom360 + * + * @since 1.3 + */ +class plgSystemECom360 extends JPlugin +{ + + /** + * Sets the mc_cid & mc_eid session variables if the user is comming from mailchimp to the page + * @return bool + */ + public function onAfterDispatch() + { + $app = JFactory::getApplication(); + + // This plugin is only intended for the frontend + if ($app->isAdmin()) + { + return true; + } + + $doc = JFactory::getDocument(); + + // This plugin is only for html, really? + if ($doc->getType() != 'html') + { + return true; + } + + $cid = JFactory::getApplication()->input->get('mc_cid', ''); // a string, no int! + $eid = JFactory::getApplication()->input->get('mc_eid', ''); + + // User comes from MC, cid is optional so just test for eid + if (!empty($eid)) + { + $session = JFactory::getSession(); + $session->set('mc', '1'); + $session->set('mc_cid', $cid); + $session->set('mc_eid', $eid); + } + + return true; + } +} diff --git a/plugins/system/ecom360/ecom360.xml b/plugins/system/ecom360/ecom360.xml new file mode 100644 index 0000000..c6b886f --- /dev/null +++ b/plugins/system/ecom360/ecom360.xml @@ -0,0 +1,22 @@ + + + System - CMC Mailchimp ecommerce360 + compojoom.com + 2019-01-13 + Copyright (C) 2012 - 2019 Yves Hoppe - compojoom.com. All rights reserved. + GNU/GPL http://www.gnu.org/licenses/gpl-3.0.html + http://compojoom.com + 4.1.2 + PLG_SYSTEM_ECOMMERCE360_DESCRIPTION + + ecom360.php +ecom360.xml + + + en-GB/en-GB.plg_system_ecom360.sys.ini + + + + + + \ No newline at end of file diff --git a/plugins/system/ecom360akeeba/ecom360akeeba.php b/plugins/system/ecom360akeeba/ecom360akeeba.php new file mode 100644 index 0000000..f3d38fb --- /dev/null +++ b/plugins/system/ecom360akeeba/ecom360akeeba.php @@ -0,0 +1,148 @@ + + * @date 2016-04-15 + * + * @copyright Copyright (C) 2008 - 2016 compojoom.com - Daniel Dimitrov, Yves Hoppe. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE + */ + +// No direct access +defined('_JEXEC') or die('Restricted access'); + +// get the cmcHelpers +JLoader::discover('CmcHelper', JPATH_ADMINISTRATOR . '/components/com_cmc/helpers/'); + +/** + * Class plgSystemECom360Akeeba + * + * @since 1.3 + */ +class plgSystemECom360Akeeba extends JPlugin +{ + + /** + * @param $row + * @param $info + * + * @return bool + */ + public function onAKSubscriptionChange($row, $info) + { + $app = JFactory::getApplication(); + + // This plugin is only intended for the frontend + if ($app->isAdmin()) + { + return true; + } + + if ($row->state == 'N' || $row->state == 'X') + { + return; + } + + if (array_key_exists('state', (array) $info['modified']) && in_array($row->state, array('P', 'C'))) + { + if ($row->enabled) + { + if (is_object($info['previous']) && $info['previous']->state == 'P') + { + // A pending subscription just got paid + $this->notifyMC($row, $info); + } + else + { + // A new subscription just got paid; send new subscription notification + $this->notifyMC($row, $info); + } + } + elseif ($row->state == 'C') + { + if ($row->contact_flag <= 2) + { + // A new subscription which is for a renewal (will be active in a future date) + $this->notifyMC($row, $info); + } + } + else + { + // A new subscription which is pending payment by the processor + $this->notifyMC($row, $info); + } + } + + } + + private function notifyMC($row, $info) + { + $session = JFactory::getSession(); + + // Trigger plugin only if user comes from Mailchimp + if (!$session->get('mc', '0')) + { + return; + } + + // The shop data + $shop = new stdClass; + $shop->id = $this->params->get("store_id", 42); + $shop->name = $this->params->get('store_name', 'Akeeba store'); + $shop->list_id = $this->params->get('list_id'); + $shop->currency_code = $this->params->get('currency_code', 'EUR'); + + $akeebasubsLevel = FOFModel::getTmpInstance('Levels', 'AkeebasubsModel')->setId($row->akeebasubs_level_id)->getItem(); + + $customer = $this->getCustomer($row->user_id); + + $products = array( + 0 => array( + 'id' => (string) $row->getId(), + "product_id" => (string) $row->akeebasubs_level_id, + 'title' => $akeebasubsLevel->title, + 'product_variant_id' => (string) $row->akeebasubs_level_id, + 'product_variant_title' => $akeebasubsLevel->title, + 'quantity' => 1, + 'price' => $row->gross_amount, + 'published_at_foreign' => $row->publish_up, + 'description' => $akeebasubsLevel->description, + 'type' => 'subscription' + ) + ); + + // The order data + $order = new stdClass; + $order->id = $row->getId(); + $order->currency_code = JComponentHelper::getParams('com_akeebasubs')->get('currency', 'EUR'); + $order->payment_tax = (double) $row->tax_amount; + $order->order_total = (double) $row->gross_amount; + $order->processed_at_foreign = $row->created_on; + + $chimp = new CmcHelperChimp; + + return $chimp->addEcomOrder( + $session->get('mc_cid', '0'), + $shop, + $order, + $products, + $customer + ); + } + + private function getCustomer($id) + { + $joomlaUser = JFactory::getUser($id); + + $user = new stdClass; + $user->email_address = $joomlaUser->email; + $name = explode(' ', $joomlaUser->name); + $user->first_name = isset($name[0]) ? $name[0] : ''; + $user->last_name = isset($name[1]) ? $name[1] : ''; + + $user->id = md5($joomlaUser->email); + $user->opt_in_status = false; + + return $user; + } +} diff --git a/plugins/system/ecom360akeeba/ecom360akeeba.xml b/plugins/system/ecom360akeeba/ecom360akeeba.xml new file mode 100644 index 0000000..2fe0b69 --- /dev/null +++ b/plugins/system/ecom360akeeba/ecom360akeeba.xml @@ -0,0 +1,31 @@ + + + System - CMC Ecom360 Akeebasubs + compojoom.com + 2019-01-13 + Copyright (C) 2012 - 2019 Yves Hoppe - compojoom.com. All rights reserved. + GNU/GPL http://www.gnu.org/licenses/gpl-3.0.html + http://compojoom.com + 4.1.2 + PLG_SYSTEM_ECOM360_AKEEBA_DESCRIPTION + + ecom360akeeba.php +ecom360akeeba.xml + + + en-GB/en-GB.plg_system_ecom360akeeba.sys.ini + + + +
+ + + + + +
+
+
+
\ No newline at end of file diff --git a/plugins/system/ecom360hika/ecom360hika.php b/plugins/system/ecom360hika/ecom360hika.php new file mode 100644 index 0000000..cb3b5b9 --- /dev/null +++ b/plugins/system/ecom360hika/ecom360hika.php @@ -0,0 +1,146 @@ + + * @date 2016-04-15 + * + * @copyright Copyright (C) 2008 - 2016 compojoom.com - Daniel Dimitrov, Yves Hoppe. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE + */ + +// No direct access +defined('_JEXEC') or die('Restricted access'); + +JLoader::discover('CmcHelper', JPATH_ADMINISTRATOR . '/components/com_cmc/helpers/'); + +/** + * Class plgSystemECom360Hika + * + * @since 1.3 + */ +class plgSystemECom360Hika extends JPlugin +{ + + + /** + * @param $order + * @param $send_email + * + * @return bool + */ + public function onAfterOrderCreate($order, $send_email) + { + $app = JFactory::getApplication(); + + // This plugin is only intended for the frontend + if ($app->isAdmin()) + { + return true; + } + + $this->notifyMC($order); + } + + /** + * + * @param $order + * + * @return void + * @internal param $data + */ + private function notifyMC($order) + { + $session = JFactory::getSession(); + // Trigger plugin only if user comes from Mailchimp + if (!$session->get('mc', '0')) + { + return; + } + + $customer = $this->getCustomer($order->order_user_id); + + // No point in going further as we couldn't fetch the user data + if(!$customer) + { + return; + } + + // The shop data + $shop = new stdClass; + $shop->id = $this->params->get("store_id", 42);; + $shop->name = $this->params->get('store_name', 'Hika store'); + $shop->list_id = $this->params->get('list_id'); + $shop->currency_code = $this->params->get('currency_code', 'EUR'); + + $currencyInfo = unserialize($order->order_currency_info); + $taxInfo = array_pop($order->order_tax_info); + + // The order data + $mOrder = new stdClass; + $mOrder->id = (string) $order->order_id; + $mOrder->currency_code = $currencyInfo->currency_code; + $mOrder->payment_tax = (double) $taxInfo->tax_amount; + $mOrder->order_total = (double) $order->cart->full_total->prices[0]->price_value_with_tax; + $mOrder->processed_at_foreign = JFactory::getDate($order->order_created)->toSql(); + + // Products + foreach ($order->cart->products as $product) + { + $products[] = array( + 'id' => (string) $product->order_id, + "product_id" => (string) $product->product_id, + 'title' => $product->order_product_name, + 'product_variant_id' => (string) $product->product_id, + 'product_variant_title' => $product->order_product_name, + "quantity" => (int) $product->order_product_quantity, + "price" => (double) ($product->order_product_price + $product->order_product_tax) + ); + } + + $chimp = new CmcHelperChimp; + + // Now send all this to Mailchimp + return $chimp->addEcomOrder( + $session->get('mc_cid', '0'), + $shop, + $mOrder, + $products, + $customer + ); + } + + private function getCustomer($id) + { + $user = new stdClass; + $user->email_address = ''; + $user->first_name = ''; + $user->last_name = ''; + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + $query->select('*')->from('#__hikashop_user')->where('user_id = ' . $db->q($id)); + + $db->setQuery($query); + + $hikaUser = $db->loadObject(); + + if (!$hikaUser) + { + return false; + } + + $user->email_address = $hikaUser->user_email; + if($hikaUser->user_cms_id) + { + $joomlaUser = JFactory::getUser($hikaUser->user_cms_id); + + $name = explode(' ', $joomlaUser->name); + $user->first_name = isset($name[0]) ? $name[0] : ''; + $user->last_name = isset($name[1]) ? $name[1] : ''; + } + + $user->id = md5($user->email_address); + $user->opt_in_status = false; + + return $user; + } +} \ No newline at end of file diff --git a/plugins/system/ecom360hika/ecom360hika.xml b/plugins/system/ecom360hika/ecom360hika.xml new file mode 100644 index 0000000..3113f9c --- /dev/null +++ b/plugins/system/ecom360hika/ecom360hika.xml @@ -0,0 +1,32 @@ + + + CMC - Ecom360 Hika + compojoom.com + 2019-01-13 + Copyright (C) 2012 - 2019 Yves Hoppe - compojoom.com. All rights reserved. + GNU/GPL http://www.gnu.org/licenses/gpl-3.0.html + http://compojoom.com + 4.1.2 + PLG_SYSTEM_ECOM360_HIKA_DESCRIPTION + + ecom360hika.xml +ecom360hika.php + + + en-GB/en-GB.plg_system_ecom360hika.sys.ini + + + +
+ + + + + + +
+
+
+
\ No newline at end of file diff --git a/plugins/system/ecom360matukio/ecom360matukio.php b/plugins/system/ecom360matukio/ecom360matukio.php new file mode 100644 index 0000000..474fde4 --- /dev/null +++ b/plugins/system/ecom360matukio/ecom360matukio.php @@ -0,0 +1,116 @@ + + * @date 2016-04-15 + * + * @copyright Copyright (C) 2008 - 2016 compojoom.com - Daniel Dimitrov, Yves Hoppe. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE + */ + +// No direct access +defined('_JEXEC') or die('Restricted access'); + +JLoader::discover('CmcHelper', JPATH_ADMINISTRATOR . '/components/com_cmc/helpers/'); + +/** + * Class plgSystemECom360Matukio + * + * @since 1.3 + */ +class plgSystemECom360Matukio extends JPlugin +{ + /** + * + * ('onAfterBooking', $neu, $event) + */ + public function onAfterBookingSave($context, $neu, $event) + { + if($context != 'com_matukio.book') + { + return; + } + + $app = JFactory::getApplication(); + + // This plugin is only intended for the frontend + if ($app->isAdmin()) + { + return true; + } + + $this->notifyMC($neu, $event); + } + + /** + * Track the booking with Mailchimp + * + * @param object $row - the booking object + * @param object $event - the event object + * + * @return array|false|void + */ + private function notifyMC($row, $event) + { + $session = JFactory::getSession(); + + // Trigger plugin only if user comes from Mailchimp + if (!$session->get('mc', '0')) + { + return; + } + + $chimp = new CmcHelperChimp; + $price = (float) $row->payment_brutto; + + $customerNames = explode(' ', $row->name); + + // Array with producs + $products = array( + 0 => array( + 'id' => (string) $row->id, + 'product_id' => $event->id, + 'title' => $event->title, + 'product_variant_id' => (string) $event->id, + 'product_variant_title' => $event->title, + 'quantity' => (int) $row->nrbooked, + 'price' => (float) $price, + 'published_at_foreign' => $event->publishdate, + 'description' => $event->description, + 'type' => 'event' + ) + ); + + // The shop data + $shop = new stdClass; + $shop->id = $this->params->get("store_id", 42); + $shop->name = $this->params->get('store_name', 'Matukio store'); + $shop->list_id = $this->params->get('list_id'); + $shop->currency_code = $this->params->get('currency_code', 'EUR'); + + // The customer data + $customer = new stdClass(); + $customer->id = md5($row->email); + $customer->email_address = $row->email; + $customer->opt_in_status = false; + $customer->first_name = isset($customerNames[0]) ? $customerNames[0] : ''; + $customer->last_name = isset($customerNames[1]) ? $customerNames[1] : ''; + + // The order data + $order = new stdClass; + $order->id = $row->id; + $order->currency_code = $event->payment_code; + $order->payment_tax = (double) $row->payment_tax; + $order->order_total = (double) $price; + $order->processed_at_foreign = $row->bookingdate; + + // Now send all this to Mailchimp + return $chimp->addEcomOrder( + $session->get('mc_cid', '0'), + $shop, + $order, + $products, + $customer + ); + } +} diff --git a/plugins/system/ecom360matukio/ecom360matukio.xml b/plugins/system/ecom360matukio/ecom360matukio.xml new file mode 100644 index 0000000..3051ba6 --- /dev/null +++ b/plugins/system/ecom360matukio/ecom360matukio.xml @@ -0,0 +1,30 @@ + + + System - CMC ecom360 Matukio + compojoom.com + 2019-01-13 + Copyright (C) 2012 - 2019 Yves Hoppe - compojoom.com. All rights reserved. + GNU/GPL http://www.gnu.org/licenses/gpl-3.0.html + http://compojoom.com + 4.1.2 + PLG_SYSTEM_ECOM360_MATUKIO_DESCRIPTION + + ecom360matukio.php +ecom360matukio.xml + + + en-GB/en-GB.plg_system_ecom360matukio.sys.ini + + + +
+ + + + +
+
+
+
\ No newline at end of file diff --git a/plugins/system/ecom360payplans/ecom360payplans.php b/plugins/system/ecom360payplans/ecom360payplans.php new file mode 100644 index 0000000..1cf556f --- /dev/null +++ b/plugins/system/ecom360payplans/ecom360payplans.php @@ -0,0 +1,149 @@ + + * @date 2016-04-15 + * + * @copyright Copyright (C) 2008 - 2016 compojoom.com - Daniel Dimitrov, Yves Hoppe. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE + */ + +// No direct access +defined('_JEXEC') or die('Restricted access'); + +JLoader::discover('CmcHelper', JPATH_ADMINISTRATOR . '/components/com_cmc/helpers/'); + +/** + * Class plgSystemECom360Payplans + * + * @since 1.3 + */ +class plgSystemECom360Payplans extends JPlugin +{ + /** + * Notify Mailchimp only when the subscription has changed + * + * @param object $prev Previous object + * @param string $new The new object + * + * @return bool + * + * @since 1.3.0 + */ + public function onPayplansPaymentAfterSave($prev, $new) + { + $app = JFactory::getApplication(); + + // This plugin is only intended for the frontend + if ($app->isAdmin()) + { + return true; + } + + $this->notifyMC($new); + + return true; + } + + /** + * Notify MailChimp API + * + * @param object $data Te payment data + * + * @return boolean true on success + * + * @since 1.3.0 + */ + public function notifyMC($data) + { + $session = JFactory::getSession(); + + // Trigger plugin only if user comes from Mailchimp + if (!$session->get('mc', '0')) + { + return; + } + + // $chimp = new CmcHelperChimp; + $price = (float) $data->amount; + + $user = JFactory::getUser($data->getBuyer()); + $customerNames = explode(' ', $user->name); + + $planIds = $data->getPlans(); + + $plan = $this->getPayplan($planIds); + + // Array with producs + $products = array( + 0 => array( + 'id' => (string) $data->getId(), + 'product_id' => $planIds[0], + 'title' => $plan->title, + 'product_variant_id' => (string) $planIds[0], + 'product_variant_title' => $plan->title, + 'quantity' => (int) 1, + 'price' => (float) $price, + 'type' => 'subscription' + ) + ); + + // The shop data + $shop = new stdClass; + $shop->id = $this->params->get('store_id', 42); + $shop->name = $this->params->get('store_name', 'PayPlans store'); + $shop->list_id = $this->params->get('list_id'); + $shop->currency_code = $data->currency; + + // The customer data + $customer = new stdClass; + $customer->id = md5($user->email); + $customer->email_address = $user->email; + $customer->opt_in_status = false; + $customer->first_name = isset($customerNames[0]) ? $customerNames[0] : ''; + $customer->last_name = isset($customerNames[1]) ? $customerNames[1] : ''; + + // The order data + $order = new stdClass; + $order->id = $data->getId(); + $order->currency_code = $data->currency; + $order->payment_tax = (double) 0; + $order->order_total = (double) $price; + $order->processed_at_foreign = JFactory::getDate($data->get('created_date')->date)->toSql(); + + $chimp = new CmcHelperChimp; + + // Now send all this to Mailchimp + return $chimp->addEcomOrder( + $session->get('mc_cid', '0'), + $shop, + $order, + $products, + $customer + ); + } + + /** + * Get the payplan + * + * @param int $id The id + * + * @return mixed + * + * @since 3.0.0 + */ + protected function getPayplan($id) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + + $query + ->select('*') + ->from('#__payplans_plan') + ->where('plan_id IN (' . implode(',', $id) . ')'); + + $db->setQuery($query); + + return $db->loadObject(); + } +} diff --git a/plugins/system/ecom360payplans/ecom360payplans.xml b/plugins/system/ecom360payplans/ecom360payplans.xml new file mode 100644 index 0000000..a066710 --- /dev/null +++ b/plugins/system/ecom360payplans/ecom360payplans.xml @@ -0,0 +1,29 @@ + + + System - CMC Ecom360 Payplans + compojoom.com + 2019-01-13 + Copyright (C) 2012 - 2019 Yves Hoppe - compojoom.com. All rights reserved. + GNU/GPL http://www.gnu.org/licenses/gpl-3.0.html + http://compojoom.com + 4.1.2 + PLG_SYSTEM_ECOM360_PAYPLANS_DESCRIPTION + + ecom360payplans.xml +ecom360payplans.php + + + en-GB/en-GB.plg_system_ecom360payplans.sys.ini + + + +
+ + + +
+
+
+
diff --git a/plugins/system/ecom360redshop/ecom360redshop.php b/plugins/system/ecom360redshop/ecom360redshop.php new file mode 100644 index 0000000..016e3c7 --- /dev/null +++ b/plugins/system/ecom360redshop/ecom360redshop.php @@ -0,0 +1,150 @@ + + * @date 2016-04-15 + * + * @copyright Copyright (C) 2008 - 2016 compojoom.com - Daniel Dimitrov, Yves Hoppe. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE + */ + +// No direct access +defined('_JEXEC') or die('Restricted access'); + +JLoader::discover('CmcHelper', JPATH_ADMINISTRATOR . '/components/com_cmc/helpers/'); + + +class plgSystemECom360Redshop extends JPlugin +{ + /** + * @param $cart + * @param $orderresult + * + * @return void + * @internal param $row + * @internal param $info + */ + public function afterOrderPlace($cart, $orderresult) + { + + $app = JFactory::getApplication(); + + // This plugin is only intended for the frontend + if ($app->isAdmin()) + { + return true; + } + + $this->notifyMC($cart, $orderresult); + } + + /** + * @param $cart + * @param $orderresult + * @param string $type + * + * @return mixed + */ + public function notifyMC($cart, $orderresult, $type = "new") + { + $session = JFactory::getSession(); + + // Trigger plugin only if user comes from Mailchimp + if (!$session->get('mc', '0')) + { + return false; + } + + $customer = $this->getCustomer($cart['user_id']); + + // The shop data + $shop = new stdClass; + $shop->id = $this->params->get("store_id", 42);; + $shop->name = $this->params->get('store_name', 'Redshop store'); + $shop->list_id = $this->params->get('list_id'); + $shop->currency_code = $this->params->get('currency_code', 'EUR'); + + $products = array(); + + for ($i = 0; $i < $cart["idx"]; $i++) + { + $prod = $cart[$i]; + + $prodInfo = $this->getProductInfo($prod['product_id']); + + $products[] = array( + 'id' => (string) $orderresult->order_id, + "product_id" => (string) $prod['product_id'], + 'title' => $prodInfo->product_name, + 'product_variant_id' => (string) $prod['product_id'], + 'product_variant_title' => $prodInfo->product_name, + 'price' => $prod['product_price'], + 'quantity' => (int) $prod['quantity'], + 'type' => $prodInfo->category_name + ); + } + + // The order data + $order = new stdClass; + $order->id = $orderresult->order_id; + $order->currency_code = $this->params->get('currency_code', 'EUR'); + $order->payment_tax = (double) $orderresult->order_tax; + $order->order_total = (double) $orderresult->order_total; + $order->processed_at_foreign = JFactory::getDate($orderresult->cdate)->toSql(); + + $chimp = new CmcHelperChimp; + + return $chimp->addEcomOrder( + $session->get('mc_cid', '0'), + $shop, + $order, + $products, + $customer + ); + } + + /** + * the cart object doesn't have all the necessary info about the product, that is + * why we need to grab it ourselves + * + * @param $id + * + * @return mixed + */ + private function getProductInfo($id) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + $query->select('p.product_name, c.category_name')->from('#__redshop_product AS p') + ->leftJoin('#__redshop_product_category_xref AS xref ON p.product_id = xref.product_id') + ->leftJoin('#__redshop_category as c ON c.category_id = xref.category_id') + ->where('p.product_id = ' . $db->q($id)); + + $db->setQuery($query, 0, 1); + + return $db->loadObject(); + } + + /** + * Get the customer object + * + * @param int $id - the joomla user object + * + * @return stdClass + */ + private function getCustomer($id) + { + $joomlaUser = JFactory::getUser($id); + + $user = new stdClass; + $user->email_address = $joomlaUser->email; + $name = explode(' ', $joomlaUser->name); + $user->first_name = isset($name[0]) ? $name[0] : ''; + $user->last_name = isset($name[1]) ? $name[1] : ''; + + $user->id = md5($joomlaUser->email); + $user->opt_in_status = false; + + return $user; + } +} diff --git a/plugins/system/ecom360redshop/ecom360redshop.xml b/plugins/system/ecom360redshop/ecom360redshop.xml new file mode 100644 index 0000000..95529ff --- /dev/null +++ b/plugins/system/ecom360redshop/ecom360redshop.xml @@ -0,0 +1,31 @@ + + + System - CMC Ecom360 Redshop + compojoom.com + 2019-01-13 + Copyright (C) 2012 - 2019 Yves Hoppe - compojoom.com. All rights reserved. + GNU/GPL http://www.gnu.org/licenses/gpl-3.0.html + http://compojoom.com + 4.1.2 + PLG_SYSTEM_ECOM360_REDSHOP_DESCRIPTION + + ecom360redshop.xml +ecom360redshop.php + + + en-GB/en-GB.plg_system_ecom360redshop.sys.ini + + + +
+ + + + + +
+
+
+
\ No newline at end of file diff --git a/plugins/system/ecom360virtuemart/ecom360virtuemart.php b/plugins/system/ecom360virtuemart/ecom360virtuemart.php new file mode 100644 index 0000000..5833e11 --- /dev/null +++ b/plugins/system/ecom360virtuemart/ecom360virtuemart.php @@ -0,0 +1,351 @@ + + * @date 2016-04-15 + * + * @copyright Copyright (C) 2008 - 2016 compojoom.com - Daniel Dimitrov, Yves Hoppe. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE + */ + +// No direct access +defined('_JEXEC') or die('Restricted access'); + +JLoader::discover('CmcHelper', JPATH_ADMINISTRATOR . '/components/com_cmc/helpers/'); +JLoader::discover('CmcMailChimp', JPATH_ADMINISTRATOR . '/components/com_cmc/libraries/shopsync/items/'); + +require_once JPATH_ADMINISTRATOR . '/components/com_virtuemart/helpers/config.php'; +require_once JPATH_ADMINISTRATOR . '/components/com_virtuemart/helpers/vmmodel.php'; + +/**administrator/components/com_cmc/libraries/shopsync/shops/virtuemart.php + * Class plgSystemECom360Virtuemart + * + * @since 1.3 + */ +class plgSystemECom360Virtuemart extends JPlugin +{ + /** + * The shop object + * + * @var object + * + * @since __DEPLOY_VERSION__ + */ + private $shop; + + /** + * Chimp API + * + * @var CmcHelperChimp + * + * @since __DEPLOY_VERSION__ + */ + private $chimp; + + /** + * plgSystemECom360Virtuemart constructor. + * + * @param object $subject Subject + * @param array $config Config + * + * @since __DEPLOY_VERSION__ + */ + public function __construct($subject, array $config = array()) + { + parent::__construct($subject, $config); + } + + /** + * Load the shop + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + protected function loadShop() + { + $shopId = $this->params->get('store_id', 1); + $this->shop = CmcHelperShop::getShop($shopId); + $this->chimp = new CmcHelperChimp; + } + + /** + * Add Order to MailChimp + * + * @param object $cart The cart object + * @param object $order The order + * + * @return bool + * + * @since __DEPLOY_VERSION__ + */ + public function plgVmConfirmedOrder($cart, $order) + { + $this->loadShop(); + + $session = JFactory::getSession(); + + $customerId = $cart->BT['email']; + + if (!empty($order->virtuemart_user_id)) + { + $customerId = $order->virtuemart_user_id; + } + + $customer = CmcHelperShop::getCustomerObject( + $cart->BT['email'], + $customerId, + $cart->BT['company'], + $cart->BT['email'], + $cart->BT['last_name'] + ); + + $lines = array(); + + foreach ($order['items'] as $item) + { + $line = new CmcMailChimpLine; + + $line->id = CmcHelperShop::PREFIX_ORDER . $item->virtuemart_order_item_id; + $line->title = $item->order_item_name; + + $parentProductId = CmcHelperShop::getVmParentProductId($item->virtuemart_product_id); + + $line->product_id = CmcHelperShop::PREFIX_PRODUCT . $parentProductId; + $line->product_variant_id = CmcHelperShop::PREFIX_PRODUCT . $item->virtuemart_product_id; + $line->product_variant_title = $item->order_item_name; + $line->quantity = (int) $item->product_quantity; + $line->price = (double) $item->product_final_price; + + $lines[] = $line; + } + + // The order data + $mOrder = new CmcMailChimpOrder; + $mOrder->id = CmcHelperShop::PREFIX_ORDER . $order["details"]["BT"]->virtuemart_order_id; + $mOrder->customer = $customer; + + // Currency + /** @var VirtueMartModelCurrency $curModel */ + $curModel = VmModel::getModel('currency'); + + $currency = $curModel->getCurrency($order["details"]["BT"]->order_currency); + $currencyCode = !empty($currency->currency_code_2) ? $currency->currency_code_2 : $currency->currency_code_3; + + $mOrder->currency_code = $currencyCode; + $mOrder->payment_tax = (double) $order["details"]["BT"]->order_tax; + $mOrder->order_total = (double) $order["details"]["BT"]->order_total; + $mOrder->processed_at_foreign = JFactory::getDate($order["details"]["BT"]->order_created)->toSql(); + + $mOrder->lines = $lines; + $mOrder->campaign_id = $session->get('mc_cid', ''); + + if (empty($session->get('mc_cid', ''))) + { + // MailChimp does not accept empty|null value here + unset($mOrder->campaign_id); + } + + return $this->chimp->addOrder($this->shop->shop_id, $mOrder); + } + + /** + * Delete a product + * + * @param object $id Id of the product + * + * @return array|false + * + * @since __DEPLOY_VERSION__ + */ + public function plgVmOnDeleteProduct($id, $ok) + { + $this->loadShop(); + + return $this->chimp->deleteProduct($this->shop->shop_id, CmcHelperShop::PREFIX_PRODUCT . $id); + } + + /** + * Add or update a product to MailChimp + * + * @param object $data Data for the product + * + * @return array|false + * + * @since __DEPLOY_VERSION__ + */ + public function plgVmAfterStoreProduct($data, $productData) + { + $this->loadShop(); + + /** @var VirtueMartModelProduct $model */ + $model = VmModel::getModel('product'); + + $product = new CmcMailChimpProduct; + + $id = CmcHelperShop::PREFIX_PRODUCT . $data['virtuemart_product_id']; + + $product->id = $id; + $product->title = $data['product_name']; + $product->description = $data['product_s_desc']; + $product->image_url = ''; + + $variants = array(); + + $model->setId($data['virtuemart_product_id']); + $uncatChildren = $model->getUncategorizedChildren(false); + + $variants[] = array( + 'id' => $id, + 'title' => $data['product_name'], + 'price' => number_format((float) $data['mprices']['product_price'][0],2) + ); + + foreach ($uncatChildren as $child) + { + $vmChild = $model->getProduct($child); + + $variants[] = array( + 'id' => CmcHelperShop::PREFIX_PRODUCT . $vmChild->virtuemart_product_id, + 'title' => $vmChild->product_name, + 'price' => number_format((float) $vmChild->allPrices[0]['product_price'], 2) + ); + } + + $product->variants = $variants; + + return $this->chimp->addProduct($this->shop->shop_id, $product); + } + + /** + * Save or Update a user + * + * @param object $user User + * + * @return array|false + * + * @since __DEPLOY_VERSION__ + */ + public function plgVmOnUserStore($user) + { + $this->loadShop(); + + $customer = CmcHelperShop::getCustomerObject( + $user['email'], + $user['virtuemart_user_id'], + $user['company'], + $user['first_name'], + $user['last_name'] + ); + + return $this->chimp->addCustomer($this->shop->shop_id, $customer);; + } + + /** + * Sent the cart to MailChimp + * + * @param array $data Crap + * + * @return boolean + * + * @since __DEPLOY_VERSION__ + */ + public function plgVmOnUpdateCart($data) + { + $this->loadShop(); + + $vmCart = VirtueMartCart::getCart(); + + if (empty($vmCart->user->virtuemart_user_id)) + { + // We can't send a card to MailChimp without a user email + return true; + } + + $session = JFactory::getSession(); + + /** @var VirtueMartModelCurrency $curModel */ + $curModel = VmModel::getModel('currency'); + + /** @var VirtueMartModelProduct $model */ + $prodModel = VmModel::getModel('product'); + + /** @var VirtueMartModelUser $model */ + $userModel = VmModel::getModel('user'); + + $cart = new CmcMailChimpCart; + + $cart->id = CmcHelperShop::PREFIX_CART . $vmCart->virtuemart_cart_id; + + // Customer + $userAddress = $userModel->getUserAddressList($vmCart->user->virtuemart_user_id, 'BT'); + $userModel->setId($vmCart->user->virtuemart_user_id); + $user = $userModel->getUser($userAddress[0]->virtuemart_userinfo_id); + + $customer = CmcHelperShop::getCustomerObject( + $user->JUser->email, + $vmCart->user->virtuemart_user_id, + $userAddress[0]->company, + $userAddress[0]->first_name, + $userAddress[0]->last_name + ); + + // Cart information + $cart->customer = $customer; + + $currency = $curModel->getCurrency($vmCart->pricesCurrency); + $currencyCode = !empty($currency->currency_code_2) ?: $currency->currency_code_3; + + $cart->currency_code = $currencyCode; + + $lines = array(); + $total = 0; + $totalTax = 0; + + foreach ($vmCart->cartProductsData as $i => $item) + { + $product = $prodModel->getProduct($item['virtuemart_product_id']); + + $line = new CmcMailChimpLine; + + $line->id = CmcHelperShop::PREFIX_ORDER_LINE . $vmCart->virtuemart_cart_id . '_' . $i; + + $parentProductId = CmcHelperShop::getVmParentProductId($item['virtuemart_product_id']); + + $line->product_id = CmcHelperShop::PREFIX_PRODUCT . $parentProductId; + $line->product_variant_id = CmcHelperShop::PREFIX_PRODUCT . $item['virtuemart_product_id']; + $line->quantity = $item['quantity']; + + $itemPrice = empty($product->allPrices[0]['salesPrice']) ? $product->allPrices[0]['product_price'] : $product->allPrices[0]['salesPrice']; + $taxAmount = empty($product->allPrices[0]['taxAmount']) ? 0 : $product->allPrices[0]['taxAmount']; + + $price = $itemPrice * $item['quantity']; + $tax = $taxAmount * $item['quantity']; + + $total += $price; + $totalTax += $tax; + + $line->price = $price; + + $lines[] = $line; + } + + $cart->lines = $lines; + + $cart->order_total = $total; + $cart->tax_total = $totalTax; + + $cart->campaign_id = $session->get('mc_cid', ''); + + if (empty($session->get('mc_cid', ''))) + { + // MailChimp does not accept empty|null value here + unset($cart->campaign_id); + } + + // Send result to MailChimp + $result = $this->chimp->addCart($this->shop->shop_id, $cart); + + return true; + } +} diff --git a/plugins/system/ecom360virtuemart/ecom360virtuemart.xml b/plugins/system/ecom360virtuemart/ecom360virtuemart.xml new file mode 100644 index 0000000..de080f4 --- /dev/null +++ b/plugins/system/ecom360virtuemart/ecom360virtuemart.xml @@ -0,0 +1,25 @@ + + + System - CMC Ecom360 Virtuemart + compojoom.com + 2019-01-13 + Copyright (C) 2012 - 2019 Yves Hoppe - compojoom.com. All rights reserved. + GNU/GPL http://www.gnu.org/licenses/gpl-3.0.html + http://compojoom.com + 4.1.2 + PLG_SYSTEM_ECOMMERCE360_VIRTUEMART_DESCRIPTION + + ecom360virtuemart.php +ecom360virtuemart.xml + + + en-GB/en-GB.plg_system_ecom360virtuemart.sys.ini + + + +
+ +
+
+
+
\ No newline at end of file diff --git a/plugins/system/falangdriver/drivers/mysqlix.php b/plugins/system/falangdriver/drivers/mysqlix.php new file mode 100644 index 0000000..0943079 --- /dev/null +++ b/plugins/system/falangdriver/drivers/mysqlix.php @@ -0,0 +1,157 @@ +options)) $this->options = $options; + + $select = array_key_exists('select', $options) ? $options['select'] : true; + $database = array_key_exists('database',$options) ? $options['database'] : ''; + + // perform a number of fatality checks, then return gracefully + if (!function_exists( 'mysqli_connect' )) { + $this->_errorNum = 1; + $this->_errorMsg = 'The MySQL adapter "mysqli" is not available.'; + return; + } + + // connect to the server + $this->connection = $db->get("connection"); + + // finalize initialization + parent::__construct($options); + + // select the database + if ( $select ) { + $this->select($database); + } + + } + + + function _getFieldCount(){ + if (is_object($this->cursor) && get_class($this->cursor)=="mysqli_result"){ + $fields = mysqli_num_fields($this->cursor); + return $fields; + } + // This is either a broken db connection or a bad query + return 0; + } + + function _getFieldMetaData($i){ + $meta = mysqli_fetch_field($this->cursor); + return $meta; + } + + function setRefTables(){ + + $pfunc = $this->_profile(); + + if($this->cursor===true || $this->cursor===false) { + $pfunc = $this->_profile($pfunc); + return; + } + + // only needed for selects at present - possibly add for inserts/updates later + if (is_a($this->sql,'JDatabaseQueryMySQLi')) { + $tempsql = $this->sql->__toString(); + } else { + $tempsql = $this->sql; + } + + if (strpos(strtoupper(trim($tempsql)),"SELECT")!==0) { + $pfunc = $this->_profile($pfunc); + return; + } + + $config = JFactory::getConfig(); + + // get column metadata + $fields = $this->_getFieldCount(); + + if ($fields<=0) { + $pfunc = $this->_profile($pfunc); + return; + } + + $this->_refTables=array(); + $this->_refTables["fieldTablePairs"]=array(); + $this->_refTables["tableAliases"]=array(); + $this->_refTables["reverseTableAliases"]=array(); + $this->_refTables["fieldAliases"]=array(); + $this->_refTables["fieldTableAliasData"]=array(); + $this->_refTables["fieldCount"]=$fields; + // Do not store sql in _reftables it will disable the cache a lot of the time + + $tableAliases = array(); + for ($i = 0; $i < $fields; ++$i) { + $meta = $this->_getFieldMetaData($i); + if (!$meta) { + echo JText::_(PLG_SYSTEM_FALANGDRIVER_META_NO_INFO); + } + else { + $tempTable = $meta->table; + // if I have already found the table alias no need to do it again! + if (array_key_exists($tempTable,$tableAliases)){ + $value = $tableAliases[$tempTable]; + } + // mysqli only + else if (isset($meta->orgtable)){ + $value = $meta->orgtable; + if (isset($this->_table_prefix) && strlen($this->_table_prefix)>0 && strpos($meta->orgtable,$this->_table_prefix)===0) { + $value = substr($meta->orgtable, strlen( $this->_table_prefix)); + } + $tableAliases[$tempTable] = $value; + } + else { + continue; + } + + if ((!($value=="session" || strpos($value,"jf_")===0)) && $this->translatedContentAvailable($value)){ + /// ARGH !!! I must also look for aliases for fieldname !! + if (isset($meta->orgname)){ + $nameValue = $meta->orgname; + } + else { + $nameValue = $meta->name; + } + + if (!array_key_exists($value,$this->_refTables["tableAliases"])) { + $this->_refTables["tableAliases"][$value]=$meta->table; + } + if (!array_key_exists($meta->table,$this->_refTables["reverseTableAliases"])) { + $this->_refTables["reverseTableAliases"][$meta->table]=$value; + } + // I can't use the field name as the key since it may not be unique! + if (!in_array($value,$this->_refTables["fieldTablePairs"])) { + $this->_refTables["fieldTablePairs"][]=$value; + } + if (!array_key_exists($nameValue,$this->_refTables["fieldAliases"])) { + $this->_refTables["fieldAliases"][$meta->name]=$nameValue; + } + + // Put all the mapping data together so that everything is in sync and I can check fields vs aliases vs tables in one place + $this->_refTables["fieldTableAliasData"][$i]=array("fieldNameAlias"=>$meta->name, "fieldName"=>$nameValue,"tableNameAlias"=>$meta->table,"tableName"=>$value); + + } + + } + } + $pfunc = $this->_profile($pfunc); + } + +} diff --git a/plugins/system/falangdriver/drivers/mysqlx.php b/plugins/system/falangdriver/drivers/mysqlx.php new file mode 100644 index 0000000..a89ef98 --- /dev/null +++ b/plugins/system/falangdriver/drivers/mysqlx.php @@ -0,0 +1,196 @@ +_options)) $this->_options = $options; + + $select = array_key_exists('select', $options) ? $options['select'] : true; + $database = array_key_exists('database',$options) ? $options['database'] : ''; + + // perform a number of fatality checks, then return gracefully + if (!function_exists( 'mysql_connect' )) { + $this->_errorNum = 1; + $this->_errorMsg = 'The MySQL adapter "mysql" is not available.'; + return; + } + + // connect to the server + $this->connection = $db->get("connection"); + + // finalize initialization + parent::__construct($options); + + // select the database + if ( $select ) { + $this->select($database); + } + + } + + function _getFieldCount(){ + if (!is_resource($this->cursor)){ + // This is a serious problem since we do not have a valid db connection + // or there is an error in the query + $error = JError::raiseError( 500, JTEXT::_('No valid database connection:') .$this->getErrorMsg()); + return $error; + } + + $fields = mysql_num_fields($this->cursor); + return $fields; + } + + function _getFieldMetaData($i){ + $meta = mysql_fetch_field($this->cursor, $i); + return $meta; + } + + function setRefTables(){ + + $pfunc = $this->_profile(); + + if($this->cursor===true || $this->cursor===false) { + $pfunc = $this->_profile($pfunc); + return; + } + + // only needed for selects at present - possibly add for inserts/updates later + if (is_a($this->sql,'JDatabaseQueryMySQL')) { + $tempsql = $this->sql->__toString(); + } else { + $tempsql = $this->sql; + } + //use tempprefixsql for mysql only driver + $tempprefixsql = $this->replacePrefix((string) $tempsql); + + + if (strpos(strtoupper(trim($tempsql)),"SELECT")!==0) { + $pfunc = $this->_profile($pfunc); + return; + } + + $config = JFactory::getConfig(); + + // get column metadata + $fields = $this->_getFieldCount(); + + if ($fields<=0) { + $pfunc = $this->_profile($pfunc); + return; + } + + $this->_refTables=array(); + $this->_refTables["fieldTablePairs"]=array(); + $this->_refTables["tableAliases"]=array(); + $this->_refTables["reverseTableAliases"]=array(); + $this->_refTables["fieldAliases"]=array(); + $this->_refTables["fieldTableAliasData"]=array(); + $this->_refTables["fieldCount"]=$fields; + // Do not store sql in _reftables it will disable the cache a lot of the time + + $tableAliases = array(); + for ($i = 0; $i < $fields; ++$i) { + $meta = $this->_getFieldMetaData($i); + if (!$meta) { + echo JText::_(PLG_SYSTEM_FALANGDRIVER_META_NO_INFO); + } + else { + $tempTable = $meta->table; + // if I have already found the table alias no need to do it again! + if (array_key_exists($tempTable,$tableAliases)){ + $value = $tableAliases[$tempTable]; + } + // mysqli only + else if (isset($meta->orgtable)){ + $value = $meta->orgtable; + if (isset($this->_table_prefix) && strlen($this->_table_prefix)>0 && strpos($meta->orgtable,$this->_table_prefix)===0) $value = substr($meta->orgtable, strlen( $this->_table_prefix)); + $tableAliases[$tempTable] = $value; + } + else { + if (!isset($tempTable) || strlen($tempTable)==0) { + continue; + } + //echo "
Information for column $i of ".($fields-1)." ".$meta->name." : $tempTable="; + $tempArray=array(); + //sbou TODO optimize this section + $prefix = $this->_table_prefix; + + preg_match_all("/`?$prefix(\w+)`?\s+(?:AS\s)?+`?".$tempTable."`?[,\s]/i",$tempprefixsql, $tempArray, PREG_PATTERN_ORDER); + //preg_match_all("/`?$prefix(\w+)`?\s+AS\s+`?".$tempTable."`?[,\s]/i",$this->_sql, $tempArray, PREG_PATTERN_ORDER); + if (count($tempArray)>1 && count($tempArray[1])>0) $value = $tempArray[1][0]; + else $value = null; + if (isset($this->_table_prefix) && strlen($this->_table_prefix)>0 && strpos($tempTable,$this->_table_prefix)===0) $tempTable = substr($tempTable, strlen( $this->_table_prefix)); + $value = $value?$value:$tempTable; + $tableAliases[$tempTable]=$value; + } + + if ((!($value=="session" || strpos($value,"jf_")===0)) && $this->translatedContentAvailable($value)){ + /// ARGH !!! I must also look for aliases for fieldname !! + if (isset($meta->orgname)){ + $nameValue = $meta->orgname; + } + else { + $tempName = $meta->name; + $tempArray=array(); + // This is a bad match when we have "SELECT id" at the start of the query + preg_match_all("/`?(\w+)`?\s+(?:AS\s)?+`?".$tempName."`?[,\s]/i",$tempprefixsql, $tempArray, PREG_PATTERN_ORDER); + //preg_match_all("/`?(\w+)`?\1s+AS\s+`?".$tempName."`?[,\s]/i",$this->_sql, $tempArray, PREG_PATTERN_ORDER); + if (count($tempArray)>1 && count($tempArray[1])>0) { + //echo "$meta->name is an alias for ".$tempArray[1][0]."
"; + // must ignore "SELECT id" + if (strtolower($tempArray[1][0])=="select"){ + $nameValue = $meta->name; + } + else { + $nameValue = $tempArray[1][0]; + } + } + else $nameValue = $meta->name; + } + + if (!array_key_exists($value,$this->_refTables["tableAliases"])) $this->_refTables["tableAliases"][$value]=$meta->table; + if (!array_key_exists($meta->table,$this->_refTables["reverseTableAliases"])) $this->_refTables["reverseTableAliases"][$meta->table]=$value; + + // I can't use the field name as the key since it may not be unique! + if (!in_array($value,$this->_refTables["fieldTablePairs"])) $this->_refTables["fieldTablePairs"][]=$value; + if (!array_key_exists($nameValue,$this->_refTables["fieldAliases"])) $this->_refTables["fieldAliases"][$meta->name]=$nameValue; + + // Put all the mapping data together so that everything is in sync and I can check fields vs aliases vs tables in one place + $this->_refTables["fieldTableAliasData"][$i]=array("fieldNameAlias"=>$meta->name, "fieldName"=>$nameValue,"tableNameAlias"=>$meta->table,"tableName"=>$value); + + } + + } + } + $pfunc = $this->_profile($pfunc); + } + +} diff --git a/plugins/system/falangdriver/falang_database.php b/plugins/system/falangdriver/falang_database.php new file mode 100644 index 0000000..f8f1f6e --- /dev/null +++ b/plugins/system/falangdriver/falang_database.php @@ -0,0 +1,499 @@ +name)."x.php"); + +class JFalangDatabase extends JOverrideDatabase { + + /** @var array list of multi lingual tables */ + var $_mlTableList=null; + /** @var Internal variable to hold array of unique tablenames and mapping data*/ + var $_refTables=null; + + /** @var Internal variable to hold flag about whether setRefTables is needed - JF queries don't need it */ + var $_skipSetRefTables = false; + + var $orig_limit = 0; + var $orig_offset = 0; + var $_table_prefix = null; + + var $profileData = array(); + + public function JFalangDatabase($options) + { + parent::__construct($options); + $this->_table_prefix = $options['prefix']; + $pfunc = $this->_profile(); + + $query = "select distinct reference_table from #__falang_content"; + $this->setQuery( $query ); + $this->_skipSetRefTables = true; + $this->_mlTableList = $this->loadColumn(0,false); + $this->_skipSetRefTables = false; + if( !$this->_mlTableList ){ + if ($this->getErrorNum()>0){ + JError::raiseWarning( 200, JTEXT::_('No valid table list:') .$this->getErrorMsg()); + } + } + + $pfunc = $this->_profile($pfunc); + } + + /** + * Description + * + * @access public + * @return int The number of rows returned from the most recent query. + */ + function getNumRows( $cur=null, $translate=true, $language=null ) + { + $count = parent::getNumRows($cur); + if (!$translate) return $count; + + // setup falang plugins + $dispatcher = JDispatcher::getInstance(); + jimport('joomla.plugin.helper'); + JPluginHelper::importPlugin('falang'); + + // must allow fall back for contnent table localisation to work + $allowfallback = true; + $refTablePrimaryKey = ""; + $reference_table = ""; + $ids=""; + //$this->setLanguage($language); + $registry = JFactory::getConfig(); + $defaultLang = $registry->get("config.defaultlang"); + if ($defaultLang == $language){ + $rows = array($count); + $dispatcher->trigger('onBeforeTranslation', array (&$rows, &$ids, $reference_table, $language, $refTablePrimaryKey, $this->getRefTables(), $this->sql, $allowfallback)); + $count = $rows[0]; + return $count; + } + + $rows = array($count); + + $dispatcher->trigger('onBeforeTranslation', array (&$rows, &$ids, $reference_table, $language, $refTablePrimaryKey, $this->getRefTables(), $this->sql, $allowfallback)); + + $dispatcher->trigger('onAfterTranslation', array (&$rows, &$ids, $reference_table, $language, $refTablePrimaryKey, $this->getRefTables(), $this->sql, $allowfallback)); + $count = $rows[0]; + return $count; + } + + /** + * Execute the SQL statement. New query() name since 2.5.5 + * + * @return mixed A database cursor resource on success, boolean false on failure. + * + * @since 11.1 + * @throws DatabaseException + */ + public function execute() + { + if ( version_compare( JVERSION, '2.5.5', '<' ) == 1) { + $success = parent::query(); + } else { + $success = parent::execute(); + } + if ($success && !$this->_skipSetRefTables){ + $this->setRefTables(); + } + return $this->cursor; + } + + /** + * Execute the SQL statement. query() become execute since 2.5.5 + * + * @return mixed A database cursor resource on success, boolean false on failure. + * + * @since 11.1 + * @throws DatabaseException + */ + + public function query() + { + return $this->execute(); + } + + + +//sbou falang method + /** + * Overwritten Database method to loads the first field of the first row returned by the query. + * + * @return The value returned in the query or null if the query failed. + */ + function loadResult( $translate=true, $language=null ) { + if (!$translate){ + $this->_skipSetRefTables=true; + $result = parent::loadResult(); + $this->_skipSetRefTables=false; + return $result; + } + $result=null; + $ret=null; + + $result = $this->_loadObject( $translate, $language ); + + $pfunc = $this->_profile(); + + if( $result != null ) { + $fields = get_object_vars( $result ); + $field = each($fields); + $ret = $field[1]; + } + + $pfunc = $this->_profile($pfunc); + + return $ret; + } + + function loadResultArray($offset = 0, $translate=true, $language=null){ + return $this->loadColumn($offset,$translate,$language); + } + + /** + * Overwritten Method to get an array of values from the $offset field in each row of the result set from + * the database query. + * + * @param integer $offset The row offset to use to build the result array. + * + * @return mixed The return value or null if the query failed. + * + * @since 11.1 + * @throws DatabaseException + */ + function loadColumn($offset = 0, $translate=true, $language=null){ + if (!$translate){ + return parent::loadColumn($offset); + } + $results=array(); + $ret=array(); + $results = $this->loadObjectList( '','stdClass', $translate, $language ); + + $pfunc = $this->_profile(); + + if( $results != null && count($results)>0) { + foreach ($results as $row) { + $fields = get_object_vars( $row ); + $keycount = 0; + foreach ($fields as $k=>$v) { + if ($keycount==$offset){ + $key = $k; + break; + } + } + $ret[] = $fields[$key]; + } + } + + $pfunc = $this->_profile($pfunc); + + return $ret; + } + + /** + * Overwritten + * + * @access public + * @return The first row of the query. + */ + function loadRow( $translate=true, $language=null) + { + if (!$translate){ + return parent::loadRow(); + } + $result=null; + $result = $this->_loadObject( $translate, $language ); + + $pfunc = $this->_profile(); + + $row = array(); + if( $result != null ) { + $fields = get_object_vars( $result ); + foreach ($fields as $val) { + $row[] = $val; + } + return $row; + } + return $row; + } + + /** + * Overwritten Load a list of database rows (numeric column indexing) + * + * @access public + * @param string The field name of a primary key + * @return array If key is empty as sequential list of returned records. + * If key is not empty then the returned array is indexed by the value + * the database key. Returns null if the query fails. + */ + function loadRowList( $key=null , $translate=true, $language=null) + { + if (!$translate){ + return parent::loadRowList($key); + } + $results=array(); + if (is_null($key)) $key=""; + $rows = $this->loadObjectList($key,'stdClass', $translate, $language ); + + $pfunc = $this->_profile(); + + $row = array(); + if( $rows != null ) { + foreach ($rows as $row) { + $fields = get_object_vars( $row ); + $result = array(); + foreach ($fields as $val) { + $result[] = $val; + } + if ($key!="") { + $results[$row->$key] = $result; + } + else { + $results[] = $result; + } + } + } + $pfunc = $this->_profile($pfunc); + return $results; + } + + + function loadObjectList( $key='',$class = 'stdClass', $translate=true, $language=null ) { + //sbou + //sbou TODO check r�cursive pb + //$jfManager = FalangManager::getInstance(); + + if (!$translate) { + $this->_skipSetRefTables=true; + $result = parent::loadObjectList( $key ,empty($class)?'stdClass':$class); + $this->_skipSetRefTables=false; + return $result; + } + + $result = parent::loadObjectList( $key, empty($class)?'stdClass':$class); + +// if( isset($jfManager)) { +// $this->_setLanguage($language); +// } + + // TODO check the impact of this on frontend translation + // It does stop Joomfish plugins from working on missing translations e.g. regional content so disable for now + // Don't do it for now since translation caching is so effective + /* + $registry = JFactory::getConfig(); + $defaultLang = $registry->getValue("config.defaultlang"); + if ($defaultLang == $language){ + $translate = false; + } + */ + + //sbou TODO this is not the right solution. +// if( isset($jfManager)) { + if (true){ + $doTranslate=false; + $tables =$this->getRefTables(); + if ($tables == null) return $result; // an unstranslatable query to return result as is + // if we don't have "fieldTablePairs" then we can't translate + if (!array_key_exists("fieldTablePairs",$tables)){ + return $result; + } + foreach ($tables["fieldTablePairs"] as $i=>$table) { + if ($this->translatedContentAvailable($table)) { + $doTranslate=true; + break; + } + } + if ($doTranslate ) { + $pfunc = $this->_profile(); + //sbou TODO cache desactived +// if ($jfManager->getCfg("transcaching",1)){ + if (false) { + // cache the results + // TODO call based on config + //$cache = JFactory::getCache('jfquery'); + $cache = $jfManager->getCache($language); + $this->orig_limit = $this->limit; + $this->orig_offset = $this->offset; + $result = $cache->get( array("FaLang", 'translateListCached'), array($result, $language, $this->getRefTables() )); + $this->orig_limit = 0; + $this->orig_offset = 0; + } + else { + $this->orig_limit = $this->limit; + $this->orig_offset = $this->offset; + Falang::translateList( $result, $language, $this->getRefTables() ); + $this->orig_limit = 0; + $this->orig_offset = 0; + } + $pfunc = $this->_profile($pfunc); + } + } + return $result; + } + + /** + * private function to handle the requirement to call different loadObject version based on class + * + * @param boolran $translate + * @param string $language + */ + function _loadObject( $translate=true, $language=null ) { + return $this->loadObject(); + } + + + + + function _profile($func = "", $forcestart=false){ + if (!$this->debug) return ""; + // start of function + if ($func==="" || $forcestart){ + if (!$forcestart){ + $backtrace = debug_backtrace(); + if (count($backtrace)>1){ + if (array_key_exists("class",$backtrace[1])){ + $func = $backtrace[1]["class"]."::".$backtrace[1]["function"]; + } + else { + $func = $backtrace[1]["function"]; + } + } + } + if (!array_key_exists($func,$this->profileData)){ + $this->profileData[$func]=array("total"=>0, "count"=>0); + } + if (!array_key_exists("start",$this->profileData[$func])) { + $this->profileData[$func]["start"]=array(); + } + list ($usec,$sec) = explode(" ", microtime()); + $this->profileData[$func]["start"][] = floatval($usec)+floatval($sec); + $this->profileData[$func]["count"]++; + return $func; + } + else { + if (!array_key_exists($func,$this->profileData)){ + exit("JFProfile start not found for function $func"); + } + list ($usec,$sec) = explode(" ", microtime()); + $laststart = array_pop($this->profileData[$func]["start"]); + $this->profileData[$func]["total"] += (floatval($usec)+floatval($sec)) - $laststart; + } + } + + + + /** + * Public function to test if table has translated content available + * + * @param string $table : tablename to test + */ + function translatedContentAvailable($table){ + return in_array( $table, $this->_mlTableList) || $table=="content"; + } + + /** Internal function to return reference table names from an sql query + * + * @return string table name + */ + function getRefTables(){ + return $this->_refTables; + } + + /** + * This global function loads the first row of a query into an object + */ + function loadObject( $class = 'stdClass', $translate=true, $language=null ) { + $objects = $this->loadObjectList("",$class,$translate,$language); + if (!is_null($objects) && count($objects)>0){ + return $objects[0]; + } + return null; + } + + /** + * Overwritten Fetch a result row as an associative array + * + * @access public + * @return array + */ + function loadAssoc( $translate=true, $language=null) { + if (!$translate){ + return parent::loadResult(); + } + $result=null; + $result = $this->_loadObject( $translate, $language ); + + $pfunc = $this->_profile(); + + if( $result != null ) { + $fields = get_object_vars( $result ); + $pfunc = $this->_profile($pfunc); + return $fields; + } + return $result; + } + + /** + * Overwritten Load a assoc list of database rows + * + * @access public + * @param string The field name of a primary key + * @return array If key is empty as sequential list of returned records. + */ + function loadAssocList( $key = null, $column = null, $translate=true, $language=null ) + { + if (!$translate){ + return parent::loadAssocList($key, $column = null); + } + $result=null; + $rows = $this->loadObjectList($key,'stdClass', $translate, $language ); + + $pfunc = $this->_profile(); + $return = array(); + if( $rows != null ) { + foreach ($rows as $row) { + $vars = get_object_vars( $row ); + $value = ($column) ? (isset($vars[$column]) ? $vars[$column] : $vars) : $vars; + if ($key) { + $return[$vars[$key]] = $value; + } + else { + $return[] = $value; + } + } + $pfunc = $this->_profile($pfunc); + } + return $return; + } + + /** + * Private function to get the language for a specific translation + * + */ +// function setLanguage( & $language){ +// +// $pfunc = $this->_profile(); +// +// // first priority to passed in language +// if (!is_null($language) && $language!=''){ +// return; +// } +// // second priority to language for build route function in other language +// // ie so that module can translate the SEF URL +// $registry = JFactory::getConfig(); +// $sefLang = $registry->getValue("joomfish.sef_lang", false); +// if ($sefLang){ +// $language = $sefLang; +// } +// else { +// $language = JFactory::getLanguage()->getTag(); +// } +// +// $pfunc = $this->profile($pfunc); +// } +} \ No newline at end of file diff --git a/plugins/system/falangdriver/falangdriver.php b/plugins/system/falangdriver/falangdriver.php new file mode 100644 index 0000000..5482477 --- /dev/null +++ b/plugins/system/falangdriver/falangdriver.php @@ -0,0 +1,124 @@ +loadLanguage(); + + // This plugin is only relevant for use within the frontend! + if (JFactory::getApplication()->isAdmin()) + { + return; + } + } + + /** + * System Event: onAfterInitialise + * + * @return string + */ + function onAfterInitialise() + { + // This plugin is only relevant for use within the frontend! + if (JFactory::getApplication()->isAdmin()) + { + return; + } + $this->setupDatabaseDriverOverride(); + } + + public function isFalangDriverActive() { + $db = JFactory::getDBO(); + if (!is_a($db,"JFalangDatabase")){ + return false; + } + return true; + } + + function onAfterDispatch() + { + if (JFactory::getApplication()->isSite() && $this->isFalangDriverActive()) { + include_once( JPATH_ADMINISTRATOR . '/components/com_falang/version.php'); + $version = new FalangVersion(); + if ($version->_versiontype == 'free' ) { + $this->setBuffer(); + } + return true; + } + } + + + function setupDatabaseDriverOverride() + { + //override only the override file exist + if (file_exists(dirname(__FILE__) . '/falang_database.php')) + { + + require_once( dirname(__FILE__) . '/falang_database.php'); + + $conf = JFactory::getConfig(); + + $host = $conf->get('host'); + $user = $conf->get('user'); + $password = $conf->get('password'); + $db = $conf->get('db'); + $dbprefix = $conf->get('dbprefix'); + $driver = $conf->get('dbtype'); + $debug = $conf->get('debug'); + + $options = array('driver' => $driver,"host" => $host, "user" => $user, "password" => $password, "database" => $db, "prefix" => $dbprefix, "select" => true); + $db = new JFalangDatabase($options); + $db->debug($debug); + + + if ($db->getErrorNum() > 2) + { + JError::raiseError('joomla.library:' . $db->getErrorNum(), 'JDatabase::getInstance: Could not connect to database
' . $db->getErrorMsg()); + } + + // replace the database handle in the factory + JFactory::$database = null; + JFactory::$database = $db; + + $test = JFactory::getDBO(); + + } + + } + + private function setBuffer() + { + $doc = JFactory::getDocument(); + $cacheBuf = $doc->getBuffer('component'); + + $cacheBuf2 = + ''; + + if ($doc->_type == 'html') + $doc->setBuffer($cacheBuf . $cacheBuf2,'component'); + + } + + + +} \ No newline at end of file diff --git a/plugins/system/falangdriver/falangdriver.xml b/plugins/system/falangdriver/falangdriver.xml new file mode 100644 index 0000000..53e3736 --- /dev/null +++ b/plugins/system/falangdriver/falangdriver.xml @@ -0,0 +1,26 @@ + + + plg_system_falangdriver + Stéphane Bouey + December 2012 + 2011-2013, Faboba + GNU General Public License version 2 or later http://www.gnu.org/licenses/gpl.html + stephane.bouey@faboba.com + http://www.faboba.com + 1.3.0 + PLG_SYSTEM_FALANGDRIVER_XML_DESCRIPTION + + index.html + falangdriver.php + falang_database.php + language + legacy + drivers + + + en-GB.plg_falang_driver.ini + en-GB.plg_falang_driver.sys.ini + + + + \ No newline at end of file diff --git a/plugins/system/falangdriver/index.html b/plugins/system/falangdriver/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/plugins/system/falangdriver/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/system/falangdriver/language/en-GB/en-GB.plg_system_falangdriver.ini b/plugins/system/falangdriver/language/en-GB/en-GB.plg_system_falangdriver.ini new file mode 100644 index 0000000..139dc6e --- /dev/null +++ b/plugins/system/falangdriver/language/en-GB/en-GB.plg_system_falangdriver.ini @@ -0,0 +1,6 @@ +PLG_SYSTEM_FALANGDRIVER="System - FaLang Database Driver" +PLG_SYSTEM_FALANGDRIVER_XML_DESCRIPTION="Add Database Driver override necessary to translate languages." +PLG_SYSTEM_FALANGDRIVER_CONFIG_ERROR_WRITE_FAILED="Could not write to the configuration file" +PLG_SYSTEM_FALANGDRIVER_MYSQL_OVERRIDE="MySQL(Falang)" +PLG_SYSTEM_FALANGDRIVER_MYSQLI_OVERRIDE="MySQLi(Falang)" +PLG_SYSTEM_FALANGDRIVER_META_NO_INFO="No information available
\n" diff --git a/plugins/system/falangdriver/language/en-GB/en-GB.plg_system_falangdriver.sys.ini b/plugins/system/falangdriver/language/en-GB/en-GB.plg_system_falangdriver.sys.ini new file mode 100644 index 0000000..61188b2 --- /dev/null +++ b/plugins/system/falangdriver/language/en-GB/en-GB.plg_system_falangdriver.sys.ini @@ -0,0 +1,2 @@ +PLG_SYSTEM_FALANGDRIVER="System - FaLang Database Driver" +PLG_SYSTEM_FALANGDRIVER_XML_DESCRIPTION="Add Database Driver override necessary to translate languages." diff --git a/plugins/system/falangdriver/language/en-GB/index.html b/plugins/system/falangdriver/language/en-GB/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/plugins/system/falangdriver/language/en-GB/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/system/falangdriver/legacy/legacydatabasedrivermysql.php b/plugins/system/falangdriver/legacy/legacydatabasedrivermysql.php new file mode 100644 index 0000000..ffaa07c --- /dev/null +++ b/plugins/system/falangdriver/legacy/legacydatabasedrivermysql.php @@ -0,0 +1,15 @@ +id)) + { + return true; + } + + // Create correct context for category + if ($context == 'com_categories.category') + { + $context = $item->extension . '.categories'; + + // Set the catid on the category to get only the fields which belong to this category + $item->catid = $item->id; + } + + // Check the context + $parts = FieldsHelper::extract($context, $item); + + if (!$parts) + { + return true; + } + + // Compile the right context for the fields + $context = $parts[0] . '.' . $parts[1]; + + // Loading the fields + $fields = FieldsHelper::getFields($context, $item); + + if (!$fields) + { + return true; + } + + // Get the fields data + $fieldsData = !empty($data['com_fields']) ? $data['com_fields'] : array(); + + // Loading the model + $model = JModelLegacy::getInstance('Field', 'FieldsModel', array('ignore_request' => true)); + + // Loop over the fields + foreach ($fields as $field) + { + // Determine the value if it is available from the data + $value = key_exists($field->name, $fieldsData) ? $fieldsData[$field->name] : null; + + // JSON encode value for complex fields + if (is_array($value) && (count($value, COUNT_NORMAL) !== count($value, COUNT_RECURSIVE) || !count(array_filter(array_keys($value), 'is_numeric')))) + { + $value = json_encode($value); + } + + // Setting the value for the field and the item + $model->setFieldValue($field->id, $item->id, $value); + } + + return true; + } + + /** + * The save event. + * + * @param array $userData The date + * @param boolean $isNew Is new + * @param boolean $success Is success + * @param string $msg The message + * + * @return boolean + * + * @since 3.7.0 + */ + public function onUserAfterSave($userData, $isNew, $success, $msg) + { + // It is not possible to manipulate the user during save events + // Check if data is valid or we are in a recursion + if (!$userData['id'] || !$success) + { + return true; + } + + $user = JFactory::getUser($userData['id']); + + $task = JFactory::getApplication()->input->getCmd('task'); + + // Skip fields save when we activate a user, because we will lose the saved data + if (in_array($task, array('activate', 'block', 'unblock'))) + { + return true; + } + + // Trigger the events with a real user + $this->onContentAfterSave('com_users.user', $user, false, $userData); + + return true; + } + + /** + * The delete event. + * + * @param string $context The context + * @param stdClass $item The item + * + * @return boolean + * + * @since 3.7.0 + */ + public function onContentAfterDelete($context, $item) + { + $parts = FieldsHelper::extract($context, $item); + + if (!$parts || empty($item->id)) + { + return true; + } + + $context = $parts[0] . '.' . $parts[1]; + + JLoader::import('joomla.application.component.model'); + JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_fields/models', 'FieldsModel'); + + $model = JModelLegacy::getInstance('Field', 'FieldsModel', array('ignore_request' => true)); + $model->cleanupValues($context, $item->id); + + return true; + } + + /** + * The user delete event. + * + * @param stdClass $user The context + * @param boolean $succes Is success + * @param string $msg The message + * + * @return boolean + * + * @since 3.7.0 + */ + public function onUserAfterDelete($user, $succes, $msg) + { + $item = new stdClass; + $item->id = $user['id']; + + return $this->onContentAfterDelete('com_users.user', $item); + } + + /** + * The form event. + * + * @param JForm $form The form + * @param stdClass $data The data + * + * @return boolean + * + * @since 3.7.0 + */ + public function onContentPrepareForm(JForm $form, $data) + { + $context = $form->getName(); + + // When a category is edited, the context is com_categories.categorycom_content + if (strpos($context, 'com_categories.category') === 0) + { + $context = str_replace('com_categories.category', '', $context) . '.categories'; + + // Set the catid on the category to get only the fields which belong to this category + if (is_array($data) && key_exists('id', $data)) + { + $data['catid'] = $data['id']; + } + + if (is_object($data) && isset($data->id)) + { + $data->catid = $data->id; + } + } + + $parts = FieldsHelper::extract($context, $form); + + if (!$parts) + { + return true; + } + + $input = JFactory::getApplication()->input; + + // If we are on the save command we need the actual data + $jformData = $input->get('jform', array(), 'array'); + + if ($jformData && !$data) + { + $data = $jformData; + } + + if (is_array($data)) + { + $data = (object) $data; + } + + FieldsHelper::prepareForm($parts[0] . '.' . $parts[1], $form, $data); + + return true; + } + + /** + * The display event. + * + * @param string $context The context + * @param stdClass $item The item + * @param Registry $params The params + * @param integer $limitstart The start + * + * @return string + * + * @since 3.7.0 + */ + public function onContentAfterTitle($context, $item, $params, $limitstart = 0) + { + return $this->display($context, $item, $params, 1); + } + + /** + * The display event. + * + * @param string $context The context + * @param stdClass $item The item + * @param Registry $params The params + * @param integer $limitstart The start + * + * @return string + * + * @since 3.7.0 + */ + public function onContentBeforeDisplay($context, $item, $params, $limitstart = 0) + { + return $this->display($context, $item, $params, 2); + } + + /** + * The display event. + * + * @param string $context The context + * @param stdClass $item The item + * @param Registry $params The params + * @param integer $limitstart The start + * + * @return string + * + * @since 3.7.0 + */ + public function onContentAfterDisplay($context, $item, $params, $limitstart = 0) + { + return $this->display($context, $item, $params, 3); + } + + /** + * Performs the display event. + * + * @param string $context The context + * @param stdClass $item The item + * @param Registry $params The params + * @param integer $displayType The type + * + * @return string + * + * @since 3.7.0 + */ + private function display($context, $item, $params, $displayType) + { + $parts = FieldsHelper::extract($context, $item); + + if (!$parts) + { + return ''; + } + + // If we have a category, set the catid field to fetch only the fields which belong to it + if ($parts[1] == 'categories' && !isset($item->catid)) + { + $item->catid = $item->id; + } + + $context = $parts[0] . '.' . $parts[1]; + + // Convert tags + if ($context == 'com_tags.tag' && !empty($item->type_alias)) + { + // Set the context + $context = $item->type_alias; + + $item = $this->prepareTagItem($item); + } + + if (is_string($params) || !$params) + { + $params = new Registry($params); + } + + $fields = FieldsHelper::getFields($context, $item, true); + + if ($fields) + { + $app = Factory::getApplication(); + + if ($app->isClient('site') && Multilanguage::isEnabled() && isset($item->language) && $item->language == '*') + { + $lang = $app->getLanguage()->getTag(); + + foreach ($fields as $key => $field) + { + if ($field->language == '*' || $field->language == $lang) + { + continue; + } + + unset($fields[$key]); + } + } + } + + if ($fields) + { + foreach ($fields as $key => $field) + { + $fieldDisplayType = $field->params->get('display', '2'); + + if ($fieldDisplayType == $displayType) + { + continue; + } + + unset($fields[$key]); + } + } + + if ($fields) + { + return FieldsHelper::render( + $context, + 'fields.render', + array( + 'item' => $item, + 'context' => $context, + 'fields' => $fields + ) + ); + } + + return ''; + } + + /** + * Performs the display event. + * + * @param string $context The context + * @param stdClass $item The item + * + * @return void + * + * @since 3.7.0 + */ + public function onContentPrepare($context, $item) + { + $parts = FieldsHelper::extract($context, $item); + + if (!$parts) + { + return; + } + + $context = $parts[0] . '.' . $parts[1]; + + // Convert tags + if ($context == 'com_tags.tag' && !empty($item->type_alias)) + { + // Set the context + $context = $item->type_alias; + + $item = $this->prepareTagItem($item); + } + + $fields = FieldsHelper::getFields($context, $item, true); + + // Adding the fields to the object + $item->jcfields = array(); + + foreach ($fields as $key => $field) + { + $item->jcfields[$field->id] = $field; + } + } + + /** + * The finder event. + * + * @param stdClass $item The item + * + * @return boolean + * + * @since 3.7.0 + */ + public function onPrepareFinderContent($item) + { + $section = strtolower($item->layout); + $tax = $item->getTaxonomy('Type'); + + if ($tax) + { + foreach ($tax as $context => $value) + { + // This is only a guess, needs to be improved + $component = strtolower($context); + + if (strpos($context, 'com_') !== 0) + { + $component = 'com_' . $component; + } + + // Transform com_article to com_content + if ($component === 'com_article') + { + $component = 'com_content'; + } + + // Create a dummy object with the required fields + $tmp = new stdClass; + $tmp->id = $item->__get('id'); + + if ($item->__get('catid')) + { + $tmp->catid = $item->__get('catid'); + } + + // Getting the fields for the constructed context + $fields = FieldsHelper::getFields($component . '.' . $section, $tmp, true); + + if (is_array($fields)) + { + foreach ($fields as $field) + { + // Adding the instructions how to handle the text + $item->addInstruction(FinderIndexer::TEXT_CONTEXT, $field->name); + + // Adding the field value as a field + $item->{$field->name} = $field->value; + } + } + } + } + + return true; + } + + /** + * Prepares a tag item to be ready for com_fields. + * + * @param stdClass $item The item + * + * @return object + * + * @since 3.8.4 + */ + private function prepareTagItem($item) + { + // Map core fields + $item->id = $item->content_item_id; + $item->language = $item->core_language; + + // Also handle the catid + if (!empty($item->core_catid)) + { + $item->catid = $item->core_catid; + } + + return $item; + } +} diff --git a/plugins/system/fields/fields.xml b/plugins/system/fields/fields.xml new file mode 100644 index 0000000..0ed586f --- /dev/null +++ b/plugins/system/fields/fields.xml @@ -0,0 +1,19 @@ + + + plg_system_fields + Joomla! Project + March 2016 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.7.0 + PLG_SYSTEM_FIELDS_XML_DESCRIPTION + + fields.php + + + en-GB.plg_system_fields.ini + en-GB.plg_system_fields.sys.ini + + diff --git a/plugins/system/googletagmanager/googletagmanager.php b/plugins/system/googletagmanager/googletagmanager.php new file mode 100644 index 0000000..d260f2c --- /dev/null +++ b/plugins/system/googletagmanager/googletagmanager.php @@ -0,0 +1,101 @@ + area + * Fix so that dataLayer is not added to
tags + * Add scrolling updates + * 0.0.11 Update to handle multiple and multiple tags + * 0.0.12 Update to load javascript in the tag and iframe in the section. + * 1.0.0 Added the update server + * 1.0.1 Corrected the JavaScript reference location + */ + +// no direct access +defined( '_JEXEC' ) or die( 'Restricted access' ); + +jimport( 'joomla.plugin.plugin'); + +class plgSystemGoogleTagManager extends JPlugin { + + public function onContentPrepare($context, &$row, &$params, $page = 0) + { + $addScrollTracker = $this->params->get('add_scrolltracker',''); + $scrollTrackerContentId = $this->params->get('scroll_tracker_content_id',''); + if ($addScrollTracker == 'on') { + // Add the pagescrolling JavaScript library + JHtml::_('jquery.framework'); + $document = JFactory::getDocument(); + $document->addScript('plugins/system/googletagmanager/js/scroll-tracker.js'); + $jsContent = ' +jQuery(document).ready(function(){jQuery.contentIdPlugin.contentIdValue(\''.$scrollTrackerContentId.'\')});'; + $document->addScriptDeclaration( $jsContent ); + } + } + + function onAfterRender() { + + // don't run if we are in the index.php or we are not in an HTML view + if(strpos($_SERVER["PHP_SELF"], "index.php") === false || JRequest::getVar('format','html') != 'html'){ + return; + } + + + // Check to see if we are in the admin and if we should track + $trackadmin = $this->params->get('trackadmin',''); + $mainframe = JFactory::getApplication(); + if($mainframe->isAdmin() && ($trackadmin != 'on')) { + return; + } + + // Get the Body of the HTML - have to do this twice to get the HTML + $buffer = JResponse::getBody(); + $buffer = JResponse::getBody(); + // Get our Container ID and Track Admin parameter + $container_id = $this->params->get('container_id',''); + $addDataLayer = $this->params->get('add_datalayer',''); + $dataLayerName = $this->params->get('datalayer_name','dataLayer'); + $addTrackLogin = $this->params->get('track_userLogin',''); + + // String containing the Google Tag Manager JavaScript code including the container id + $gtm_js_container_code = "\n + +"; + + $dataLayerCode = ''; + if ($addDataLayer == 'on') { + $dataLayerCode = 'window.'.$dataLayerName.' = window.'.$dataLayerName.' || [];'; + // Tracked Logged in User here + $user = JFactory::getUser(); + if ($addTrackLogin == 'on' && !$user->guest) { + $dataLayerCode .= $dataLayerName.".push({'event': 'user_loggedin', 'user_id' : '".$user->id."'});"; + } + // Match on head tag and new expression to NOT match on header tag + $buffer = preg_replace ("/()/i", "$1"."\n".$gtm_js_container_code, $buffer, 1); + } + else { + $buffer = preg_replace ("/()/i", "$1".$gtm_js_container_code, $buffer, 1); + } + // String containing the iframe code to be placed after the tag + $gtm_iframe_container_code = "\n + +"; + + // update to limit = 1 to add tag to only the first tag + $buffer = preg_replace ("/()/is", "$1".$gtm_iframe_container_code, $buffer, 1); + + JResponse::setBody($buffer); + + return true; + } + } \ No newline at end of file diff --git a/plugins/system/googletagmanager/googletagmanager.xml b/plugins/system/googletagmanager/googletagmanager.xml new file mode 100644 index 0000000..2c34a97 --- /dev/null +++ b/plugins/system/googletagmanager/googletagmanager.xml @@ -0,0 +1,68 @@ + + + Google Tag Manager + James Murphy/Hugh Gideon-Murphy - Tools for Joomla Shop + March 2015 + Copyright (C) 2015. All rights reserved. + http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL + info@toolsforjoomla.com + www.toolsforjoomla.com + 1.0.1 + PLG_GOOGLETAGMANAGER_XML_DESCRIPTION + + googletagmanager.php + index.html + js + + + en-GB.plg_system_googletagmanager.ini + en-GB.plg_system_googletagmanager.sys.ini + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
\ No newline at end of file diff --git a/plugins/system/googletagmanager/index.html b/plugins/system/googletagmanager/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/googletagmanager/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/googletagmanager/js/scroll-tracker.js b/plugins/system/googletagmanager/js/scroll-tracker.js new file mode 100644 index 0000000..8e2b76c --- /dev/null +++ b/plugins/system/googletagmanager/js/scroll-tracker.js @@ -0,0 +1,172 @@ +jQuery(function($) { + // setup getter setter for content id + // whoever invented JavaScript obviously wanted to inflict pain on computer scientists... + var contentIdValue; + + jQuery.contentIdPlugin = { + + contentIdValue: function(value) { + + if (typeof(value) != "undefined") { + contentIdValue = value; + return contentIdValue; + } else { + return contentIdValue; + } + + } + } + + // Debug flag + var debugMode = false; + + // GTM or Universal Analytics + var gtmMode = true; + + // Default time delay before checking location + var callBackTime = 100; + + // # px before tracking a reader + var readerLocation = 150; + + // Time used to determine a reader or scanner reader type + var readerTime = 60; + + // Set some flags for tracking & execution + var timer = 0; + var scroller = false; + var endContent = false; + var didComplete = false; + + // Set some time variables to calculate reading time + var startTime = new Date(); + var beginning = startTime.getTime(); + var totalTime = 0; + + // Get some information about the current page + var pageTitle = document.title; + + // Track the aticle load + if (!debugMode) { + if (gtmMode) { + dataLayer.push({ + 'event':'content-tracker', + 'content-category':'Reading', + 'content-action':'ArticleLoaded', + 'content-label':'', + 'content-value':'', + 'content-non-interaction':true + }); + } else { + ga('send','event', 'Reading', 'ArticleLoaded', '', '', true); + } + } else { + alert('The page has loaded. Woohoo.'); + } + + // Check the location and track user + function trackLocation() { + bottom = $(window).height() + $(window).scrollTop(); + height = $(document).height(); + + // If user starts to scroll send an event + if (bottom > readerLocation && !scroller) { + currentTime = new Date(); + scrollStart = currentTime.getTime(); + timeToScroll = Math.round((scrollStart - beginning) / 1000); + if (!debugMode) { + if (gtmMode) { + dataLayer.push({ + 'event':'content-tracker', + 'content-category':'Reading', + 'content-action':'StartReading', + 'content-label':'', + 'content-value':timeToScroll, + 'content-non-interaction':false + }); + } else { + ga('send','event', 'Reading', 'StartReading', '', timeToScroll); + } + } else { + alert('started reading ' + timeToScroll); + } + scroller = true; + } + + // If user has hit the bottom of the content send an event + if (bottom >= jQuery('.'+jQuery.contentIdPlugin.contentIdValue()).scrollTop() + jQuery('.'+jQuery.contentIdPlugin.contentIdValue()).innerHeight() && !endContent) { + currentTime = new Date(); + contentScrollEnd = currentTime.getTime(); + timeToContentEnd = Math.round((contentScrollEnd - scrollStart) / 1000); + if (!debugMode) { + if (gtmMode) { + dataLayer.push({ + 'event':'content-tracker', + 'content-category':'Reading', + 'content-action':'ContentBottom', + 'content-label':'', + 'content-value':timeToContentEnd, + 'content-non-interaction':false + }); + } else { + ga('send','event', 'Reading', 'ContentBottom', '', timeToContentEnd); + } + } else { + alert('end content section '+timeToContentEnd); + } + endContent = true; + } + + // If user has hit the bottom of page send an event + if (bottom >= height && !didComplete) { + currentTime = new Date(); + end = currentTime.getTime(); + totalTime = Math.round((end - scrollStart) / 1000); + if (!debugMode) { + if (gtmMode) { + if (totalTime < readerTime) { + dataLayer.push({ + 'event':'content-tracker', + 'content-category':'Reading', + 'content-action':'PageBottom', + 'content-label':pageTitle, + 'content-value':totalTime, + 'content-non-interaction':false, + 'readerType':'Scanner' + }); + } else { + dataLayer.push({ + 'event':'content-tracker', + 'content-category':'Reading', + 'content-action':'PageBottom', + 'content-label':pageTitle, + 'content-value':totalTime, + 'content-non-interaction':false, + 'readerType':'Reader' + }); + } + } else { + if (totalTime < readerTime) { + ga('set','dimension5', 'Scanner'); + } else { + ga('set','dimension5', 'Reader'); + } + ga('send','event', 'Reading', 'PageBottom', pageTitle, totalTime); + } + } else { + alert('bottom of page '+totalTime); + } + didComplete = true; + } + } + + // Track the scrolling and track location + $(window).scroll(function() { + if (timer) { + clearTimeout(timer); + } + + // Use a buffer so we don't call trackLocation too often. + timer = setTimeout(trackLocation, callBackTime); + }); +}); diff --git a/plugins/system/highlight/highlight.php b/plugins/system/highlight/highlight.php new file mode 100644 index 0000000..dfa2f33 --- /dev/null +++ b/plugins/system/highlight/highlight.php @@ -0,0 +1,85 @@ +isClient('administrator')) + { + return true; + } + + // Set the variables. + $input = JFactory::getApplication()->input; + $extension = $input->get('option', '', 'cmd'); + + // Check if the highlighter is enabled. + if (!JComponentHelper::getParams($extension)->get('highlight_terms', 1)) + { + return true; + } + + // Check if the highlighter should be activated in this environment. + if ($input->get('tmpl', '', 'cmd') === 'component' || JFactory::getDocument()->getType() !== 'html') + { + return true; + } + + // Get the terms to highlight from the request. + $terms = $input->request->get('highlight', null, 'base64'); + $terms = $terms ? json_decode(base64_decode($terms)) : null; + + // Check the terms. + if (empty($terms)) + { + return true; + } + + // Clean the terms array. + $filter = JFilterInput::getInstance(); + + $cleanTerms = array(); + + foreach ($terms as $term) + { + $cleanTerms[] = htmlspecialchars($filter->clean($term, 'string')); + } + + // Activate the highlighter. + JHtml::_('behavior.highlighter', $cleanTerms); + + // Adjust the component buffer. + $doc = JFactory::getDocument(); + $buf = $doc->getBuffer('component'); + $buf = '
' . $buf . '
'; + $doc->setBuffer($buf, 'component'); + + return true; + } +} diff --git a/plugins/system/highlight/highlight.xml b/plugins/system/highlight/highlight.xml new file mode 100644 index 0000000..e3e077b --- /dev/null +++ b/plugins/system/highlight/highlight.xml @@ -0,0 +1,19 @@ + + + plg_system_highlight + Joomla! Project + August 2011 + (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_SYSTEM_HIGHLIGHT_XML_DESCRIPTION + + highlight.php + + + language/en-GB/en-GB.plg_system_highlight.ini + language/en-GB/en-GB.plg_system_highlight.sys.ini + + diff --git a/plugins/system/highlight/index.html b/plugins/system/highlight/index.html new file mode 100644 index 0000000..3af6301 --- /dev/null +++ b/plugins/system/highlight/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/system/index.html b/plugins/system/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/jce/jce.php b/plugins/system/jce/jce.php new file mode 100644 index 0000000..08a781f --- /dev/null +++ b/plugins/system/jce/jce.php @@ -0,0 +1,140 @@ +onContentPrepareForm($form, $data); + } + + /** + * adds additional fields to the user editing form + * + * @param JForm $form The form to be altered. + * @param mixed $data The associated data for the form. + * + * @return boolean + * + * @since 2.5.20 + */ + public function onContentPrepareForm($form, $data) { + $app = JFactory::getApplication(); + + $version = new JVersion; + + if (!$version->isCompatible('3.4')) { + return true; + } + + if (!($form instanceof JForm)) { + $this->_subject->setError('JERROR_NOT_A_FORM'); + + return false; + } + + $params = JComponentHelper::getParams('com_jce'); + + if ((bool) $params->get('replace_media_manager', 1) === false) { + return; + } + + // get form name. + $name = $form->getName(); + + if (!$version->isCompatible('3.6')) { + $valid = array( + 'com_content.article', + 'com_categories.categorycom_content', + 'com_templates.style', + 'com_tags.tag', + 'com_banners.banner', + 'com_contact.contact', + 'com_newsfeeds.newsfeed' + ); + + // only allow some forms, see - https://github.com/joomla/joomla-cms/pull/8657 + if (!in_array($name, $valid)) { + return true; + } + } + + $config = JFactory::getConfig(); + $user = JFactory::getUser(); + + if ($user->getParam('editor', $config->get('editor')) !== "jce") { + return true; + } + + if (!JPluginHelper::getPlugin('editors', 'jce')) { + return true; + } + + $hasMedia = false; + $fields = $form->getFieldset(); + + foreach ($fields as $field) { + + // avoid processing twice + if (strpos($form->getFieldAttribute($name, 'class'), 'wf-media-input') !== false) { + return; + } + + $type = $field->getAttribute('type'); + + if (strtolower($type) === "media") { + // get filter value for field, eg: images, media, files + $filter = $field->getAttribute('filter', 'images'); + + // get file browser link + $link = $this->getLink($filter); + + // link not available for environment + if (empty($link)) { + continue; + } + + $name = $field->getAttribute('name'); + $group = (string) $field->group; + $form->setFieldAttribute($name, 'link', $link, $group); + $form->setFieldAttribute($name, 'class', 'input-large wf-media-input', $group); + + $hasMedia = true; + } + } + + if ($hasMedia) { + // Include jQuery + JHtml::_('jquery.framework'); + + $document = JFactory::getDocument(); + $document->addScriptDeclaration('jQuery(document).ready(function($){$(".wf-media-input").removeAttr("readonly");});'); + + $document->addStyleSheet(JURI::root(true) . '/plugins/content/jce/css/media.css'); + } + + return true; + } +} diff --git a/plugins/system/jce/jce.xml b/plugins/system/jce/jce.xml new file mode 100644 index 0000000..02f3abf --- /dev/null +++ b/plugins/system/jce/jce.xml @@ -0,0 +1,15 @@ + + + plg_system_jce + 2.5.30 + 17 October 2016 + Ryan Demmer + info@joomlacontenteditor.net + http://www.joomlacontenteditor.net + Copyright (C) 2006 - 2016 Ryan Demmer. All rights reserved + GNU/GPL Version 2 - http://www.gnu.org/licenses/gpl-2.0.html + PLG_SYSTEM_JCE_XML_DESCRIPTION + + jce.php + + diff --git a/plugins/system/k2/k2.php b/plugins/system/k2/k2.php new file mode 100644 index 0000000..4ea99a2 --- /dev/null +++ b/plugins/system/k2/k2.php @@ -0,0 +1,1077 @@ +isSite()) ? JPATH_SITE : JPATH_ADMINISTRATOR; + + JPlugin::loadLanguage('com_k2', $basepath); + + if (K2_JVERSION != '15') + { + JPlugin::loadLanguage('com_k2.j16', JPATH_ADMINISTRATOR, null, true); + } + if ($mainframe->isAdmin()) + { + return; + } + if ((JRequest::getCmd('task') == 'add' || JRequest::getCmd('task') == 'edit') && JRequest::getCmd('option') == 'com_k2') + { + return; + } + + // Joomla! modal trigger + if ( !$user->guest || (JRequest::getCmd('option') == 'com_k2' && JRequest::getCmd('view') == 'item') || defined('K2_JOOMLA_MODAL_REQUIRED') ){ + JHTML::_('behavior.modal'); + } + + $params = JComponentHelper::getParams('com_k2'); + + $document = JFactory::getDocument(); + + // jQuery and K2 JS loading + K2HelperHTML::loadjQuery(); + + $document->addScript(JURI::root(true).'/components/com_k2/js/k2.js?v2.6.8&sitepath='.JURI::root(true).'/'); + //$document->addScriptDeclaration("var K2SitePath = '".JURI::root(true)."/';"); + + if (JRequest::getCmd('task') == 'search' && $params->get('googleSearch')) + { + $language = JFactory::getLanguage(); + $lang = $language->getTag(); + // Fallback to the new container ID without breaking things + $googleSearchContainerID = trim($params->get('googleSearchContainer', 'k2GoogleSearchContainer')); + if($googleSearchContainerID=='k2Container'){ + $googleSearchContainerID = 'k2GoogleSearchContainer'; + } + $document->addScript('http://www.google.com/jsapi'); + $js = ' + //getCfg('sitename').'"); + siteSearch.setUserDefinedClassSuffix("k2"); + options = new google.search.SearcherOptions(); + options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN); + siteSearch.setSiteRestriction("'.JURI::root().'"); + searchControl.addSearcher(siteSearch, options); + searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET); + searchControl.setLinkTarget(google.search.Search.LINK_TARGET_SELF); + searchControl.draw(document.getElementById("'.$googleSearchContainerID.'")); + searchControl.execute("'.JRequest::getString('searchword').'"); + } + + google.setOnLoadCallback(OnLoad); + //]]> + '; + $document->addScriptDeclaration($js); + } + + // Add related CSS to the + if ($document->getType() == 'html' && $params->get('enable_css')) + { + + jimport('joomla.filesystem.file'); + + // k2.css + if (JFile::exists(JPATH_SITE.DS.'templates'.DS.$mainframe->getTemplate().DS.'css'.DS.'k2.css')) + $document->addStyleSheet(JURI::root(true).'/templates/'.$mainframe->getTemplate().'/css/k2.css'); + else + $document->addStyleSheet(JURI::root(true).'/components/com_k2/css/k2.css'); + + // k2.print.css + if (JRequest::getInt('print') == 1) + { + if (JFile::exists(JPATH_SITE.DS.'templates'.DS.$mainframe->getTemplate().DS.'css'.DS.'k2.print.css')) + $document->addStyleSheet(JURI::root(true).'/templates/'.$mainframe->getTemplate().'/css/k2.print.css', 'text/css', 'print'); + else + $document->addStyleSheet(JURI::root(true).'/components/com_k2/css/k2.print.css', 'text/css', 'print'); + } + + } + + } + + // Extend user forms with K2 fields + function onAfterDispatch() + { + + $mainframe = JFactory::getApplication(); + + if ($mainframe->isAdmin()) + return; + + $params = JComponentHelper::getParams('com_k2'); + if (!$params->get('K2UserProfile')) + return; + $option = JRequest::getCmd('option'); + $view = JRequest::getCmd('view'); + $task = JRequest::getCmd('task'); + $layout = JRequest::getCmd('layout'); + $user = JFactory::getUser(); + + if (K2_JVERSION != '15') + { + $active = JFactory::getApplication()->getMenu()->getActive(); + if (isset($active->query['layout'])) + { + $layout = $active->query['layout']; + } + } + + if (($option == 'com_user' && $view == 'register') || ($option == 'com_users' && $view == 'registration')) + { + + if ($params->get('recaptchaOnRegistration') && $params->get('recaptcha_public_key')) + { + $document = JFactory::getDocument(); + $document->addScript('https://www.google.com/recaptcha/api/js/recaptcha_ajax.js'); + $js = ' + function showRecaptcha(){ + Recaptcha.create("'.$params->get('recaptcha_public_key').'", "recaptcha", { + theme: "'.$params->get('recaptcha_theme', 'clean').'" + }); + } + $K2(document).ready(function() { + showRecaptcha(); + }); + '; + $document->addScriptDeclaration($js); + } + + if (!$user->guest) + { + $mainframe->enqueueMessage(JText::_('K2_YOU_ARE_ALREADY_REGISTERED_AS_A_MEMBER'), 'notice'); + $mainframe->redirect(JURI::root()); + $mainframe->close(); + } + if (K2_JVERSION != '15') + { + require_once (JPATH_SITE.DS.'components'.DS.'com_users'.DS.'controller.php'); + $controller = new UsersController; + + } + else + { + require_once (JPATH_SITE.DS.'components'.DS.'com_user'.DS.'controller.php'); + $controller = new UserController; + } + $view = $controller->getView($view, 'html'); + $view->addTemplatePath(JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'templates'); + $view->addTemplatePath(JPATH_SITE.DS.'templates'.DS.$mainframe->getTemplate().DS.'html'.DS.'com_k2'.DS.'templates'); + $view->addTemplatePath(JPATH_SITE.DS.'templates'.DS.$mainframe->getTemplate().DS.'html'.DS.'com_k2'); + $view->setLayout('register'); + + $K2User = new JObject; + + $K2User->description = ''; + $K2User->gender = 'm'; + $K2User->image = ''; + $K2User->url = ''; + $K2User->plugins = ''; + + $wysiwyg = JFactory::getEditor(); + $editor = $wysiwyg->display('description', $K2User->description, '100%', '250px', '', '', false); + $view->assignRef('editor', $editor); + + $lists = array(); + $genderOptions[] = JHTML::_('select.option', 'm', JText::_('K2_MALE')); + $genderOptions[] = JHTML::_('select.option', 'f', JText::_('K2_FEMALE')); + $lists['gender'] = JHTML::_('select.radiolist', $genderOptions, 'gender', '', 'value', 'text', $K2User->gender); + + $view->assignRef('lists', $lists); + $view->assignRef('K2Params', $params); + + JPluginHelper::importPlugin('k2'); + $dispatcher = JDispatcher::getInstance(); + $K2Plugins = $dispatcher->trigger('onRenderAdminForm', array( + &$K2User, + 'user' + )); + $view->assignRef('K2Plugins', $K2Plugins); + + $view->assignRef('K2User', $K2User); + if (K2_JVERSION != '15') + { + $view->assignRef('user', $user); + } + $pathway = $mainframe->getPathway(); + $pathway->setPathway(NULL); + + $nameFieldName = K2_JVERSION != '15' ? 'jform[name]' : 'name'; + $view->assignRef('nameFieldName', $nameFieldName); + $usernameFieldName = K2_JVERSION != '15' ? 'jform[username]' : 'username'; + $view->assignRef('usernameFieldName', $usernameFieldName); + $emailFieldName = K2_JVERSION != '15' ? 'jform[email1]' : 'email'; + $view->assignRef('emailFieldName', $emailFieldName); + $passwordFieldName = K2_JVERSION != '15' ? 'jform[password1]' : 'password'; + $view->assignRef('passwordFieldName', $passwordFieldName); + $passwordVerifyFieldName = K2_JVERSION != '15' ? 'jform[password2]' : 'password2'; + $view->assignRef('passwordVerifyFieldName', $passwordVerifyFieldName); + $optionValue = K2_JVERSION != '15' ? 'com_users' : 'com_user'; + $view->assignRef('optionValue', $optionValue); + $taskValue = K2_JVERSION != '15' ? 'registration.register' : 'register_save'; + $view->assignRef('taskValue', $taskValue); + ob_start(); + $view->display(); + $contents = ob_get_clean(); + $document = JFactory::getDocument(); + $document->setBuffer($contents, 'component'); + + } + + if (($option == 'com_user' && $view == 'user' && ($task == 'edit' || $layout == 'form')) || ($option == 'com_users' && $view == 'profile' && ($layout == 'edit' || $task == 'profile.edit'))) + { + + if ($user->guest) + { + $uri = JFactory::getURI(); + + if (K2_JVERSION != '15') + { + $url = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString()); + + } + else + { + $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString()); + } + $mainframe->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice'); + $mainframe->redirect(JRoute::_($url, false)); + } + + if (K2_JVERSION != '15') + { + require_once (JPATH_SITE.DS.'components'.DS.'com_users'.DS.'controller.php'); + $controller = new UsersController; + } + else + { + require_once (JPATH_SITE.DS.'components'.DS.'com_user'.DS.'controller.php'); + $controller = new UserController; + } + + /* + // TO DO - We open the profile editing page in a modal, so let's define some CSS + $document = JFactory::getDocument(); + $document->addStyleSheet(JURI::root(true).'/media/k2/assets/css/k2.frontend.css?v=2.6.8'); + $document->addStyleSheet(JURI::root(true).'/templates/system/css/general.css'); + $document->addStyleSheet(JURI::root(true).'/templates/system/css/system.css'); + if(K2_JVERSION != '15') { + $document->addStyleSheet(JURI::root(true).'/administrator/templates/bluestork/css/template.css'); + $document->addStyleSheet(JURI::root(true).'/media/system/css/system.css'); + } else { + $document->addStyleSheet(JURI::root(true).'/administrator/templates/khepri/css/general.css'); + } + */ + + $view = $controller->getView($view, 'html'); + $view->addTemplatePath(JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'templates'); + $view->addTemplatePath(JPATH_SITE.DS.'templates'.DS.$mainframe->getTemplate().DS.'html'.DS.'com_k2'.DS.'templates'); + $view->addTemplatePath(JPATH_SITE.DS.'templates'.DS.$mainframe->getTemplate().DS.'html'.DS.'com_k2'); + $view->setLayout('profile'); + + $model = K2Model::getInstance('Itemlist', 'K2Model'); + $K2User = $model->getUserProfile($user->id); + if (!is_object($K2User)) + { + $K2User = new Jobject; + $K2User->description = ''; + $K2User->gender = 'm'; + $K2User->url = ''; + $K2User->image = NULL; + } + if (K2_JVERSION == '15') + { + JFilterOutput::objectHTMLSafe($K2User); + } + else + { + JFilterOutput::objectHTMLSafe($K2User, ENT_QUOTES, array( + 'params', + 'plugins' + )); + } + $wysiwyg = JFactory::getEditor(); + $editor = $wysiwyg->display('description', $K2User->description, '100%', '250px', '', '', false); + $view->assignRef('editor', $editor); + + $lists = array(); + $genderOptions[] = JHTML::_('select.option', 'm', JText::_('K2_MALE')); + $genderOptions[] = JHTML::_('select.option', 'f', JText::_('K2_FEMALE')); + $lists['gender'] = JHTML::_('select.radiolist', $genderOptions, 'gender', '', 'value', 'text', $K2User->gender); + + $view->assignRef('lists', $lists); + + JPluginHelper::importPlugin('k2'); + $dispatcher = JDispatcher::getInstance(); + $K2Plugins = $dispatcher->trigger('onRenderAdminForm', array( + &$K2User, + 'user' + )); + $view->assignRef('K2Plugins', $K2Plugins); + + $view->assignRef('K2User', $K2User); + + // Asssign some variables depending on Joomla! version + $nameFieldName = K2_JVERSION != '15' ? 'jform[name]' : 'name'; + $view->assignRef('nameFieldName', $nameFieldName); + $emailFieldName = K2_JVERSION != '15' ? 'jform[email1]' : 'email'; + $view->assignRef('emailFieldName', $emailFieldName); + $passwordFieldName = K2_JVERSION != '15' ? 'jform[password1]' : 'password'; + $view->assignRef('passwordFieldName', $passwordFieldName); + $passwordVerifyFieldName = K2_JVERSION != '15' ? 'jform[password2]' : 'password2'; + $view->assignRef('passwordVerifyFieldName', $passwordVerifyFieldName); + $usernameFieldName = K2_JVERSION != '15' ? 'jform[username]' : 'username'; + $view->assignRef('usernameFieldName', $usernameFieldName); + $idFieldName = K2_JVERSION != '15' ? 'jform[id]' : 'id'; + $view->assignRef('idFieldName', $idFieldName); + $optionValue = K2_JVERSION != '15' ? 'com_users' : 'com_user'; + $view->assignRef('optionValue', $optionValue); + $taskValue = K2_JVERSION != '15' ? 'profile.save' : 'save'; + $view->assignRef('taskValue', $taskValue); + + ob_start(); + if (K2_JVERSION != '15') + { + $active = JFactory::getApplication()->getMenu()->getActive(); + if (isset($active->query['layout']) && $active->query['layout'] != 'profile') + { + $active->query['layout'] = 'profile'; + } + $view->assignRef('user', $user); + $view->display(); + } + else + { + $view->_displayForm(); + } + + $contents = ob_get_clean(); + $document = JFactory::getDocument(); + $document->setBuffer($contents, 'component'); + + } + + } + + function onAfterInitialise() + { + // Determine Joomla! version + if (version_compare(JVERSION, '3.0', 'ge')) + { + define('K2_JVERSION', '30'); + } + else if (version_compare(JVERSION, '2.5', 'ge')) + { + define('K2_JVERSION', '25'); + } + else + { + define('K2_JVERSION', '15'); + } + + // Define the DS constant under Joomla! 3.0 + if (!defined('DS')) + { + define('DS', DIRECTORY_SEPARATOR); + } + + // Import Joomla! classes + jimport('joomla.filesystem.file'); + jimport('joomla.filesystem.folder'); + jimport('joomla.application.component.controller'); + jimport('joomla.application.component.model'); + jimport('joomla.application.component.view'); + + // Get application + $mainframe = JFactory::getApplication(); + + // Load the K2 classes + JLoader::register('K2Table', JPATH_ADMINISTRATOR.'/components/com_k2/tables/table.php'); + JLoader::register('K2Controller', JPATH_BASE.'/components/com_k2/controllers/controller.php'); + JLoader::register('K2Model', JPATH_ADMINISTRATOR.'/components/com_k2/models/model.php'); + if ($mainframe->isSite()) + { + K2Model::addIncludePath(JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'models'); + } + else + { + // Fix warning under Joomla! 1.5 caused by conflict in model names + if (K2_JVERSION != '15' || (K2_JVERSION == '15' && JRequest::getCmd('option') != 'com_users')) + { + K2Model::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'models'); + } + } + JLoader::register('K2View', JPATH_ADMINISTRATOR.'/components/com_k2/views/view.php'); + JLoader::register('K2HelperHTML', JPATH_ADMINISTRATOR.'/components/com_k2/helpers/html.php'); + + // Community Builder integration + $componentParams = JComponentHelper::getParams('com_k2'); + if ($componentParams->get('cbIntegration') && JFile::exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_comprofiler'.DS.'plugin.foundation.php')) + { + define('K2_CB', true); + global $_CB_framework; + require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_comprofiler'.DS.'plugin.foundation.php'); + cbimport('cb.html'); + cbimport('language.front'); + } + else + { + define('K2_CB', false); + } + + // Define the default Itemid for users and tags. Defined here instead of the K2HelperRoute for performance reasons. + // UPDATE : Removed in K2 2.6.8. All K2 links without Itemid now use the anyK2Link defined in the router helper. + // define('K2_USERS_ITEMID', $componentParams->get('defaultUsersItemid')); + // define('K2_TAGS_ITEMID', $componentParams->get('defaultTagsItemid')); + + // Define JoomFish compatibility version. + if (JFile::exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_joomfish'.DS.'joomfish.php')) + { + if (K2_JVERSION == '15') + { + $db = JFactory::getDBO(); + $config = JFactory::getConfig(); + $prefix = $config->getValue('config.dbprefix'); + if (array_key_exists($prefix.'_jf_languages_ext', $db->getTableList())) + { + define('K2_JF_ID', 'lang_id'); + + } + else + { + define('K2_JF_ID', 'id'); + } + } + else + { + define('K2_JF_ID', 'lang_id'); + } + } + /* + if(JRequest::getCmd('option')=='com_k2' && JRequest::getCmd('task')=='save' && !$mainframe->isAdmin()){ + $dispatcher = JDispatcher::getInstance(); + foreach($dispatcher->_observers as $observer){ + if($observer->_name=='jfdatabase' || $observer->_name=='jfrouter' || $observer->_name=='missing_translation'){ + $dispatcher->detach($observer); + } + } + } + */ + + // Use K2 to make Joomla! Varnish-friendly + // For more checkout: https://snipt.net/fevangelou/the-perfect-varnish-configuration-for-joomla-websites/ + $user = JFactory::getUser(); + if (!$user->guest) + { + JResponse::setHeader('X-Logged-In', 'True', true); + } + else + { + JResponse::setHeader('X-Logged-In', 'False', true); + } + + if (!$mainframe->isAdmin()) + { + return; + } + + $option = JRequest::getCmd('option'); + $task = JRequest::getCmd('task'); + $type = JRequest::getCmd('catid'); + + if ($option != 'com_joomfish') + return; + + if (!JFile::exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'lib'.DS.'JSON.php')) + { + return; + } + + JPlugin::loadLanguage('com_k2', JPATH_ADMINISTRATOR); + + JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'tables'); + require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'lib'.DS.'JSON.php'); + + // Joom!Fish + if ($option == 'com_joomfish' && ($task == 'translate.apply' || $task == 'translate.save') && $type == 'k2_items') + { + + $language_id = JRequest::getInt('select_language_id'); + $reference_id = JRequest::getInt('reference_id'); + $objects = array(); + $variables = JRequest::get('post'); + + foreach ($variables as $key => $value) + { + if (( bool )JString::stristr($key, 'K2ExtraField_')) + { + $object = new JObject; + $object->set('id', JString::substr($key, 13)); + $object->set('value', $value); + unset($object->_errors); + $objects[] = $object; + } + } + + $json = new Services_JSON; + $extra_fields = $json->encode($objects); + + $extra_fields_search = ''; + + foreach ($objects as $object) + { + $extra_fields_search .= $this->getSearchValue($object->id, $object->value); + $extra_fields_search .= ' '; + } + + $user = JFactory::getUser(); + + $db = JFactory::getDBO(); + + $query = "SELECT COUNT(*) FROM #__jf_content WHERE reference_field = 'extra_fields' AND language_id = {$language_id} AND reference_id = {$reference_id} AND reference_table='k2_items'"; + $db->setQuery($query); + $result = $db->loadResult(); + + if ($result > 0) + { + $query = "UPDATE #__jf_content SET value=".$db->Quote($extra_fields)." WHERE reference_field = 'extra_fields' AND language_id = {$language_id} AND reference_id = {$reference_id} AND reference_table='k2_items'"; + $db->setQuery($query); + $db->query(); + } + else + { + $modified = date("Y-m-d H:i:s"); + $modified_by = $user->id; + $published = JRequest::getVar('published', 0); + $query = "INSERT INTO #__jf_content (`id`, `language_id`, `reference_id`, `reference_table`, `reference_field` ,`value`, `original_value`, `original_text`, `modified`, `modified_by`, `published`) VALUES (NULL, {$language_id}, {$reference_id}, 'k2_items', 'extra_fields', ".$db->Quote($extra_fields).", '','', ".$db->Quote($modified).", {$modified_by}, {$published} )"; + $db->setQuery($query); + $db->query(); + } + + $query = "SELECT COUNT(*) FROM #__jf_content WHERE reference_field = 'extra_fields_search' AND language_id = {$language_id} AND reference_id = {$reference_id} AND reference_table='k2_items'"; + $db->setQuery($query); + $result = $db->loadResult(); + + if ($result > 0) + { + $query = "UPDATE #__jf_content SET value=".$db->Quote($extra_fields_search)." WHERE reference_field = 'extra_fields_search' AND language_id = {$language_id} AND reference_id = {$reference_id} AND reference_table='k2_items'"; + $db->setQuery($query); + $db->query(); + } + else + { + $modified = date("Y-m-d H:i:s"); + $modified_by = $user->id; + $published = JRequest::getVar('published', 0); + $query = "INSERT INTO #__jf_content (`id`, `language_id`, `reference_id`, `reference_table`, `reference_field` ,`value`, `original_value`, `original_text`, `modified`, `modified_by`, `published`) VALUES (NULL, {$language_id}, {$reference_id}, 'k2_items', 'extra_fields_search', ".$db->Quote($extra_fields_search).", '','', ".$db->Quote($modified).", {$modified_by}, {$published} )"; + $db->setQuery($query); + $db->query(); + } + + } + + if ($option == 'com_joomfish' && ($task == 'translate.edit' || $task == 'translate.apply') && $type == 'k2_items') + { + + if ($task == 'translate.edit') + { + $cid = JRequest::getVar('cid'); + $array = explode('|', $cid[0]); + $reference_id = $array[1]; + } + + if ($task == 'translate.apply') + { + $reference_id = JRequest::getInt('reference_id'); + } + + $item = JTable::getInstance('K2Item', 'Table'); + $item->load($reference_id); + $category_id = $item->catid; + $language_id = JRequest::getInt('select_language_id'); + + $category = JTable::getInstance('K2Category', 'Table'); + $category->load($category_id); + $group = $category->extraFieldsGroup; + $db = JFactory::getDBO(); + $query = "SELECT * FROM #__k2_extra_fields WHERE `group`=".$db->Quote($group)." AND published=1 ORDER BY ordering"; + $db->setQuery($query); + $extraFields = $db->loadObjectList(); + + $json = new Services_JSON; + $output = ''; + if (count($extraFields)) + { + $output .= '

'.JText::_('K2_EXTRA_FIELDS').'

'; + $output .= '

'.JText::_('K2_ORIGINAL').'

'; + foreach ($extraFields as $extrafield) + { + $extraField = $json->decode($extrafield->value); + $output .= trim($this->renderOriginal($extrafield, $reference_id)); + + } + } + + if (count($extraFields)) + { + $output .= '

'.JText::_('K2_TRANSLATION').'

'; + foreach ($extraFields as $extrafield) + { + $extraField = $json->decode($extrafield->value); + $output .= trim($this->renderTranslated($extrafield, $reference_id)); + } + } + + $pattern = '/\r\n|\r|\n/'; + + // *** Mootools Snippet *** + $js = " + window.addEvent('domready', function(){ + var target = $$('table.adminform'); + target.setProperty('id', 'adminform'); + var div = new Element('div', {'id': 'K2ExtraFields'}).setHTML('".preg_replace($pattern, '', $output)."').injectInside($('adminform')); + }); + "; + + if (K2_JVERSION == '15') + { + JHTML::_('behavior.mootools'); + } + else + { + JHTML::_('behavior.framework'); + + } + + $document = JFactory::getDocument(); + $document->addScriptDeclaration($js); + + // *** Embedded CSS Snippet *** + $document->addCustomTag(' + + '); + } + + if ($option == 'com_joomfish' && ($task == 'translate.apply' || $task == 'translate.save') && $type == 'k2_extra_fields') + { + + $language_id = JRequest::getInt('select_language_id'); + $reference_id = JRequest::getInt('reference_id'); + $extraFieldType = JRequest::getVar('extraFieldType'); + + $objects = array(); + $values = JRequest::getVar('option_value'); + $names = JRequest::getVar('option_name'); + $target = JRequest::getVar('option_target'); + + for ($i = 0; $i < sizeof($values); $i++) + { + $object = new JObject; + $object->set('name', $names[$i]); + + if ($extraFieldType == 'select' || $extraFieldType == 'multipleSelect' || $extraFieldType == 'radio') + { + $object->set('value', $i + 1); + } + elseif ($extraFieldType == 'link') + { + if (substr($values[$i], 0, 7) == 'http://') + { + $values[$i] = $values[$i]; + } + else + { + $values[$i] = 'http://'.$values[$i]; + } + $object->set('value', $values[$i]); + } + else + { + $object->set('value', $values[$i]); + } + + $object->set('target', $target[$i]); + unset($object->_errors); + $objects[] = $object; + } + + $json = new Services_JSON; + $value = $json->encode($objects); + + $user = JFactory::getUser(); + + $db = JFactory::getDBO(); + + $query = "SELECT COUNT(*) FROM #__jf_content WHERE reference_field = 'value' AND language_id = {$language_id} AND reference_id = {$reference_id} AND reference_table='k2_extra_fields'"; + $db->setQuery($query); + $result = $db->loadResult(); + + if ($result > 0) + { + $query = "UPDATE #__jf_content SET value=".$db->Quote($value)." WHERE reference_field = 'value' AND language_id = {$language_id} AND reference_id = {$reference_id} AND reference_table='k2_extra_fields'"; + $db->setQuery($query); + $db->query(); + } + else + { + $modified = date("Y-m-d H:i:s"); + $modified_by = $user->id; + $published = JRequest::getVar('published', 0); + $query = "INSERT INTO #__jf_content (`id`, `language_id`, `reference_id`, `reference_table`, `reference_field` ,`value`, `original_value`, `original_text`, `modified`, `modified_by`, `published`) VALUES (NULL, {$language_id}, {$reference_id}, 'k2_extra_fields', 'value', ".$db->Quote($value).", '','', ".$db->Quote($modified).", {$modified_by}, {$published} )"; + $db->setQuery($query); + $db->query(); + } + + } + + if ($option == 'com_joomfish' && ($task == 'translate.edit' || $task == 'translate.apply') && $type == 'k2_extra_fields') + { + + if ($task == 'translate.edit') + { + $cid = JRequest::getVar('cid'); + $array = explode('|', $cid[0]); + $reference_id = $array[1]; + } + + if ($task == 'translate.apply') + { + $reference_id = JRequest::getInt('reference_id'); + } + + $extraField = JTable::getInstance('K2ExtraField', 'Table'); + $extraField->load($reference_id); + $language_id = JRequest::getInt('select_language_id'); + + if ($extraField->type == 'multipleSelect' || $extraField->type == 'select' || $extraField->type == 'radio') + { + $subheader = ''.JText::_('K2_OPTIONS').''; + } + else + { + $subheader = ''.JText::_('K2_DEFAULT_VALUE').''; + } + + $json = new Services_JSON; + $objects = $json->decode($extraField->value); + $output = ''; + if (count($objects)) + { + $output .= '

'.JText::_('K2_EXTRA_FIELDS').'

'; + $output .= '

'.JText::_('K2_ORIGINAL').'

'; + $output .= $subheader.'
'; + + foreach ($objects as $object) + { + $output .= '

'.$object->name.'

'; + if ($extraField->type == 'textfield' || $extraField->type == 'textarea') + $output .= '

'.$object->value.'

'; + } + } + + $db = JFactory::getDBO(); + $query = "SELECT `value` FROM #__jf_content WHERE reference_field = 'value' AND language_id = {$language_id} AND reference_id = {$reference_id} AND reference_table='k2_extra_fields'"; + $db->setQuery($query); + $result = $db->loadResult(); + + $translatedObjects = $json->decode($result); + + if (count($objects)) + { + $output .= '

'.JText::_('K2_TRANSLATION').'

'; + $output .= $subheader.'
'; + foreach ($objects as $key => $value) + { + if (isset($translatedObjects[$key])) + $value = $translatedObjects[$key]; + + if ($extraField->type == 'textarea') + $output .= '

'; + else + $output .= '

'; + $output .= '

'; + $output .= '

'; + } + } + + $pattern = '/\r\n|\r|\n/'; + + // *** Mootools Snippet *** + $js = " + window.addEvent('domready', function(){ + var target = $$('table.adminform'); + target.setProperty('id', 'adminform'); + var div = new Element('div', {'id': 'K2ExtraFields'}).setHTML('".preg_replace($pattern, '', $output)."').injectInside($('adminform')); + }); + "; + + JHTML::_('behavior.mootools'); + $document = JFactory::getDocument(); + $document->addScriptDeclaration($js); + } + return; + } + + function onAfterRender() + { + $response = JResponse::getBody(); + $searches = array( + 'load($id); + + require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'lib'.DS.'JSON.php'); + $json = new Services_JSON; + $jsonObject = $json->decode($row->value); + + $value = ''; + if ($row->type == 'textfield' || $row->type == 'textarea') + { + $value = $currentValue; + } + else if ($row->type == 'multipleSelect' || $row->type == 'link') + { + foreach ($jsonObject as $option) + { + if (@in_array($option->value, $currentValue)) + $value .= $option->name.' '; + } + } + else + { + foreach ($jsonObject as $option) + { + if ($option->value == $currentValue) + $value .= $option->name; + } + } + return $value; + + } + + function renderOriginal($extraField, $itemID) + { + + $mainframe = JFactory::getApplication(); + JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'tables'); + require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'lib'.DS.'JSON.php'); + $json = new Services_JSON; + $item = JTable::getInstance('K2Item', 'Table'); + $item->load($itemID); + + $defaultValues = $json->decode($extraField->value); + + foreach ($defaultValues as $value) + { + if ($extraField->type == 'textfield' || $extraField->type == 'textarea') + $active = $value->value; + else if ($extraField->type == 'link') + { + $active[0] = $value->name; + $active[1] = $value->value; + $active[2] = $value->target; + } + else + $active = ''; + } + + if (isset($item)) + { + $currentValues = $json->decode($item->extra_fields); + if (count($currentValues)) + { + foreach ($currentValues as $value) + { + if ($value->id == $extraField->id) + { + $active = $value->value; + } + + } + } + + } + + $output = ''; + + switch ($extraField->type) + { + case 'textfield' : + $output = '
'.$extraField->name.'


'; + break; + + case 'textarea' : + $output = '
'.$extraField->name.'


'; + break; + + case 'link' : + $output = '
'.$extraField->name.'
'; + $output .= ' 
'; + $output .= '

'; + break; + } + + return $output; + + } + + function renderTranslated($extraField, $itemID) + { + + $mainframe = JFactory::getApplication(); + require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'lib'.DS.'JSON.php'); + $json = new Services_JSON; + + JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'tables'); + $item = JTable::getInstance('K2Item', 'Table'); + $item->load($itemID); + + $defaultValues = $json->decode($extraField->value); + + foreach ($defaultValues as $value) + { + if ($extraField->type == 'textfield' || $extraField->type == 'textarea') + $active = $value->value; + else if ($extraField->type == 'link') + { + $active[0] = $value->name; + $active[1] = $value->value; + $active[2] = $value->target; + } + else + $active = ''; + } + + if (isset($item)) + { + $currentValues = $json->decode($item->extra_fields); + if (count($currentValues)) + { + foreach ($currentValues as $value) + { + if ($value->id == $extraField->id) + { + $active = $value->value; + } + + } + } + + } + + $language_id = JRequest::getInt('select_language_id'); + $db = JFactory::getDBO(); + $query = "SELECT `value` FROM #__jf_content WHERE reference_field = 'extra_fields' AND language_id = {$language_id} AND reference_id = {$itemID} AND reference_table='k2_items'"; + $db->setQuery($query); + $result = $db->loadResult(); + $currentValues = $json->decode($result); + if (count($currentValues)) + { + foreach ($currentValues as $value) + { + if ($value->id == $extraField->id) + { + $active = $value->value; + } + + } + } + + $output = ''; + + switch ($extraField->type) + { + + case 'textfield' : + $output = '
'.$extraField->name.'


'; + break; + + case 'textarea' : + $output = '
'.$extraField->name.'


'; + break; + + case 'select' : + $output = '
'.JHTML::_('select.genericlist', $defaultValues, 'K2ExtraField_'.$extraField->id, '', 'value', 'name', $active).'
'; + break; + + case 'multipleSelect' : + $output = '
'.JHTML::_('select.genericlist', $defaultValues, 'K2ExtraField_'.$extraField->id.'[]', 'multiple="multiple"', 'value', 'name', $active).'
'; + break; + + case 'radio' : + $output = '
'.JHTML::_('select.radiolist', $defaultValues, 'K2ExtraField_'.$extraField->id, '', 'value', 'name', $active).'
'; + break; + + case 'link' : + $output = '
'.$extraField->name.'
'; + $output .= '
'; + $output .= '
'; + $output .= '
'; + $output .= '

'; + break; + } + + return $output; + + } + +} diff --git a/plugins/system/k2/k2.xml b/plugins/system/k2/k2.xml new file mode 100644 index 0000000..e5d4e09 --- /dev/null +++ b/plugins/system/k2/k2.xml @@ -0,0 +1,15 @@ + + + System - K2 + JoomlaWorks + February 28th, 2014 + Copyright (c) 2006 - 2014 JoomlaWorks Ltd. All rights reserved. + please-use-the-contact-form@joomlaworks.net + www.joomlaworks.net + 2.6.8 + http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL + K2_THE_K2_SYSTEM_PLUGIN_IS_USED_TO_ASSIST_THE_PROPER_FUNCTIONALITY_OF_THE_K2_COMPONENT_SITE_WIDE_MAKE_SURE_ITS_ALWAYS_PUBLISHED_WHEN_THE_K2_COMPONENT_IS_INSTALLED + + k2.php + + diff --git a/plugins/system/languagecode/index.html b/plugins/system/languagecode/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/languagecode/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/languagecode/language/en-GB/en-GB.plg_system_languagecode.ini b/plugins/system/languagecode/language/en-GB/en-GB.plg_system_languagecode.ini new file mode 100644 index 0000000..8de2919 --- /dev/null +++ b/plugins/system/languagecode/language/en-GB/en-GB.plg_system_languagecode.ini @@ -0,0 +1,10 @@ +; Joomla! Project +; Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_SYSTEM_LANGUAGECODE="System - Language Code" +PLG_SYSTEM_LANGUAGECODE_FIELD_DESC="Changes the language code used for the %s language." +PLG_SYSTEM_LANGUAGECODE_FIELDSET_DESC="Changes the language code for the generated HTML document. Example usage: You have installed the fr-FR language pack and want the Search Engines to recognise the page as aimed at French-speaking Canada. Add the tag 'fr-CA' to the corresponding field for 'fr-FR' to resolve this." +PLG_SYSTEM_LANGUAGECODE_FIELDSET_LABEL="Language codes" +PLG_SYSTEM_LANGUAGECODE_XML_DESCRIPTION="Provides the ability to change the language code in the generated HTML document to improve SEO.
The fields will appear when the plugin is enabled and saved.
More information at W3.org." \ No newline at end of file diff --git a/plugins/system/languagecode/language/en-GB/en-GB.plg_system_languagecode.sys.ini b/plugins/system/languagecode/language/en-GB/en-GB.plg_system_languagecode.sys.ini new file mode 100644 index 0000000..b671d2e --- /dev/null +++ b/plugins/system/languagecode/language/en-GB/en-GB.plg_system_languagecode.sys.ini @@ -0,0 +1,8 @@ +; Joomla! Project +; Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_SYSTEM_LANGUAGECODE="System - Language Code" +PLG_SYSTEM_LANGUAGECODE_XML_DESCRIPTION="Provides ability to change the language code in the generated HTML document to improve SEO" + diff --git a/plugins/system/languagecode/language/en-GB/index.html b/plugins/system/languagecode/language/en-GB/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/languagecode/language/en-GB/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/languagecode/language/index.html b/plugins/system/languagecode/language/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/languagecode/language/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/languagecode/languagecode.php b/plugins/system/languagecode/languagecode.php new file mode 100644 index 0000000..9826fc0 --- /dev/null +++ b/plugins/system/languagecode/languagecode.php @@ -0,0 +1,165 @@ + tag. + * + * @return void + * + * @since 2.5 + */ + public function onAfterRender() + { + $app = JFactory::getApplication(); + + // Use this plugin only in site application. + if ($app->isClient('site')) + { + // Get the response body. + $body = $app->getBody(); + + // Get the current language code. + $code = JFactory::getDocument()->getLanguage(); + + // Get the new code. + $new_code = $this->params->get($code); + + // Replace the old code by the new code in the tag. + if ($new_code) + { + // Replace the new code in the HTML document. + $patterns = array( + chr(1) . '()' . chr(1) . 'i', + chr(1) . '()' . chr(1) . 'i', + ); + $replace = array( + '${1}' . strtolower($new_code) . '${3}', + '${1}' . strtolower($new_code) . '${3}' + ); + } + else + { + $patterns = array(); + $replace = array(); + } + + // Replace codes in attributes. + preg_match_all(chr(1) . '()' . chr(1) . 'i', $body, $matches); + + foreach ($matches[2] as $match) + { + $new_code = $this->params->get(strtolower($match)); + + if ($new_code) + { + $patterns[] = chr(1) . '()' . chr(1) . 'i'; + $replace[] = '${1}' . $new_code . '${3}'; + } + } + + preg_match_all(chr(1) . '()' . chr(1) . 'i', $body, $matches); + + foreach ($matches[2] as $match) + { + $new_code = $this->params->get(strtolower($match)); + + if ($new_code) + { + $patterns[] = chr(1) . '()' . chr(1) . 'i'; + $replace[] = '${1}' . $new_code . '${3}'; + } + } + + // Replace codes in itemprop content + preg_match_all(chr(1) . '()' . chr(1) . 'i', $body, $matches); + + foreach ($matches[2] as $match) + { + $new_code = $this->params->get(strtolower($match)); + + if ($new_code) + { + $patterns[] = chr(1) . '()' . chr(1) . 'i'; + $replace[] = '${1}' . $new_code . '${3}'; + } + } + + $app->setBody(preg_replace($patterns, $replace, $body)); + } + } + + /** + * Prepare form. + * + * @param JForm $form The form to be altered. + * @param mixed $data The associated data for the form. + * + * @return boolean + * + * @since 2.5 + */ + public function onContentPrepareForm($form, $data) + { + // Check we have a form. + if (!($form instanceof JForm)) + { + $this->_subject->setError('JERROR_NOT_A_FORM'); + + return false; + } + + // Check we are manipulating the languagecode plugin. + if ($form->getName() !== 'com_plugins.plugin' || !$form->getField('languagecodeplugin', 'params')) + { + return true; + } + + // Get site languages. + if ($languages = JLanguageHelper::getKnownLanguages(JPATH_SITE)) + { + // Inject fields into the form. + foreach ($languages as $tag => $language) + { + $form->load(' +
+ +
+ +
+
+
+ '); + } + } + + return true; + } +} diff --git a/plugins/system/languagecode/languagecode.xml b/plugins/system/languagecode/languagecode.xml new file mode 100644 index 0000000..8203f5f --- /dev/null +++ b/plugins/system/languagecode/languagecode.xml @@ -0,0 +1,29 @@ + + + plg_system_languagecode + Joomla! Project + November 2011 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_SYSTEM_LANGUAGECODE_XML_DESCRIPTION + + languagecode.php + language + + + language/en-GB/en-GB.plg_system_languagecode.ini + language/en-GB/en-GB.plg_system_languagecode.sys.ini + + + + + + + diff --git a/plugins/system/languagefilter/index.html b/plugins/system/languagefilter/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/languagefilter/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/languagefilter/languagefilter.php b/plugins/system/languagefilter/languagefilter.php new file mode 100644 index 0000000..9d5bf41 --- /dev/null +++ b/plugins/system/languagefilter/languagefilter.php @@ -0,0 +1,884 @@ +app = JFactory::getApplication(); + + if ($this->app->isClient('site')) + { + // Setup language data. + $this->mode_sef = $this->app->get('sef', 0); + $this->sefs = JLanguageHelper::getLanguages('sef'); + $this->lang_codes = JLanguageHelper::getLanguages('lang_code'); + $this->default_lang = JComponentHelper::getParams('com_languages')->get('site', 'en-GB'); + + $levels = JFactory::getUser()->getAuthorisedViewLevels(); + + foreach ($this->sefs as $sef => $language) + { + // @todo: In Joomla 2.5.4 and earlier access wasn't set. Non modified Content Languages got 0 as access value + // we also check if frontend language exists and is enabled + if (($language->access && !in_array($language->access, $levels)) + || (!array_key_exists($language->lang_code, JLanguageHelper::getInstalledLanguages(0)))) + { + unset($this->lang_codes[$language->lang_code], $this->sefs[$language->sef]); + } + } + } + } + + /** + * After initialise. + * + * @return void + * + * @since 1.6 + */ + public function onAfterInitialise() + { + $this->app->item_associations = $this->params->get('item_associations', 0); + + if ($this->app->isClient('site')) + { + $router = $this->app->getRouter(); + + // Attach build rules for language SEF. + $router->attachBuildRule(array($this, 'preprocessBuildRule'), JRouter::PROCESS_BEFORE); + $router->attachBuildRule(array($this, 'buildRule'), JRouter::PROCESS_DURING); + + if ($this->mode_sef) + { + $router->attachBuildRule(array($this, 'postprocessSEFBuildRule'), JRouter::PROCESS_AFTER); + } + else + { + $router->attachBuildRule(array($this, 'postprocessNonSEFBuildRule'), JRouter::PROCESS_AFTER); + } + + // Attach parse rules for language SEF. + $router->attachParseRule(array($this, 'parseRule'), JRouter::PROCESS_DURING); + } + } + + /** + * After route. + * + * @return void + * + * @since 3.4 + */ + public function onAfterRoute() + { + // Add custom site name. + if (isset($this->lang_codes[$this->current_lang]) && $this->lang_codes[$this->current_lang]->sitename) + { + $this->app->set('sitename', $this->lang_codes[$this->current_lang]->sitename); + } + } + + /** + * Add build preprocess rule to router. + * + * @param JRouter &$router JRouter object. + * @param JUri &$uri JUri object. + * + * @return void + * + * @since 3.4 + */ + public function preprocessBuildRule(&$router, &$uri) + { + $lang = $uri->getVar('lang', $this->current_lang); + $uri->setVar('lang', $lang); + + if (isset($this->sefs[$lang])) + { + $lang = $this->sefs[$lang]->lang_code; + $uri->setVar('lang', $lang); + } + } + + /** + * Add build rule to router. + * + * @param JRouter &$router JRouter object. + * @param JUri &$uri JUri object. + * + * @return void + * + * @since 1.6 + */ + public function buildRule(&$router, &$uri) + { + $lang = $uri->getVar('lang'); + + if (isset($this->lang_codes[$lang])) + { + $sef = $this->lang_codes[$lang]->sef; + } + else + { + $sef = $this->lang_codes[$this->current_lang]->sef; + } + + if ($this->mode_sef + && (!$this->params->get('remove_default_prefix', 0) + || $lang !== $this->default_lang + || $lang !== $this->current_lang)) + { + $uri->setPath($uri->getPath() . '/' . $sef . '/'); + } + } + + /** + * postprocess build rule for SEF URLs + * + * @param JRouter &$router JRouter object. + * @param JUri &$uri JUri object. + * + * @return void + * + * @since 3.4 + */ + public function postprocessSEFBuildRule(&$router, &$uri) + { + $uri->delVar('lang'); + } + + /** + * postprocess build rule for non-SEF URLs + * + * @param JRouter &$router JRouter object. + * @param JUri &$uri JUri object. + * + * @return void + * + * @since 3.4 + */ + public function postprocessNonSEFBuildRule(&$router, &$uri) + { + $lang = $uri->getVar('lang'); + + if (isset($this->lang_codes[$lang])) + { + $uri->setVar('lang', $this->lang_codes[$lang]->sef); + } + } + + /** + * Add parse rule to router. + * + * @param JRouter &$router JRouter object. + * @param JUri &$uri JUri object. + * + * @return void + * + * @since 1.6 + */ + public function parseRule(&$router, &$uri) + { + // Did we find the current and existing language yet? + $found = false; + + // Are we in SEF mode or not? + if ($this->mode_sef) + { + $path = $uri->getPath(); + $parts = explode('/', $path); + + $sef = $parts[0]; + + // Do we have a URL Language Code ? + if (!isset($this->sefs[$sef])) + { + // Check if remove default URL language code is set + if ($this->params->get('remove_default_prefix', 0)) + { + if ($parts[0]) + { + // We load a default site language page + $lang_code = $this->default_lang; + } + else + { + // We check for an existing language cookie + $lang_code = $this->getLanguageCookie(); + } + } + else + { + $lang_code = $this->getLanguageCookie(); + } + + // No language code. Try using browser settings or default site language + if (!$lang_code && $this->params->get('detect_browser', 0) == 1) + { + $lang_code = JLanguageHelper::detectLanguage(); + } + + if (!$lang_code) + { + $lang_code = $this->default_lang; + } + + if ($lang_code === $this->default_lang && $this->params->get('remove_default_prefix', 0)) + { + $found = true; + } + } + else + { + // We found our language + $found = true; + $lang_code = $this->sefs[$sef]->lang_code; + + // If we found our language, but its the default language and we don't want a prefix for that, we are on a wrong URL. + // Or we try to change the language back to the default language. We need a redirect to the proper URL for the default language. + if ($lang_code === $this->default_lang && $this->params->get('remove_default_prefix', 0)) + { + // Create a cookie. + $this->setLanguageCookie($lang_code); + + $found = false; + array_shift($parts); + $path = implode('/', $parts); + } + + // We have found our language and the first part of our URL is the language prefix + if ($found) + { + array_shift($parts); + + // Empty parts array when "index.php" is the only part left. + if (count($parts) === 1 && $parts[0] === 'index.php') + { + $parts = array(); + } + + $uri->setPath(implode('/', $parts)); + } + } + } + // We are not in SEF mode + else + { + $lang_code = $this->getLanguageCookie(); + + if (!$lang_code && $this->params->get('detect_browser', 1)) + { + $lang_code = JLanguageHelper::detectLanguage(); + } + + if (!isset($this->lang_codes[$lang_code])) + { + $lang_code = $this->default_lang; + } + } + + $lang = $uri->getVar('lang', $lang_code); + + if (isset($this->sefs[$lang])) + { + // We found our language + $found = true; + $lang_code = $this->sefs[$lang]->lang_code; + } + + // We are called via POST. We don't care about the language + // and simply set the default language as our current language. + if ($this->app->input->getMethod() === 'POST' + || count($this->app->input->post) > 0 + || count($this->app->input->files) > 0) + { + $found = true; + + if (!isset($lang_code)) + { + $lang_code = $this->getLanguageCookie(); + } + + if (!$lang_code && $this->params->get('detect_browser', 1)) + { + $lang_code = JLanguageHelper::detectLanguage(); + } + + if (!isset($this->lang_codes[$lang_code])) + { + $lang_code = $this->default_lang; + } + } + + // We have not found the language and thus need to redirect + if (!$found) + { + // Lets find the default language for this user + if (!isset($lang_code) || !isset($this->lang_codes[$lang_code])) + { + $lang_code = false; + + if ($this->params->get('detect_browser', 1)) + { + $lang_code = JLanguageHelper::detectLanguage(); + + if (!isset($this->lang_codes[$lang_code])) + { + $lang_code = false; + } + } + + if (!$lang_code) + { + $lang_code = $this->default_lang; + } + } + + if ($this->mode_sef) + { + // Use the current language sef or the default one. + if ($lang_code !== $this->default_lang + || !$this->params->get('remove_default_prefix', 0)) + { + $path = $this->lang_codes[$lang_code]->sef . '/' . $path; + } + + $uri->setPath($path); + + if (!$this->app->get('sef_rewrite')) + { + $uri->setPath('index.php/' . $uri->getPath()); + } + + $redirectUri = $uri->base() . $uri->toString(array('path', 'query', 'fragment')); + } + else + { + $uri->setVar('lang', $this->lang_codes[$lang_code]->sef); + $redirectUri = $uri->base() . 'index.php?' . $uri->getQuery(); + } + + // Set redirect HTTP code to "302 Found". + $redirectHttpCode = 302; + + // If selected language is the default language redirect code is "301 Moved Permanently". + if ($lang_code === $this->default_lang) + { + $redirectHttpCode = 301; + + // We cannot cache this redirect in browser. 301 is cachable by default so we need to force to not cache it in browsers. + $this->app->setHeader('Expires', 'Wed, 17 Aug 2005 00:00:00 GMT', true); + $this->app->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true); + $this->app->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false); + $this->app->setHeader('Pragma', 'no-cache'); + $this->app->sendHeaders(); + } + + // Redirect to language. + $this->app->redirect($redirectUri, $redirectHttpCode); + } + + // We have found our language and now need to set the cookie and the language value in our system + $array = array('lang' => $lang_code); + $this->current_lang = $lang_code; + + // Set the request var. + $this->app->input->set('language', $lang_code); + $this->app->set('language', $lang_code); + $language = JFactory::getLanguage(); + + if ($language->getTag() !== $lang_code) + { + $language_new = JLanguage::getInstance($lang_code); + + foreach ($language->getPaths() as $extension => $files) + { + if (strpos($extension, 'plg_system') !== false) + { + $extension_name = substr($extension, 11); + + $language_new->load($extension, JPATH_ADMINISTRATOR) + || $language_new->load($extension, JPATH_PLUGINS . '/system/' . $extension_name); + + continue; + } + + $language_new->load($extension); + } + + JFactory::$language = $language_new; + $this->app->loadLanguage($language_new); + } + + // Create a cookie. + if ($this->getLanguageCookie() !== $lang_code) + { + $this->setLanguageCookie($lang_code); + } + + return $array; + } + + /** + * Before store user method. + * + * Method is called before user data is stored in the database. + * + * @param array $user Holds the old user data. + * @param boolean $isnew True if a new user is stored. + * @param array $new Holds the new user data. + * + * @return void + * + * @since 1.6 + */ + public function onUserBeforeSave($user, $isnew, $new) + { + if (array_key_exists('params', $user) && $this->params->get('automatic_change', '1') == '1') + { + $registry = new Registry($user['params']); + $this->user_lang_code = $registry->get('language'); + + if (empty($this->user_lang_code)) + { + $this->user_lang_code = $this->current_lang; + } + } + } + + /** + * After store user method. + * + * Method is called after user data is stored in the database. + * + * @param array $user Holds the new user data. + * @param boolean $isnew True if a new user is stored. + * @param boolean $success True if user was succesfully stored in the database. + * @param string $msg Message. + * + * @return void + * + * @since 1.6 + */ + public function onUserAfterSave($user, $isnew, $success, $msg) + { + if ($success && array_key_exists('params', $user) && $this->params->get('automatic_change', '1') == '1') + { + $registry = new Registry($user['params']); + $lang_code = $registry->get('language'); + + if (empty($lang_code)) + { + $lang_code = $this->current_lang; + } + + if ($lang_code === $this->user_lang_code || !isset($this->lang_codes[$lang_code])) + { + if ($this->app->isClient('site')) + { + $this->app->setUserState('com_users.edit.profile.redirect', null); + } + } + else + { + if ($this->app->isClient('site')) + { + $this->app->setUserState('com_users.edit.profile.redirect', 'index.php?Itemid=' + . $this->app->getMenu()->getDefault($lang_code)->id . '&lang=' . $this->lang_codes[$lang_code]->sef + ); + + // Create a cookie. + $this->setLanguageCookie($lang_code); + } + } + } + } + + /** + * Method to handle any login logic and report back to the subject. + * + * @param array $user Holds the user data. + * @param array $options Array holding options (remember, autoregister, group). + * + * @return boolean True on success. + * + * @since 1.5 + */ + public function onUserLogin($user, $options = array()) + { + $menu = $this->app->getMenu(); + + if ($this->app->isClient('site')) + { + if ($this->params->get('automatic_change', 1)) + { + $assoc = JLanguageAssociations::isEnabled(); + $lang_code = $user['language']; + + // If no language is specified for this user, we set it to the site default language + if (empty($lang_code)) + { + $lang_code = $this->default_lang; + } + + jimport('joomla.filesystem.folder'); + + // The language has been deleted/disabled or the related content language does not exist/has been unpublished + // or the related home page does not exist/has been unpublished + if (!array_key_exists($lang_code, $this->lang_codes) + || !array_key_exists($lang_code, JLanguageMultilang::getSiteHomePages()) + || !JFolder::exists(JPATH_SITE . '/language/' . $lang_code)) + { + $lang_code = $this->current_lang; + } + + // Try to get association from the current active menu item + $active = $menu->getActive(); + + $foundAssociation = false; + + /** + * Looking for associations. + * If the login menu item form contains an internal URL redirection, + * This will override the automatic change to the user preferred site language. + * In that case we use the redirect as defined in the menu item. + * Otherwise we redirect, when available, to the user preferred site language. + */ + if ($active && !$active->params['login_redirect_url']) + { + if ($assoc) + { + $associations = MenusHelper::getAssociations($active->id); + } + + // Retrieves the Itemid from a login form. + $uri = new JUri($this->app->getUserState('users.login.form.return')); + + if ($uri->getVar('Itemid')) + { + // The login form contains a menu item redirection. Try to get associations from that menu item. + // If any association set to the user preferred site language, redirect to that page. + if ($assoc) + { + $associations = MenusHelper::getAssociations($uri->getVar('Itemid')); + } + + if (isset($associations[$lang_code]) && $menu->getItem($associations[$lang_code])) + { + $associationItemid = $associations[$lang_code]; + $this->app->setUserState('users.login.form.return', 'index.php?Itemid=' . $associationItemid); + $foundAssociation = true; + } + } + elseif (isset($associations[$lang_code]) && $menu->getItem($associations[$lang_code])) + { + /** + * The login form does not contain a menu item redirection. + * The active menu item has associations. + * We redirect to the user preferred site language associated page. + */ + $associationItemid = $associations[$lang_code]; + $this->app->setUserState('users.login.form.return', 'index.php?Itemid=' . $associationItemid); + $foundAssociation = true; + } + elseif ($active->home) + { + // We are on a Home page, we redirect to the user preferred site language Home page. + $item = $menu->getDefault($lang_code); + + if ($item && $item->language !== $active->language && $item->language !== '*') + { + $this->app->setUserState('users.login.form.return', 'index.php?Itemid=' . $item->id); + $foundAssociation = true; + } + } + } + + if ($foundAssociation && $lang_code !== $this->current_lang) + { + // Change language. + $this->current_lang = $lang_code; + + // Create a cookie. + $this->setLanguageCookie($lang_code); + + // Change the language code. + JFactory::getLanguage()->setLanguage($lang_code); + } + } + else + { + if ($this->app->getUserState('users.login.form.return')) + { + $this->app->setUserState('users.login.form.return', JRoute::_($this->app->getUserState('users.login.form.return'), false)); + } + } + } + } + + /** + * Method to add alternative meta tags for associated menu items. + * + * @return void + * + * @since 1.7 + */ + public function onAfterDispatch() + { + $doc = JFactory::getDocument(); + + if ($this->app->isClient('site') && $this->params->get('alternate_meta', 1) && $doc->getType() === 'html') + { + $languages = $this->lang_codes; + $homes = JLanguageMultilang::getSiteHomePages(); + $menu = $this->app->getMenu(); + $active = $menu->getActive(); + $levels = JFactory::getUser()->getAuthorisedViewLevels(); + $remove_default_prefix = $this->params->get('remove_default_prefix', 0); + $server = JUri::getInstance()->toString(array('scheme', 'host', 'port')); + $is_home = false; + $currentInternalUrl = 'index.php?' . http_build_query($this->app->getRouter()->getVars()); + + if ($active) + { + $active_link = JRoute::_($active->link . '&Itemid=' . $active->id); + $current_link = JRoute::_($currentInternalUrl); + + // Load menu associations + if ($active_link === $current_link) + { + $associations = MenusHelper::getAssociations($active->id); + } + + // Check if we are on the home page + $is_home = ($active->home + && ($active_link === $current_link || $active_link === $current_link . 'index.php' || $active_link . '/' === $current_link)); + } + + // Load component associations. + $option = $this->app->input->get('option'); + $cName = StringHelper::ucfirst(StringHelper::str_ireplace('com_', '', $option)) . 'HelperAssociation'; + JLoader::register($cName, JPath::clean(JPATH_COMPONENT_SITE . '/helpers/association.php')); + + if (class_exists($cName) && is_callable(array($cName, 'getAssociations'))) + { + $cassociations = call_user_func(array($cName, 'getAssociations')); + } + + // For each language... + foreach ($languages as $i => &$language) + { + switch (true) + { + // Language without frontend UI || Language without specific home menu || Language without authorized access level + case (!array_key_exists($i, JLanguageHelper::getInstalledLanguages(0))): + case (!isset($homes[$i])): + case (isset($language->access) && $language->access && !in_array($language->access, $levels)): + unset($languages[$i]); + break; + + // Home page + case ($is_home): + $language->link = JRoute::_('index.php?lang=' . $language->sef . '&Itemid=' . $homes[$i]->id); + break; + + // Current language link + case ($i === $this->current_lang): + $language->link = JRoute::_($currentInternalUrl); + break; + + // Component association + case (isset($cassociations[$i])): + $language->link = JRoute::_($cassociations[$i] . '&lang=' . $language->sef); + break; + + // Menu items association + // Heads up! "$item = $menu" here below is an assignment, *NOT* comparison + case (isset($associations[$i]) && ($item = $menu->getItem($associations[$i]))): + + $language->link = JRoute::_('index.php?Itemid=' . $item->id . '&lang=' . $language->sef); + break; + + // Too bad... + default: + unset($languages[$i]); + } + } + + // If there are at least 2 of them, add the rel="alternate" links to the + if (count($languages) > 1) + { + // Remove the sef from the default language if "Remove URL Language Code" is on + if ($remove_default_prefix && isset($languages[$this->default_lang])) + { + $languages[$this->default_lang]->link + = preg_replace('|/' . $languages[$this->default_lang]->sef . '/|', '/', $languages[$this->default_lang]->link, 1); + } + + foreach ($languages as $i => &$language) + { + $doc->addHeadLink($server . $language->link, 'alternate', 'rel', array('hreflang' => $i)); + } + + // Add x-default language tag + if ($this->params->get('xdefault', 1)) + { + $xdefault_language = $this->params->get('xdefault_language', $this->default_lang); + $xdefault_language = ($xdefault_language === 'default') ? $this->default_lang : $xdefault_language; + + if (isset($languages[$xdefault_language])) + { + // Use a custom tag because addHeadLink is limited to one URI per tag + $doc->addCustomTag(''); + } + } + } + } + } + + /** + * Set the language cookie + * + * @param string $languageCode The language code for which we want to set the cookie + * + * @return void + * + * @since 3.4.2 + */ + private function setLanguageCookie($languageCode) + { + // If is set to use language cookie for a year in plugin params, save the user language in a new cookie. + if ((int) $this->params->get('lang_cookie', 0) === 1) + { + // Create a cookie with one year lifetime. + $this->app->input->cookie->set( + JApplicationHelper::getHash('language'), + $languageCode, + time() + 365 * 86400, + $this->app->get('cookie_path', '/'), + $this->app->get('cookie_domain', ''), + $this->app->isHttpsForced(), + true + ); + } + // If not, set the user language in the session (that is already saved in a cookie). + else + { + JFactory::getSession()->set('plg_system_languagefilter.language', $languageCode); + } + } + + /** + * Get the language cookie + * + * @return string + * + * @since 3.4.2 + */ + private function getLanguageCookie() + { + // Is is set to use a year language cookie in plugin params, get the user language from the cookie. + if ((int) $this->params->get('lang_cookie', 0) === 1) + { + $languageCode = $this->app->input->cookie->get(JApplicationHelper::getHash('language')); + } + // Else get the user language from the session. + else + { + $languageCode = JFactory::getSession()->get('plg_system_languagefilter.language'); + } + + // Let's be sure we got a valid language code. Fallback to null. + if (!array_key_exists($languageCode, $this->lang_codes)) + { + $languageCode = null; + } + + return $languageCode; + } +} diff --git a/plugins/system/languagefilter/languagefilter.xml b/plugins/system/languagefilter/languagefilter.xml new file mode 100644 index 0000000..02c0564 --- /dev/null +++ b/plugins/system/languagefilter/languagefilter.xml @@ -0,0 +1,118 @@ + + + plg_system_languagefilter + Joomla! Project + July 2010 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_SYSTEM_LANGUAGEFILTER_XML_DESCRIPTION + + languagefilter.php + + + en-GB.plg_system_languagefilter.ini + en-GB.plg_system_languagefilter.sys.ini + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
\ No newline at end of file diff --git a/plugins/system/log/index.html b/plugins/system/log/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/log/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/log/log.php b/plugins/system/log/log.php new file mode 100644 index 0000000..58aa2c9 --- /dev/null +++ b/plugins/system/log/log.php @@ -0,0 +1,70 @@ +params->get('log_username', 0)) + { + $errorlog['comment'] = $response['error_message'] . ' ("' . $response['username'] . '")'; + } + else + { + $errorlog['comment'] = $response['error_message']; + } + break; + + default: + $errorlog['status'] = $response['type'] . ' UNKNOWN ERROR: '; + $errorlog['comment'] = $response['error_message']; + break; + } + + JLog::addLogger(array(), JLog::INFO); + + try + { + JLog::add($errorlog['comment'], JLog::INFO, $errorlog['status']); + } + catch (Exception $e) + { + // If the log file is unwriteable during login then we should not go to the error page + return; + } + } +} diff --git a/plugins/system/log/log.xml b/plugins/system/log/log.xml new file mode 100644 index 0000000..9e0b1e5 --- /dev/null +++ b/plugins/system/log/log.xml @@ -0,0 +1,36 @@ + + + plg_system_log + Joomla! Project + April 2007 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_LOG_XML_DESCRIPTION + + log.php + + + en-GB.plg_system_log.ini + en-GB.plg_system_log.sys.ini + + + +
+ + + + +
+
+
+
diff --git a/plugins/system/logout/index.html b/plugins/system/logout/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/logout/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/logout/logout.php b/plugins/system/logout/logout.php new file mode 100644 index 0000000..53486a8 --- /dev/null +++ b/plugins/system/logout/logout.php @@ -0,0 +1,121 @@ +app->isClient('site')) + { + return; + } + + $hash = JApplicationHelper::getHash('PlgSystemLogout'); + + if ($this->app->input->cookie->getString($hash)) + { + // Destroy the cookie. + $this->app->input->cookie->set($hash, '', 1, $this->app->get('cookie_path', '/'), $this->app->get('cookie_domain', '')); + + // Set the error handler for E_ALL to be the class handleError method. + JError::setErrorHandling(E_ALL, 'callback', array('PlgSystemLogout', 'handleError')); + } + } + + /** + * Method to handle any logout logic and report back to the subject. + * + * @param array $user Holds the user data. + * @param array $options Array holding options (client, ...). + * + * @return boolean Always returns true. + * + * @since 1.6 + */ + public function onUserLogout($user, $options = array()) + { + if ($this->app->isClient('site')) + { + // Create the cookie. + $this->app->input->cookie->set( + JApplicationHelper::getHash('PlgSystemLogout'), + true, + time() + 86400, + $this->app->get('cookie_path', '/'), + $this->app->get('cookie_domain', ''), + $this->app->isHttpsForced(), + true + ); + } + + return true; + } + + /** + * Method to handle an error condition. + * + * @param Exception &$error The Exception object to be handled. + * + * @return void + * + * @since 1.6 + */ + public static function handleError(&$error) + { + // Get the application object. + $app = JFactory::getApplication(); + + // Make sure the error is a 403 and we are in the frontend. + if ($error->getCode() == 403 && $app->isClient('site')) + { + // Redirect to the home page. + $app->enqueueMessage(JText::_('PLG_SYSTEM_LOGOUT_REDIRECT')); + $app->redirect('index.php'); + } + else + { + // Render the custom error page. + JError::customErrorPage($error); + } + } +} diff --git a/plugins/system/logout/logout.xml b/plugins/system/logout/logout.xml new file mode 100644 index 0000000..b41c991 --- /dev/null +++ b/plugins/system/logout/logout.xml @@ -0,0 +1,19 @@ + + + plg_system_logout + Joomla! Project + April 2009 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_SYSTEM_LOGOUT_XML_DESCRIPTION + + logout.php + + + en-GB.plg_system_logout.ini + en-GB.plg_system_logout.sys.ini + + diff --git a/plugins/system/p3p/index.html b/plugins/system/p3p/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/p3p/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/p3p/p3p.php b/plugins/system/p3p/p3p.php new file mode 100644 index 0000000..162ae00 --- /dev/null +++ b/plugins/system/p3p/p3p.php @@ -0,0 +1,43 @@ +params->get('header', 'NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'); + $header = trim($header); + + // Bail out on empty header (why would anyone do that?!). + if (empty($header)) + { + return; + } + + // Replace any existing P3P headers in the response. + JFactory::getApplication()->setHeader('P3P', 'CP="' . $header . '"', true); + } +} diff --git a/plugins/system/p3p/p3p.xml b/plugins/system/p3p/p3p.xml new file mode 100644 index 0000000..552bb94 --- /dev/null +++ b/plugins/system/p3p/p3p.xml @@ -0,0 +1,33 @@ + + + plg_system_p3p + Joomla! Project + September 2010 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_P3P_XML_DESCRIPTION + + p3p.php + + + en-GB.plg_system_p3p.ini + en-GB.plg_system_p3p.sys.ini + + + +
+ +
+
+
+
diff --git a/plugins/system/redirect/form/excludes.xml b/plugins/system/redirect/form/excludes.xml new file mode 100644 index 0000000..1e77e45 --- /dev/null +++ b/plugins/system/redirect/form/excludes.xml @@ -0,0 +1,18 @@ + +
+
+ + +
+
diff --git a/plugins/system/redirect/index.html b/plugins/system/redirect/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/redirect/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/redirect/redirect.php b/plugins/system/redirect/redirect.php new file mode 100644 index 0000000..7e32832 --- /dev/null +++ b/plugins/system/redirect/redirect.php @@ -0,0 +1,336 @@ +isClient('administrator') || ((int) $error->getCode() !== 404)) + { + // Proxy to the previous exception handler if available, otherwise just render the error page + if (self::$previousExceptionHandler) + { + call_user_func_array(self::$previousExceptionHandler, array($error)); + } + else + { + JErrorPage::render($error); + } + } + + $uri = JUri::getInstance(); + + // These are the original URLs + $orgurl = rawurldecode($uri->toString(array('scheme', 'host', 'port', 'path', 'query', 'fragment'))); + $orgurlRel = rawurldecode($uri->toString(array('path', 'query', 'fragment'))); + + // The above doesn't work for sub directories, so do this + $orgurlRootRel = str_replace(JUri::root(), '', $orgurl); + + // For when users have added / to the url + $orgurlRootRelSlash = str_replace(JUri::root(), '/', $orgurl); + $orgurlWithoutQuery = rawurldecode($uri->toString(array('scheme', 'host', 'port', 'path', 'fragment'))); + $orgurlRelWithoutQuery = rawurldecode($uri->toString(array('path', 'fragment'))); + + // These are the URLs we save and use + $url = StringHelper::strtolower(rawurldecode($uri->toString(array('scheme', 'host', 'port', 'path', 'query', 'fragment')))); + $urlRel = StringHelper::strtolower(rawurldecode($uri->toString(array('path', 'query', 'fragment')))); + + // The above doesn't work for sub directories, so do this + $urlRootRel = str_replace(JUri::root(), '', $url); + + // For when users have added / to the url + $urlRootRelSlash = str_replace(JUri::root(), '/', $url); + $urlWithoutQuery = StringHelper::strtolower(rawurldecode($uri->toString(array('scheme', 'host', 'port', 'path', 'fragment')))); + $urlRelWithoutQuery = StringHelper::strtolower(rawurldecode($uri->toString(array('path', 'fragment')))); + + $plugin = JPluginHelper::getPlugin('system', 'redirect'); + + $params = new Registry($plugin->params); + + $excludes = (array) $params->get('exclude_urls'); + + $skipUrl = false; + + foreach ($excludes as $exclude) + { + if (empty($exclude->term)) + { + continue; + } + + if (!empty($exclude->regexp)) + { + // Only check $url, because it includes all other sub urls + if (preg_match('/' . $exclude->term . '/i', $orgurlRel)) + { + $skipUrl = true; + break; + } + } + else + { + if (StringHelper::strpos($orgurlRel, $exclude->term)) + { + $skipUrl = true; + break; + } + } + } + + // Why is this (still) here? + if ($skipUrl || (strpos($url, 'mosConfig_') !== false) || (strpos($url, '=http://') !== false)) + { + JErrorPage::render($error); + } + + $db = JFactory::getDbo(); + + $query = $db->getQuery(true); + + $query->select('*') + ->from($db->quoteName('#__redirect_links')) + ->where( + '(' + . $db->quoteName('old_url') . ' = ' . $db->quote($url) + . ' OR ' + . $db->quoteName('old_url') . ' = ' . $db->quote($urlRel) + . ' OR ' + . $db->quoteName('old_url') . ' = ' . $db->quote($urlRootRel) + . ' OR ' + . $db->quoteName('old_url') . ' = ' . $db->quote($urlRootRelSlash) + . ' OR ' + . $db->quoteName('old_url') . ' = ' . $db->quote($urlWithoutQuery) + . ' OR ' + . $db->quoteName('old_url') . ' = ' . $db->quote($urlRelWithoutQuery) + . ' OR ' + . $db->quoteName('old_url') . ' = ' . $db->quote($orgurl) + . ' OR ' + . $db->quoteName('old_url') . ' = ' . $db->quote($orgurlRel) + . ' OR ' + . $db->quoteName('old_url') . ' = ' . $db->quote($orgurlRootRel) + . ' OR ' + . $db->quoteName('old_url') . ' = ' . $db->quote($orgurlRootRelSlash) + . ' OR ' + . $db->quoteName('old_url') . ' = ' . $db->quote($orgurlWithoutQuery) + . ' OR ' + . $db->quoteName('old_url') . ' = ' . $db->quote($orgurlRelWithoutQuery) + . ')' + ); + + $db->setQuery($query); + + $redirect = null; + + try + { + $redirects = $db->loadAssocList(); + } + catch (Exception $e) + { + JErrorPage::render(new Exception(JText::_('PLG_SYSTEM_REDIRECT_ERROR_UPDATING_DATABASE'), 500, $e)); + } + + $possibleMatches = array_unique( + array( + $url, + $urlRel, + $urlRootRel, + $urlRootRelSlash, + $urlWithoutQuery, + $urlRelWithoutQuery, + $orgurl, + $orgurlRel, + $orgurlRootRel, + $orgurlRootRelSlash, + $orgurlWithoutQuery, + $orgurlRelWithoutQuery, + ) + ); + + foreach ($possibleMatches as $match) + { + if (($index = array_search($match, array_column($redirects, 'old_url'))) !== false) + { + $redirect = (object) $redirects[$index]; + + if ((int) $redirect->published === 1) + { + break; + } + } + } + + // A redirect object was found and, if published, will be used + if ($redirect !== null && ((int) $redirect->published === 1)) + { + if (!$redirect->header || (bool) JComponentHelper::getParams('com_redirect')->get('mode', false) === false) + { + $redirect->header = 301; + } + + if ($redirect->header < 400 && $redirect->header >= 300) + { + $urlQuery = $uri->getQuery(); + + $oldUrlParts = parse_url($redirect->old_url); + + if ($urlQuery !== '' && empty($oldUrlParts['query'])) + { + $redirect->new_url .= '?' . $urlQuery; + } + + $dest = JUri::isInternal($redirect->new_url) || strpos($redirect->new_url, 'http') === false ? + JRoute::_($redirect->new_url) : $redirect->new_url; + + // In case the url contains double // lets remove it + $destination = str_replace(JUri::root() . '/', JUri::root(), $dest); + + $app->redirect($destination, (int) $redirect->header); + } + + JErrorPage::render(new RuntimeException($error->getMessage(), $redirect->header, $error)); + } + // No redirect object was found so we create an entry in the redirect table + elseif ($redirect === null) + { + $params = new Registry(JPluginHelper::getPlugin('system', 'redirect')->params); + + if ((bool) $params->get('collect_urls', true)) + { + $data = (object) array( + 'id' => 0, + 'old_url' => $url, + 'referer' => $app->input->server->getString('HTTP_REFERER', ''), + 'hits' => 1, + 'published' => 0, + 'created_date' => JFactory::getDate()->toSql() + ); + + try + { + $db->insertObject('#__redirect_links', $data, 'id'); + } + catch (Exception $e) + { + JErrorPage::render(new Exception(JText::_('PLG_SYSTEM_REDIRECT_ERROR_UPDATING_DATABASE'), 500, $e)); + } + } + } + // We have an unpublished redirect object, increment the hit counter + else + { + $redirect->hits++; + + try + { + $db->updateObject('#__redirect_links', $redirect, 'id'); + } + catch (Exception $e) + { + JErrorPage::render(new Exception(JText::_('PLG_SYSTEM_REDIRECT_ERROR_UPDATING_DATABASE'), 500, $e)); + } + } + + JErrorPage::render($error); + } +} diff --git a/plugins/system/redirect/redirect.xml b/plugins/system/redirect/redirect.xml new file mode 100644 index 0000000..7bfa8ec --- /dev/null +++ b/plugins/system/redirect/redirect.xml @@ -0,0 +1,45 @@ + + + plg_system_redirect + Joomla! Project + April 2009 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_SYSTEM_REDIRECT_XML_DESCRIPTION + + form + redirect.php + + + en-GB.plg_system_redirect.ini + en-GB.plg_system_redirect.sys.ini + + + +
+ + + + + +
+
+
+
diff --git a/plugins/system/redj/fields/index.html b/plugins/system/redj/fields/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/redj/fields/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/redj/fields/page404.php b/plugins/system/redj/fields/page404.php new file mode 100644 index 0000000..c4334af --- /dev/null +++ b/plugins/system/redj/fields/page404.php @@ -0,0 +1,41 @@ +id . '" name="' . $this->name . '">'; + $return .= ''; + $db = JFactory::getDbo(); + $db->setQuery("SELECT `id`, `title`, `language` FROM #__redj_pages404"); + $pages = $db->loadAssocList(); + if (is_array($pages)) { + foreach ($pages as $page) + { + $isselected = ($this->value == $page['id']) ? 'selected="selected"' : ''; + $return .= ''; + } + } + $return .= ''; + return $return; + } +} \ No newline at end of file diff --git a/plugins/system/redj/index.html b/plugins/system/redj/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/redj/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/redj/redj.php b/plugins/system/redj/redj.php new file mode 100644 index 0000000..0dd359e --- /dev/null +++ b/plugins/system/redj/redj.php @@ -0,0 +1,1415 @@ +loadLanguage(); + + $this->_visited_request_uri = self::getRequestURI(); + $this->_visited_full_url = self::getPrefix() . $this->_visited_request_uri; // Better then self::getURL(); or self::getPrefix() . self::getRequestURI(); + $this->_siteurl = self::getSiteURL(); + $this->_baseonly = self::getBase(true); + $this->_self = self::getSelf(); + $this->staticParams('request_uri', $this->_visited_request_uri); + } + + /** + * + * Build and return the (called) prefix (e.g. http://www.youdomain.com) from the current server variables + * + * We say 'called' 'cause we use HTTP_HOST (taken from client header) and not SERVER_NAME (taken from server config) + * + */ + private static function getPrefix() + { + if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')) { + $https = 's://'; + } else { + $https = '://'; + } + return 'http' . $https . $_SERVER['HTTP_HOST']; + } + + /** + * + * Build and return the (called) base path for site (e.g. http://www.youdomain.com/path/to/site) + * + * @param boolean If true returns only the path part (e.g. /path/to/site) + * + */ + private static function getBase($pathonly = false) + { + if ( (strpos(php_sapi_name(), 'cgi') !== false) && (!ini_get('cgi.fix_pathinfo')) && (strlen($_SERVER['REQUEST_URI']) > 0) ) { + // PHP-CGI on Apache with "cgi.fix_pathinfo = 0" + + // We use PHP_SELF + if (@strlen(trim($_SERVER['PATH_INFO'])) > 0) { + $p = strrpos($_SERVER['PHP_SELF'], $_SERVER['PATH_INFO']); + if ($p !== false) { $s = substr($_SERVER['PHP_SELF'], 0, $p); } + } else { + $p = $_SERVER['PHP_SELF']; + } + $base_path = trim(rtrim(dirname(str_replace(array('"', '<', '>', "'"), '', $p)), '/\\')); + // Check if base path was correctly detected, or use another method + /* + On some Apache servers (mainly using cgi-fcgi) it happens that the base path is not correctly detected. + For URLs like http://www.site.com/index.php/content/view/123/5 the server returns a wrong PHP_SELF variable. + + WRONG: + [REQUEST_URI] => /index.php/content/view/123/5 + [PHP_SELF] => /content/view/123/5 + + CORRECT: + [REQUEST_URI] => /index.php/content/view/123/5 + [PHP_SELF] => /index.php/content/view/123/5 + + And this lead to a wrong result for JUri::base function. + + WRONG: + JUri::base(true) => /content/view/123 + JUri::base(false) => http://www.site.com/content/view/123/ + + CORRECT: + getBase(true) => + getBase(false):http://www.site.com/ + */ + if (strlen($base_path) > 0) { + if (strpos($_SERVER['REQUEST_URI'], $base_path) !== 0) { + $base_path = trim(rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\')); + } + } + } else { + // We use SCRIPT_NAME + $base_path = trim(rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\')); + } + + return $pathonly === false ? self::getPrefix() . $base_path . '/' : $base_path; + } + + /** + * + * Build and return the REQUEST_URI (e.g. /site/index.php?id=1&page=3) + * + */ + private static function getRequestURI($redirect_mode = 0) + { + if ( ($redirect_mode === 1) && ( (isset($_SERVER['REDIRECT_URL'])) || (isset($_SERVER['HTTP_X_REWRITE_URL'])) ) ) { + $uri = (isset($_SERVER['HTTP_X_REWRITE_URL'])) ? $_SERVER['HTTP_X_REWRITE_URL'] : $_SERVER['REDIRECT_URL']; + } else { + $uri = $_SERVER['REQUEST_URI']; + } + return $uri; + } + + /** + * + * Build and return the (called) {siteurl} macro value + * + */ + private static function getSiteURL() + { + $siteurl = str_replace( 'https://', '', self::getBase() ); + return rtrim(str_replace('http://', '', $siteurl), '/'); + } + + /** + * + * Build and return the (called) full URL (e.g. http://www.youdomain.com/site/index.php?id=12) from the current server variables + * + */ + private static function getURL($redirect_mode = 0) + { + return self::getPrefix() . self::getRequestURI($redirect_mode); + } + + /** + * + * Return the host name from the given address + * + * Reference http://www.php.net/manual/en/function.parse-url.php#93983 + * + */ + private static function getHost($address) + { + $parsedUrl = parse_url(trim($address)); + return @trim($parsedUrl['host'] ? $parsedUrl['host'] : array_shift(explode('/', $parsedUrl['path'], 2))); + } + + /** + * + * Build and return the (called) {self} macro value + * + */ + private static function getSelf() + { + return $_SERVER['HTTP_HOST']; + } + + /** + * + * Store and return static params + * + */ + static function staticParams($name, $value = NULL) + { + static $params = array(); + + if (isset($name)) + { + if (isset($value)) + { + $params[$name] = $value; + } else { + if (array_key_exists($name, $params)) + { + return $params[$name]; + } + } + } + return NULL; + } + + /** + * + * Rebuild an URL from the parsed array + * + * @param array $parsed_url Array of URL parts + * + * @return string The result URL + * + */ + private static function unparse_url($parsed_url) + { + $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : ''; + $host = isset($parsed_url['host']) ? $parsed_url['host'] : ''; + $port = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : ''; + $user = isset($parsed_url['user']) ? $parsed_url['user'] : ''; + $pass = isset($parsed_url['pass']) ? ':' . $parsed_url['pass'] : ''; + $pass = ($user || $pass) ? "$pass@" : ''; + $path = isset($parsed_url['path']) ? $parsed_url['path'] : ''; + $query = isset($parsed_url['query']) ? '?' . $parsed_url['query'] : ''; + $fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : ''; + return "$scheme$user$pass$host$port$path$query$fragment"; + } + + /** + * + * Remove specified vars from URL query + * + * @param string $url The URL + * @param array $vars List of variables to drop + * + * @return string The result URL + * + */ + private static function drop_query_vars($url, $vars) + { + $parsed = parse_url($url); + if (isset($parsed['query'])) + { + parse_str($parsed['query'], $query_vars); + $query_vars = array_diff_key($query_vars, $vars); + $parsed['query'] = http_build_query($query_vars, '', '&'); + if (strlen($parsed['query']) == 0) { unset($parsed['query']);} + return self::unparse_url($parsed); + } + return $url; + } + + /** + * + * Return the routed (relative) URL + * + * @param string $url Visited full URL + * @param array $vars List of variables to use (if empty use all current variables) + * + * @return string The routed (relative) URL + * + */ + private static function route_url($url, $vars) + { + static $routed_urls = array(); + + $checksum = @md5(json_encode($vars)); + if (isset($routed_urls[$url][$checksum])) + { + return $routed_urls[$url][$checksum]; + } + + JUri::reset(); + $uri_visited_full_url = JUri::getInstance($url); + $router = JSite::getRouter(); + $parsed = $router->parse($uri_visited_full_url); + $suffix = isset($parsed['format']) ? $parsed['format'] : ''; + $drop_vars = array(); + if (@count($vars)) // True if $vars is an array and with at least one element + { + // First drop unwanted vars + foreach ($vars as $k => $v) + { + if (preg_match('/^!(.*)/', $k, $m) === 1) + { + $drop_vars[$m[1]] = $v; + if (isset($parsed[$m[1]])) { unset($parsed[$m[1]]); } + unset($vars[$k]); + } + } + if (@count($vars)) // True if there is still at least one element + { + foreach ($vars as $k => $v) + { + if ($v === null) + { + if (isset($parsed[$k])) + { + $vars[$k] = $parsed[$k]; + } else { + unset($vars[$k]); + } + } + } + $p = $vars; + } else { + $p = $parsed; + } + } else { + // Variables to use/not use are not specified + foreach ($parsed as $k => $v) + { + if ($v === null) + { + unset($parsed[$k]); + } + } + $p = $parsed; + } + // Now $p contains the variable to use for routing + if (isset($p['option'])) + { + // For components search for a menu item + $q = $p; + unset($q['Itemid']); + unset($q['format']); + foreach ($q as $k => $v) + { + // Remove the slug part if present + $parts = explode(":", $v); + $q[$k] = $parts[0]; + } + // Build the URL to route + $link = 'index.php'; + foreach ($q as $k => $v) + { + $link .= (($link === 'index.php') ? '?' : '&') . $k . '=' . $v; + } + $routed_link = JRoute::_($link, false); + $app = JFactory::getApplication(); + $menu = $app->getMenu(); + $items = $menu->getItems('component', $q['option']); + $found = false; + $menu_route = ''; + foreach ($items as $k => $v) + { + $current_link = (JRoute::_($v->link, false)); + if ($current_link == $routed_link) + { + $found = true; + $menu_route = $v->route; + break; + } + } + if ($found) + { + $sef_prefix = ($app->getCfg('sef_rewrite')) ? '' : 'index.php/'; + $routed = '/' . $sef_prefix . trim($menu_route, '/') . ((strlen($suffix) > 0) ? '.' . $suffix : ''); + $routed_urls[$url][$checksum] = $routed; + return $routed; + } + } + // Build the URL to route + $build = 'index.php'; + foreach ($p as $pk => $pv) + { + $build .= (($build === 'index.php') ? '?' : '&') . $pk . '=' . $pv; + } + $routed = self::drop_query_vars(JRoute::_($build, false), $drop_vars); + $routed_urls[$url][$checksum] = $routed; + return $routed; + } + + /** + * + * Alternative to mb_substr (used when this is not available) + * + * @param string The input string + * @param integer The starting index + * @param integer The lenght + * + * @return string The UTF-8 substring + * + */ + private static function substru($str, $from, $len){ + return preg_replace('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'. $from .'}'.'((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'. $len .'}).*#s','$1', $str); + } + + /** + * + * Truncate the URL if its lenght exceed the max number of characters (UTF-8) in the varchar definition + * + * @param string The URL to sanitize + * + */ + private static function sanitizeURL($url) + { + if (function_exists('mb_substr')) + { + return mb_substr($url, 0, VARCHAR_SIZE, 'UTF-8'); + } else { + return self::substru($url, 0, VARCHAR_SIZE); + } + } + + /** + * + * Replace macros in the body content of the custom error 404 page + * + */ + private static function replace404Macro($body, $errormessage) + { + // Define supported macros + $app = JFactory::getApplication(); + $siteurl = self::getSiteURL(); + $sitename = $app->getCfg('sitename'); + $sitemail = $app->getCfg('mailfrom'); + $fromname = $app->getCfg('fromname'); + + // Replace macros with their values + $body = str_replace('{siteurl}', $siteurl, $body); + $body = str_replace('{sitename}', $sitename, $body); + $body = str_replace('{sitemail}', $sitemail, $body); + $body = str_replace('{fromname}', $fromname, $body); + $body = str_replace('{errormessage}', $errormessage, $body); + + // Also replace {article} macro + $regex_base = '\{(article)\s+(\d+)\}'; + $regex_search = "/(.*?)$regex_base(.*)/si"; + $regex_replace = "/$regex_base/si"; + $found = preg_match($regex_search, $body, $matches); + while ($found) { + $content_id = $matches[3]; + $content_query = "SELECT `introtext`, `fulltext` FROM #__content WHERE `id`=".(int)$content_id; + $content_db = JFactory::getDbo(); + $content_db->setQuery($content_query); + $content_row = $content_db->loadObject(); + if (is_object($content_row)) { + $content = $content_row->introtext . $content_row->fulltext; + } else { + $content = ''; + } + $body = preg_replace($regex_replace, $content, $body); // Replace all occurrences + $found = preg_match($regex_search, $custombody, $matches); + } + + return $body; + } + + /** + * + * Manage any kind of error condition + * + * @param string $error_code The error code + * + */ + static function manageError(Exception $error) + { + // Get plugin parameters + $plugin = JPluginHelper::getPlugin('system', 'redj'); // Can't use $this as callback function + $params = new JRegistry($plugin->params); + $customerror404page = $params->get('customerror404page', 0); + $error404page = $params->get('error404page', ''); + $trackerrors = $params->get('trackerrors', 0); + $redirecterrors = $params->get('redirecterrors', 0); + $redirectallerrors = $params->get('redirectallerrors', 0); + $redirectallerrorsurl = $params->get('redirectallerrorsurl', ''); + $shortcutextensions = $params->get('shortcutextensions', ''); + + // Get error code and error message + $error_code = $error->getCode(); + $error_message = $error->getMessage(); + + $db = JFactory::getDbo(); + + if ($trackerrors) + { + // Track error URL calls + $visited_url = self::getURL(); + $last_visit = date("Y-m-d H:i:s"); + $last_referer = @$_SERVER['HTTP_REFERER']; + $db->setQuery("INSERT INTO #__redj_errors (`visited_url`, `error_code`, `redirect_url`, `hits`, `last_visit`, `last_referer`) VALUES (" . $db->quote( $visited_url ) . ", " . $db->quote( $error_code ) . ", '', 1, " . $db->quote( $last_visit ) . ", " . $db->quote( $last_referer ) . ") ON DUPLICATE KEY UPDATE `hits` = `hits` + 1, `last_visit` = " . $db->quote( $last_visit ) . ", `last_referer` = " . $db->quote( $last_referer )); + $res = @$db->query(); + } + + if ($redirecterrors) + { + $db->setQuery("SELECT `redirect_url` FROM #__redj_errors WHERE `visited_url` = " . $db->quote( $visited_url )); + $redirect_url = $db->loadResult(); + if (strlen($redirect_url) > 0) + { + @ob_end_clean(); + header("HTTP/1.1 301 Moved Permanently"); + header('Location: ' . $redirect_url); + exit(); + } + } + + if ( ($redirectallerrors) && (!empty($redirectallerrorsurl)) ) + { + $siteurl = self::getSiteURL(); + $tourl = str_replace('{siteurl}', $siteurl, $redirectallerrorsurl); + @ob_end_clean(); + header("HTTP/1.1 301 Moved Permanently"); + header('Location: ' . $tourl); + exit(); + } + + $custom_error = false; + $db->setQuery("SELECT * FROM #__redj_pages404 WHERE id=" . $db->quote( $error404page )); + $items = $db->loadObjectList(); + + if (($error_code == 404) && ($customerror404page) && (count($items) > 0) && (!empty($items[0]->page))) // Use custom error page + { + // Update hits + $last_visit = date("Y-m-d H:i:s"); + $db->setQuery("UPDATE #__redj_pages404 SET hits = hits + 1, last_visit = " . $db->quote( $last_visit ) . " WHERE id = " . $db->quote( $error404page )); + $res = @$db->query(); + $custom_error = true; + } + + if (($error_code == 404) || ($error_code == 500)) + { + $request_parts = explode('?', basename(self::staticParams('request_uri'))); + $extension = pathinfo($request_parts[0], PATHINFO_EXTENSION); + $shortexts = array_map("trim", explode(',', trim($shortcutextensions))); + if (array_search($extension, $shortexts) !== false) + { + if ($customerror404page) + { + if ((count($items) > 0) && (!empty($items[0]->page))) + { + // Use custom error page + $custom_error = true; + } else { + // No custom error page set + header("HTTP/1.0 404 Not Found"); + echo "

404 Not Found

"; + echo "The page that you have requested could not be found."; + exit(); + } + } + } + } + + if ($custom_error) + { + // Initialize variables + jimport('joomla.document.document'); + $app = JFactory::getApplication(); + $document = JDocument::getInstance('error'); + $config = JFactory::getConfig(); + + // Get the current template from the application + $template = $app->getTemplate(); + + // Push the error object into the document + $document->setError($error); + + // Call default render to set header + @ob_end_clean(); + $document->setTitle(JText::_('Error').': '.$error_code); + $data = $document->render(false, array ( + 'template' => $template, + 'directory' => JPATH_THEMES, + 'debug' => $config->get('debug') + )); + + // Replace macros in custom body + $custombody = self::replace404Macro($items[0]->page, $error_message); + + // Do not allow cache + JResponse::allowCache(false); + + // Set the custom body + JResponse::setBody($custombody); + echo JResponse::toString(); + @ob_flush(); + exit(); + } + + } + + /** + * + * Custom error callback function + * + */ + static function customError(&$error) + { + // This is a static method so could be called as a callback function (plgSystemReDJ::custom_error()) + // and no $this reference to object instance can be used + + // Get the application object. + $app = JFactory::getApplication(); + + // Make sure we are not in the administrator + if (!$app->isAdmin() and (JError::isError($error) === true)) + { + $e = new Exception($error->get('message'), $error->get('code')); + plgSystemReDJ::manageError($e); + } + + // Restore saved error handler + JError::setErrorHandling(E_ERROR, $GLOBALS["_REDJ_JERROR_HANDLER"]["mode"], array($GLOBALS["_REDJ_JERROR_HANDLER"]["options"]["0"], $GLOBALS["_REDJ_JERROR_HANDLER"]["options"]["1"])); + + // Re-raise original error... cannot be done anymore inside the callback to avoid failure due to loop detection + // JError::raise($error->get('level'), $error->get('code'), $error->get('message'), $error->get('info'), $error->get('backtrace')); + // So let's do what the raise do... + jimport('joomla.error.exception'); + // Build error object + $exception = new JException($error->get('message'), $error->get('code'), $error->get('level'), $error->get('info'), $error->get('backtrace')); + // See what to do with this kind of error + $handler = JError::getErrorHandling($exception->get('level')); + $function = 'handle'.ucfirst($handler['mode']); + if (is_callable(array('JError', $function))) { + $reference = call_user_func_array(array('JError', $function), array(&$exception, (isset($handler['options'])) ? $handler['options'] : array())); + } + else { + // This is required to prevent a very unhelpful white-screen-of-death + jexit( + 'JError::raise -> Static method JError::' . $function . ' does not exist.' . + ' Contact a developer to debug' . + '
Error was ' . + '
' . $exception->getMessage() + ); + } + + } + + /** + * + * Custom exception callback function + * + */ + static function customException(Exception $error) + { + // This is a static method so could be called as a callback function (plgSystemReDJ::custom_exception()) + // and no $this reference to object instance can be used + + // Get the application object. + $app = JFactory::getApplication(); + + // Make sure we are not in the administrator + if (!$app->isAdmin()) + { + plgSystemReDJ::manageError($error); + } + + // Call saved exception handler + if (is_callable($GLOBALS["_REDJ_EXCEPTION_HANDLER"])) + { + call_user_func($GLOBALS["_REDJ_EXCEPTION_HANDLER"], $error); + } + } + + /** + * + * Manage params for supported macros (e.g. used as callback function to replace macros with parameters) + * + * $macro[0] contains the complete match (when used with preg_replace_callback) + * $macro[1] contains the 'action' + * $macro[2] ... $macro[N] contain the additional params + * + */ + private static function manageMacroParams($macro) + { + static $siteurl = ''; // The (called) {siteurl} (e.g. www.youdomain.com/site) from the current server variables + static $url = ''; // The (called) full URL (e.g. http://www.youdomain.com/site/index.php?id=12) from the current server variables + static $urlparts = array(); // Array of JUri parts for the (called) full URL + static $urlvars = array(); // Array of all query variables (e.g. array([task] => view, [id] => 32) ) + static $urlpaths = array(); // Array of paths (e.g. array([baseonly] => /path/to/Joomla, [path] => /path/to/Joomla/section/cat/index.php, [pathfrombase] => /section/cat/index.php) ) + static $globalinfo = array(); // Array of global info + static $placeholders = array(); // Array of evaluated placeholders + + $macro = (array)$macro; + if (!isset($macro[1])) return ''; + if (!isset($macro[2])) $macro[2] = ''; + + $value = ''; + switch ($macro[1]) + { + // set methods + case 'setsiteurl': + $siteurl = $macro[2]; + break; + case 'seturl': + $url = $macro[2]; + break; + case 'seturlparts': + $urlparts = $macro[2]; + break; + case 'seturlvars': + $urlvars = $macro[2]; + break; + case 'seturlpaths': + $urlpaths = $macro[2]; + break; + case 'setglobalinfo': + $globalinfo = $macro[2]; + break; + case 'setplaceholder': + // $macro[2] = placeholder name + // $macro[3] = placeholder value + if (isset($macro[2])) + { + if (isset($macro[3])) + { + $placeholders[$macro[2]] = $macro[3]; + } else { + unset($placeholders[$macro[2]]); + } + } + break; + // get methods + case 'getsiteurl': + $value = $siteurl; + break; + case 'geturl': + $value = $url; + break; + case 'geturlparts': + $value = $urlparts; + break; + case 'geturlvars': + $value = $urlvars; + break; + case 'geturlpaths': + $value = $urlpaths; + break; + case 'getglobalinfo': + $value = $globalinfo; + break; + case 'getplaceholder': + // $macro[2] = placeholder name + if (isset($placeholders[$macro[2]])) $value = $placeholders[$macro[2]]; + break; + // macro methods + case 'querybuild': + case 'querybuildfull': + case 'querybuildappend': + $build_vars = explode(',', $macro[2]); + foreach ($build_vars as $k => $v) + { + $p = strpos($v, "="); + if ($p === false) + { + // Only parameter name + if (isset($urlvars[$v])) // Need to check only not-null values + { + $value .= (($value === '') ? '' : '&') . $v . '=' . $urlvars[$v]; + } + } else { + // New parameter or overrides existing + $pn = substr($v, 0, $p); + $pv = substr($v, $p + 1, strlen($v) - $p - 1); + if ((strlen($pn) > 0) && (strlen($pv) > 0)) // Need to take only not-null names and values + { + $value .= (($value === '') ? '' : '&') . $pn . '=' . $pv; + } + } + } + if (strlen($value) > 0) + { + if ($macro[1] === 'querybuildfull') { $value = '?' . $value; } + if ($macro[1] === 'querybuildappend') { $value = '&' . $value; } + } + break; + case 'queryvar': + // $macro[2] = variable name + // $macro[3] = default value if variable is not set (optional) + if (array_key_exists($macro[2], $urlvars)) { + $value = $urlvars[$macro[2]]; + } else { + if (isset($macro[3])) $value = $macro[3]; + } + break; + case 'requestvar': + // $macro[2] = variable name + // $macro[3] = default value if variable is not set (optional) + if (isset($macro[3])) + { + $value = JFactory::getApplication()->input->get($macro[2], $macro[3], 'RAW'); + } else { + $value = JFactory::getApplication()->input->get($macro[2], null, 'RAW'); + } + break; + case 'pathltrim': + $value = $urlpaths['path']; + if (strpos($value, $macro[2]) === 0) + { + $value = substr($value, strlen($macro[2]), strlen($value) - strlen($macro[2])); + } + break; + case 'pathrtrim': + $value = $urlpaths['path']; + if (strpos($value, $macro[2]) === (strlen($value) - strlen($macro[2]))) + { + $value = substr($value, 0, strlen($value) - strlen($macro[2])); + } + break; + case 'routeurl': + $vars = array(); + if (isset($macro[2])) + { + $build_vars = explode(',', $macro[2]); + foreach ($build_vars as $k => $v) + { + $p = strpos($v, "="); + if ($p === false) + { + // Only parameter name + $vars[$v] = null; + } else { + // New parameter or overrides existing + $pn = substr($v, 0, $p); + $pv = substr($v, $p + 1, strlen($v) - $p - 1); + if ((strlen($pn) > 0) && (strlen($pv) > 0)) // Need to take only not-null names and values + { + $vars[$pn] = $pv; + } + } + } + } + $value = self::route_url($url, $vars); + break; + case 'username': + $user = JFactory::getUser(); + $value = ($user->get('guest') == 1) ? $macro[2] : $user->get('username'); + break; + case 'userid': + $user = JFactory::getUser(); + $value = ($user->get('guest') == 1) ? $macro[2] : $user->get('id'); + break; + case 'tableselect': + // $macro[2] = table,column,key + // $macro[3] = value + // table: table name to query (support #__ notation) + // column: field name to return + // key: field name to use as selector in where condition + // value: value to use for comparison in the where condition (WHERE key = value) + $arg = explode(",", trim($macro[2])); + if (count($arg) == 3) + { + $arg = array_map("trim", $arg); + $value = $macro[3]; + if ($value != '') + { + // Perform a DB query + $db = JFactory::getDbo(); + $db->setQuery("SELECT `" . $arg[1] . "` FROM `" . $arg[0] . "` WHERE `" . $arg[2] . "`=" . $db->quote($value)); + $result = $db->loadResult(); + if (isset($result)) { $value = $result; } + } + } + break; + case 'substr': + // $macro[2] = start,length + // $macro[3] = input string + // start: start index for the portion string (0 based) + // length: lenght of the portion string + if (isset($macro[3])) + { + $value = $macro[3]; + $arg = array_map("trim", explode(",", $macro[2])); + $cnt_arg = count($arg); + if (($cnt_arg == 1) || ($cnt_arg == 2)) + { + $value = ($cnt_arg == 1) ? substr($value, (int)$arg[0]) : substr($value, (int)$arg[0], (int)$arg[1]); + } + } + break; + case 'strip_tags': + $value = strip_tags($macro[2]); + break; + case 'extract': + $rows = preg_split("/[\r\n]+/iU" , $macro[3]); + $index = (int)$macro[2] - 1; + if (isset($rows[$index])) { $value = strip_tags($rows[$index]); } + break; + case 'extractp': + preg_match_all("/

(.*)<\/p>/iU" , $macro[3], $rows); + $index = (int)$macro[2] - 1; + if (isset($rows[1][$index])) { $value = strip_tags($rows[1][$index]); } + break; + case 'extractdiv': + preg_match_all("/

(.*)<\/div>/iU" , $macro[3], $rows); + $index = (int)$macro[2] - 1; + if (isset($rows[1][$index])) { $value = strip_tags($rows[1][$index]); } + break; + case 'preg_placeholder': + // $macro[2] = N,placeholder + // $macro[3] = pattern + // N: regexp pattern to return + // placeholder: placeholder name + preg_match("/^([^\,]+)\,(.*)$/iU", trim($macro[2]), $arg); + if (count($arg) == 3) + { + $arg[1] = (int)$arg[1]; // Default to 0 if not numeric + $arg[2] = trim($arg[2]); + if (isset($placeholders[$arg[2]])) + { + if (@preg_match($macro[3], $placeholders[$arg[2]], $matches) !== false) + { + if (array_key_exists($arg[1], $matches)) { $value = $matches[$arg[1]]; } + } + } + } + break; + case 'lowercase': + $value = strtolower($macro[2]); + break; + case 'uppercase': + $value = strtoupper($macro[2]); + break; + case 'urldecode': + $value = urldecode($macro[2]); + break; + case 'urlencode': + $value = urlencode($macro[2]); + break; + case 'rawurldecode': + $value = rawurldecode($macro[2]); + break; + case 'rawurlencode': + $value = rawurlencode($macro[2]); + break; + case 'str_replace': + // $macro[2] = 'search','replace' + // $macro[3] = input string + if (isset($macro[3])) + { + $value = $macro[3]; + $r = preg_match("/^'(.*)','(.*)'$/suU", $macro[2], $arg); + if ($r == 1) + { + $value = str_replace($arg[1], $arg[2], $value); + } + } + break; + } + return $value; + } + + /** + * + * Replace supported macros from the content provided + * + */ + private static function replaceMacros($content) + { + /* + http://fredbloggs:itsasecret@www.example.com:8080/path/to/Joomla/section/cat/index.php?task=view&id=32#anchorthis + \__/ \________/ \________/ \_____________/ \__/\___________________________________/ \_____________/ \________/ + | | | | | | | | + scheme user pass host port path query fragment + + Supported URL macros: + {siteurl} www.example.com/path/to/Joomla + {scheme} http + {host} www.example.com + {port} 8080 + {user} fredbloggs + {pass} itsasecret + {path} /path/to/Joomla/section/cat/index.php + {query} task=view&id=32 + {queryfull} ?task=view&id=32 + {queryappend} &task=view&id=32 + {querybuild id,task} id=32&task=view + {querybuild id,task=edit} id=32&task=edit + {querybuild id,task=view,ItemId=12} id=32&task=view&ItemId=12 + {querybuildfull id,task} ?id=32&task=view + {querybuildfull id,task=save} ?id=32&task=save + {querybuildfull id,task,action=close} ?id=32&task=view&action=close + {querybuildappend id,task} &id=32&task=view + {querybuildappend id,task=save} &id=32&task=save + {querybuildappend id,task,action=close} &id=32&task=view&action=close + {querydrop task} id=32 + {querydrop id,task=edit} task=edit + {querydrop id,task=save,action=close} task=save&action=close + {querydropfull task} ?id=32 + {querydropfull id,task=save} ?task=save + {querydropfull id,task=edit,action=close} ?task=edit&action=close + {querydropappend task} &id=32 + {querydropappend id,task=save} &task=save + {querydropappend id,task=edit,action=close} &task=edit&action=close + {queryvar varname,default} Returns the current value for the variable 'varname' of the URL, or the value 'default' if 'varname' is not defined (where default = '' when not specified) + {queryvar task} view + {queryvar id} 32 + {queryvar maxsize,234} 234 + {requestvar varname,default} Returns the current value for the variable 'varname' of the request, no matter about method (GET, POST, ...), or the value 'default' if 'varname' is not defined (where default = '' when not specified) + {requestvar id} 32 + {requestvar limit,100} 100 + {authority} fredbloggs:itsasecret@www.example.com:8080 + {baseonly} /path/to/Joomla (empty when installed on root, i.e. it will never contains a trailing slash) + {pathfrombase} /section/cat/index.php + {pathltrim /path/to} /Joomla/section/cat/index.php + {pathrtrim /index.php} /path/to/Joomla/section/cat + {pathfrombaseltrim /section} /cat/index.php + {pathfrombasertrim index.php} /section/cat/ + {preg_match N}pattern{/preg_match} (return the N-th matched pattern on the full source url, where N = 0 when not specified) + {preg_match}/([^\/]+)(\.php|\.html|\.htm)/i{/preg_match} index.php + {preg_match 2}/([^\/]+)(\.php|\.html|\.htm)/i{/preg_match} .php + {preg_select table,column,key,N}pattern{/preg_select} (uses the N-th matched result to execute a SQL query (SELECT column FROM table WHERE key = matchN). Support #__ notation for table name) + {routeurl} Returns the routed (relative) URL using all current variables + {routeurl var1,var2,var3=myvalue,..,varN} Returns the routed (relative) URL for specified variables (index.php?var1=value1&var2=value2&var3=myvalue&..&varN=valueN) + {pathfolder N} Returns the N-th folder of the URL path (e.g. with /path/to/Joomla/section/cat/index.php N=4 returns section) + {pathfolder last-N} Returns the (last-N)-th folder of the URL path, where N = 0 when not specified (e.g. with /path/to/Joomla/section/cat/index.php last-1 returns cat) + */ + + static $patterns; + static $replacements; + static $patterns_callback; + + if (!isset($patterns)) { + // Supported static macros patterns + $patterns = array(); + // URL macros + $patterns[0] = "/\{siteurl\}/"; + $patterns[1] = "/\{scheme\}/"; + $patterns[2] = "/\{host\}/"; + $patterns[3] = "/\{port\}/"; + $patterns[4] = "/\{user\}/"; + $patterns[5] = "/\{pass\}/"; + $patterns[6] = "/\{path\}/"; + $patterns[7] = "/\{query\}/"; + $patterns[8] = "/\{queryfull\}/"; + $patterns[9] = "/\{queryappend\}/"; + $patterns[10] = "/\{authority\}/"; + $patterns[11] = "/\{baseonly\}/"; + $patterns[12] = "/\{pathfrombase\}/"; + // Site macros + $patterns[13] = "/\{sitename\}/"; + $patterns[14] = "/\{globaldescription\}/"; + $patterns[15] = "/\{globalkeywords\}/"; + } + + if (!isset($replacements)) + { + // Get data needed for macros replacements + $visited_siteurl = self::manageMacroParams(array(1 => 'getsiteurl')); + $uri_visited_full_url_parts = self::manageMacroParams(array(1 => 'geturlparts')); + $uri_visited_full_url_paths = self::manageMacroParams(array(1 => 'geturlpaths')); + $global_info = self::manageMacroParams(array(1 => 'getglobalinfo')); + + // Supported static macros replacements + $replacements = array(); + // URL macros + $replacements[0] = $visited_siteurl; + $replacements[1] = $uri_visited_full_url_parts['scheme']; + $replacements[2] = $uri_visited_full_url_parts['host']; + $replacements[3] = $uri_visited_full_url_parts['port']; + $replacements[4] = $uri_visited_full_url_parts['user']; + $replacements[5] = $uri_visited_full_url_parts['pass']; + $replacements[6] = $uri_visited_full_url_parts['path']; + $replacements[7] = $uri_visited_full_url_parts['query']; + $replacements[8] = (strlen($uri_visited_full_url_parts['query']) > 0) ? '?' . $uri_visited_full_url_parts['query'] : ''; + $replacements[9] = (strlen($uri_visited_full_url_parts['query']) > 0) ? '&' . $uri_visited_full_url_parts['query'] : ''; + $replacements[10] = $uri_visited_full_url_parts['authority']; + $replacements[11] = $uri_visited_full_url_paths['baseonly']; + $replacements[12] = $uri_visited_full_url_paths['pathfrombase']; + // Site macros + $replacements[13] = $global_info['sitename']; + $replacements[14] = $global_info['MetaDesc']; + $replacements[15] = $global_info['MetaKeys']; + } + + if (!isset($patterns_callback)) + { + // Supported dynamic macros patterns + $patterns_callback = array(); + // URL macros + $patterns_callback[0] = "/\{(querybuild) ([^\}]+)\}/suU"; + $patterns_callback[1] = "/\{(querybuildfull) ([^\}]+)\}/suU"; + $patterns_callback[2] = "/\{(querybuildappend) ([^\}]+)\}/suU"; + $patterns_callback[6] = "/\{(queryvar) ([^\}\,]+)\}/suU"; + $patterns_callback[7] = "/\{(queryvar) ([^\}]+),([^\}]+)\}/suU"; + $patterns_callback[8] = "/\{(requestvar) ([^\}\,]+),?\}/suU"; + $patterns_callback[9] = "/\{(requestvar) ([^\}]+),([^\}]+)\}/suU"; + $patterns_callback[10] = "/\{(pathltrim) ([^\}]+)\}/suU"; + $patterns_callback[11] = "/\{(pathrtrim) ([^\}]+)\}/suU"; + $patterns_callback[16] = "/\{(routeurl)\}/"; + $patterns_callback[17] = "/\{(routeurl) ([^\}]+)\}/suU"; + // Site macros + $patterns_callback[19] = "/\{(username)\}/"; + $patterns_callback[20] = "/\{(username) ([^\}]+)\}/suU"; + $patterns_callback[21] = "/\{(userid)\}/"; + $patterns_callback[22] = "/\{(userid) ([^\}]+)\}/suU"; + // Database macros + $patterns_callback[23] = "/\{(tableselect) ([^\}]+)\}(.*)\{\/tableselect\}/suU"; + // String macros + $patterns_callback[28] = "/\{(substr) ([^\}]+)\}(.*)\{\/substr\}/suU"; + $patterns_callback[29] = "/\{(strip_tags)\}(.*)\{\/strip_tags\}/suU"; + $patterns_callback[30] = "/\{(extract) ([^\}]+)\}(.*)\{\/extract\}/suU"; + $patterns_callback[31] = "/\{(extractp) ([^\}]+)\}(.*)\{\/extractp\}/suU"; + $patterns_callback[32] = "/\{(extractdiv) ([^\}]+)\}(.*)\{\/extractdiv\}/suU"; + $patterns_callback[34] = "/\{(preg_placeholder) ([^\}]+)\}(.*)\{\/preg_placeholder\}/suU"; + $patterns_callback[35] = "/\{(lowercase)\}(.*)\{\/lowercase\}/suU"; + $patterns_callback[36] = "/\{(uppercase)\}(.*)\{\/uppercase\}/suU"; + $patterns_callback[37] = "/\{(urldecode)\}(.*)\{\/urldecode\}/suU"; + $patterns_callback[38] = "/\{(urlencode)\}(.*)\{\/urlencode\}/suU"; + $patterns_callback[39] = "/\{(rawurldecode)\}(.*)\{\/rawurldecode\}/suU"; + $patterns_callback[40] = "/\{(rawurlencode)\}(.*)\{\/rawurlencode\}/suU"; + $patterns_callback[41] = "/\{(str_replace) ([^\}]+)\}(.*)\{\/str_replace\}/suU"; + } + + $content = preg_replace($patterns, $replacements, $content); + $content = preg_replace_callback($patterns_callback, 'plgSystemReDJ::manageMacroParams', $content); + return $content; + } + + /** + * + * Evaluate and return placeholders defined in the list + * + */ + private static function evaluatePlaceholders($list) + { + $placeholders = array(); + $placeholders_count = 0; + $rows = preg_split("/[\r\n]+/", $list); + foreach ($rows as $row_key => $row_value) + { + $row_value = trim($row_value); + if (strlen($row_value) > 0) + { + $parts = array_map('trim', explode("=", $row_value, 2)); + $parts_key = @$parts[0]; + /* Placeholder names follow the same rules as other labels and variables in PHP. A valid placeholder name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' */ + if ((strlen($parts_key) > 0) && (preg_match(PLACEHOLDERS_MATCH_MASK, $parts_key) === 1)) + { + $parts_value = @$parts[1]; + if (strlen($parts_value) > 0) + { + $placeholders[$parts_key] = $parts_value; + // Replace already defined placeholders in the new placeholder + preg_match_all(PLACEHOLDERS_MATCH_ALL_MASK, $placeholders[$parts_key], $matches); + foreach ($matches[1] as $current) + { + if (array_key_exists($current, $placeholders)) + { + $placeholders[$parts_key] = str_replace('${' . $current . '}', $placeholders[$current], $placeholders[$parts_key]); + } + } + + // Replace macros + $placeholders[$parts_key] = self::replaceMacros($placeholders[$parts_key]); + + // Load placeholder + $ph = array(1 => 'setplaceholder', 2 => $parts_key, 3 => $placeholders[$parts_key]); + self::manageMacroParams($ph); + + $placeholders_count++; + } else { + // Unset placeholder + unset($placeholders[$parts_key]); + + // Unload placeholder + $ph = array(1 => 'setplaceholder', 2 => $parts_key); + self::manageMacroParams($ph); + } + } + } + } + return $placeholders; + } + + /** + * + * Replace and return defined array of placeholders from the input string + * + */ + private static function replacePlaceholders($placeholders, $string) + { + $value = $string; + preg_match_all(PLACEHOLDERS_MATCH_ALL_MASK, $value, $matches); + foreach ($matches[1] as $current) + { + if (array_key_exists($current, $placeholders)) + { + $value = str_replace('${' . $current . '}', $placeholders[$current], $value); + } + } + return $value; + } + + public function onAfterInitialise() + { + // Save the current error handler (legacy) + $GLOBALS["_REDJ_JERROR_HANDLER"] = JError::getErrorHandling(E_ERROR); + if ( !( isset($GLOBALS["_REDJ_JERROR_HANDLER"]["mode"]) && isset($GLOBALS["_REDJ_JERROR_HANDLER"]["options"]["0"]) && isset($GLOBALS["_REDJ_JERROR_HANDLER"]["options"]["1"]) ) ) { + $GLOBALS["_REDJ_JERROR_HANDLER"] = array("mode" => "callback", "options" => array("0" => "JError", "1" => "customErrorPage")); + } + + // Set new error handler (legacy) + JError::setErrorHandling(E_ERROR, 'callback', array('plgSystemReDJ', 'customError')); + + // Set new exception handler + $current_exception_handler = set_exception_handler(array('plgSystemReDJ', 'customException')); + + // Save the current exception handler + $GLOBALS["_REDJ_EXCEPTION_HANDLER"] = $current_exception_handler; + + // Get the application object. + $app = JFactory::getApplication(); + + // Make sure we are not in the administrator + if ( $app->isAdmin() ) return; + + $trackreferers = $this->params->get('trackreferers', 0); + if ($trackreferers) + { + // Track referers URL calls + $excludereferers = preg_split("/[\r\n]+/", $this->params->get('excludereferers', '')); + foreach ($excludereferers as $key => $value) + { + if (trim($value) == '') + { + // Remove blanks + unset($excludereferers[$key]); + } else { + // Replace macros + if ($value == '{self}') { $excludereferers[$key] = $this->_self; } + if ($value == '{none}') { $excludereferers[$key] = ''; } + } + } + + $visited_url = self::sanitizeURL($this->_visited_full_url); + $referer_url = self::sanitizeURL(@$_SERVER['HTTP_REFERER']); + $domain = self::sanitizeURL(self::getHost($referer_url)); + + if ( !in_array($domain, $excludereferers) ) { + $last_visit = date("Y-m-d H:i:s"); + + $db = JFactory::getDbo(); + $db->setQuery("INSERT IGNORE INTO `#__redj_visited_urls` (`id`, `visited_url`) VALUES (NULL, " . $db->quote( $visited_url ) . ")"); + $res = @$db->query(); + + $db->setQuery("INSERT IGNORE INTO `#__redj_referer_urls` (`id`, `referer_url`, `domain`) VALUES (NULL, " . $db->quote( $referer_url ) . ", " . $db->quote( $domain ) . ")"); + $res = @$db->query(); + + $db->setQuery("INSERT INTO `#__redj_referers` (`id`, `visited_url`, `referer_url`, `hits`, `last_visit`) VALUES (NULL, (SELECT `id` FROM `#__redj_visited_urls` WHERE `visited_url` = " . $db->quote( $visited_url ) . "), (SELECT `id` FROM `#__redj_referer_urls` WHERE `referer_url` = " . $db->quote( $referer_url ) . "), 1, " . $db->quote( $last_visit ) . " ) ON DUPLICATE KEY UPDATE `hits` = `hits` + 1, `last_visit` = " . $db->quote( $last_visit )); + $res = @$db->query(); + } + } + + $this->setRedirect(); + if ( !empty($this->_tourl) ) + { + @ob_end_clean(); + switch ($this->_redirect) { + case 307: + header("HTTP/1.1 307 Temporary Redirect"); + header('Location: ' . $this->_tourl); + exit(); + default: + header("HTTP/1.1 301 Moved Permanently"); + header('Location: ' . $this->_tourl); + exit(); + } + } + + } + + /** + * + * Set the destination URL and the redirect type if a redirect item is found + * + */ + private function setRedirect() + { + $currenturi_encoded = $this->_visited_request_uri; // Raw (encoded): with %## chars + // Remove the base path + $basepath = trim($this->params->get('basepath', ''), ' /'); // Decoded: without %## chars (now you can see spaces, cyrillics, ...) + $basepath = urlencode($basepath); // Raw (encoded): with %## chars + $basepath = str_replace('%2F', '/', $basepath); + $basepath = str_replace('%3A', ':', $basepath); + if ($basepath != '') + { + if (strpos($currenturi_encoded, '/'.$basepath.'/') === 0) + { + $currenturi_encoded = substr($currenturi_encoded, strlen($basepath) + 1); // Raw (encoded): with %## chars + } + } + $currenturi = urldecode($currenturi_encoded); // Decoded: without %## chars (now you can see spaces, cyrillics, ...) + $currentfullurl_encoded = $this->_visited_full_url; // Raw (encoded): with %## chars + $currentfullurl = urldecode($currentfullurl_encoded); // Decoded: without %## chars (now you can see spaces, cyrillics, ...) + + $db = JFactory::getDbo(); + $db->setQuery('SELECT * FROM ( ' + . 'SELECT * FROM #__redj_redirects ' + . 'WHERE ( ' + . '( (' . $db->quote($currenturi) . ' REGEXP BINARY fromurl)>0 AND (case_sensitive<>0) AND (decode_url<>0) AND (request_only<>0) ) ' + . 'OR ( (' . $db->quote($currenturi_encoded) . ' REGEXP BINARY fromurl)>0 AND (case_sensitive<>0) AND (decode_url=0) AND (request_only<>0) ) ' + . 'OR ( (' . $db->quote($currentfullurl) . ' REGEXP BINARY fromurl)>0 AND (case_sensitive<>0) AND (decode_url<>0) AND (request_only=0) ) ' + . 'OR ( (' . $db->quote($currentfullurl_encoded) . ' REGEXP BINARY fromurl)>0 AND (case_sensitive<>0) AND (decode_url=0) AND (request_only=0) ) ' + . 'OR ( (' . $db->quote($currenturi) . ' REGEXP fromurl)>0 AND (case_sensitive=0) AND (decode_url<>0) AND (request_only<>0) ) ' + . 'OR ( (' . $db->quote($currenturi_encoded) . ' REGEXP fromurl)>0 AND (case_sensitive=0) AND (decode_url=0) AND (request_only<>0) ) ' + . 'OR ( (' . $db->quote($currentfullurl) . ' REGEXP fromurl)>0 AND (case_sensitive=0) AND (decode_url<>0) AND (request_only=0) ) ' + . 'OR ( (' . $db->quote($currentfullurl_encoded) . ' REGEXP fromurl)>0 AND (case_sensitive=0) AND (decode_url=0) AND (request_only=0) ) ' + . ') ' + . 'AND published=1 ' + . 'ORDER BY ordering ) AS A ' + . 'WHERE A.skip=\'\' ' + . 'OR ( (' . $db->quote($currentfullurl) . ' REGEXP BINARY A.skip)=0 AND (case_sensitive<>0) AND (decode_url<>0) ) ' + . 'OR ( (' . $db->quote($currentfullurl_encoded) . ' REGEXP BINARY A.skip)=0 AND (case_sensitive<>0) AND (decode_url=0) ) ' + . 'OR ( (' . $db->quote($currentfullurl) . ' REGEXP A.skip)=0 AND (case_sensitive=0) AND (decode_url<>0) ) ' + . 'OR ( (' . $db->quote($currentfullurl_encoded) . ' REGEXP A.skip)=0 AND (case_sensitive=0) AND (decode_url=0) ) '); + $items = $db->loadObjectList(); + if ( count($items) > 0 ) + { + // Notes: if more than one item matches with current URI, we takes only the first one with ordering set + if ( !empty($items[0]->tourl) ) + { + // Get the application object + $app = JFactory::getApplication(); + + // Initialize URL related variables + $visited_siteurl = $this->_siteurl; + + $visited_full_url = $this->_visited_full_url; + + JUri::reset(); + $uri_visited_full_url = JUri::getInstance($visited_full_url); + $uri_visited_full_url_parts['scheme'] = $uri_visited_full_url->getScheme(); + $uri_visited_full_url_parts['host'] = $uri_visited_full_url->getHost(); + $uri_visited_full_url_parts['port'] = $uri_visited_full_url->getPort(); + $uri_visited_full_url_parts['user'] = $uri_visited_full_url->getUser(); + $uri_visited_full_url_parts['pass'] = $uri_visited_full_url->getPass(); + $uri_visited_full_url_parts['path'] = $uri_visited_full_url->getPath(); + $uri_visited_full_url_parts['query'] = $uri_visited_full_url->getQuery(); + $uri_visited_full_url_parts['authority'] = (strlen($uri_visited_full_url_parts['port']) > 0) ? $uri_visited_full_url_parts['host'] . ':' . $uri_visited_full_url_parts['port'] : $uri_visited_full_url_parts['host']; + $uri_visited_full_url_parts['authority'] = (strlen($uri_visited_full_url_parts['user']) > 0) ? $uri_visited_full_url_parts['user'] . ':' . $uri_visited_full_url_parts['pass'] . '@' . $uri_visited_full_url_parts['authority'] : $uri_visited_full_url_parts['authority']; + + $uri_visited_full_url_vars = $uri_visited_full_url->getQuery(true); + + $baseonly = $this->_baseonly; + $pathfrombase = (strlen($baseonly) > 0) ? substr($uri_visited_full_url_parts['path'], strlen($baseonly), strlen($uri_visited_full_url_parts['path']) - strlen($baseonly)) : $uri_visited_full_url_parts['path']; + $uri_visited_full_url_paths['baseonly'] = $baseonly; + $uri_visited_full_url_paths['path'] = $uri_visited_full_url_parts['path']; + $uri_visited_full_url_paths['pathfrombase'] = $pathfrombase; + + // Set URL related variables in callback function + self::manageMacroParams(array(1 => 'setsiteurl', 2 => $visited_siteurl)); + self::manageMacroParams(array(1 => 'seturl', 2 => $visited_full_url)); + self::manageMacroParams(array(1 => 'seturlparts', 2 => $uri_visited_full_url_parts)); + self::manageMacroParams(array(1 => 'seturlvars', 2 => $uri_visited_full_url_vars)); + self::manageMacroParams(array(1 => 'seturlpaths', 2 => $uri_visited_full_url_paths)); + + // Set global info in callback function + $global_info['sitename'] = $app->getCfg('sitename'); + $global_info['MetaDesc'] = $app->getCfg('MetaDesc'); + $global_info['MetaKeys'] = $app->getCfg('MetaKeys'); + self::manageMacroParams(array(1 => 'setglobalinfo', 2 => $global_info)); + + // Update hits counter + $last_visit = date("Y-m-d H:i:s"); + $db->setQuery("UPDATE #__redj_redirects SET hits = hits + 1, last_visit = " . $db->quote( $last_visit ) . " WHERE id = " . $db->quote( $items[0]->id )); + $res = @$db->query(); + + // Evaluate placeholders + $placeholders = self::evaluatePlaceholders($items[0]->placeholders); + + // Replace placeholders + $tourl = self::replacePlaceholders($placeholders, $items[0]->tourl); + + // Replace macros + $tourl = self::replaceMacros($tourl); + + // Set the redirect (destination URL and redirect type) + $this->_tourl = $tourl; + $this->_redirect = $items[0]->redirect; + } + } + + } + +} diff --git a/plugins/system/redj/redj.xml b/plugins/system/redj/redj.xml new file mode 100644 index 0000000..5f23693 --- /dev/null +++ b/plugins/system/redj/redj.xml @@ -0,0 +1,60 @@ + + + plg_system_redj + selfget.com + January 2016 + Copyright (C) 2009 - 2016 selfget.com + http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL + info@selfget.com + http://www.selfget.com + 1.7.10 + PLG_SYS_REDJ_DESCRIPTION + + + language/en-GB/en-GB.plg_system_redj.ini + language/en-GB/en-GB.plg_system_redj.sys.ini + language/it-IT/it-IT.plg_system_redj.ini + language/it-IT/it-IT.plg_system_redj.sys.ini + + + + redj.php + index.html + fields + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+ +
diff --git a/plugins/system/remember/index.html b/plugins/system/remember/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/remember/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/remember/remember.php b/plugins/system/remember/remember.php new file mode 100644 index 0000000..a6e177b --- /dev/null +++ b/plugins/system/remember/remember.php @@ -0,0 +1,97 @@ +app) + { + $this->app = JFactory::getApplication(); + } + + // No remember me for admin. + if ($this->app->isClient('administrator')) + { + return; + } + + // Check for a cookie if user is not logged in + if (JFactory::getUser()->get('guest')) + { + $cookieName = 'joomla_remember_me_' . JUserHelper::getShortHashedUserAgent(); + + // Try with old cookieName (pre 3.6.0) if not found + if (!$this->app->input->cookie->get($cookieName)) + { + $cookieName = JUserHelper::getShortHashedUserAgent(); + } + + // Check for the cookie + if ($this->app->input->cookie->get($cookieName)) + { + $this->app->login(array('username' => ''), array('silent' => true)); + } + } + } + + /** + * Imports the authentication plugin on user logout to make sure that the cookie is destroyed. + * + * @param array $user Holds the user data. + * @param array $options Array holding options (remember, autoregister, group). + * + * @return boolean + */ + public function onUserLogout($user, $options) + { + // No remember me for admin + if ($this->app->isClient('administrator')) + { + return true; + } + + $cookieName = 'joomla_remember_me_' . JUserHelper::getShortHashedUserAgent(); + + // Check for the cookie + if ($this->app->input->cookie->get($cookieName)) + { + // Make sure authentication group is loaded to process onUserAfterLogout event + JPluginHelper::importPlugin('authentication'); + } + + return true; + } +} diff --git a/plugins/system/remember/remember.xml b/plugins/system/remember/remember.xml new file mode 100644 index 0000000..f43aead --- /dev/null +++ b/plugins/system/remember/remember.xml @@ -0,0 +1,19 @@ + + + plg_system_remember + Joomla! Project + April 2007 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_REMEMBER_XML_DESCRIPTION + + remember.php + + + en-GB.plg_system_remember.ini + en-GB.plg_system_remember.sys.ini + + diff --git a/plugins/system/sef/index.html b/plugins/system/sef/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/sef/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/sef/sef.php b/plugins/system/sef/sef.php new file mode 100644 index 0000000..e68993b --- /dev/null +++ b/plugins/system/sef/sef.php @@ -0,0 +1,260 @@ +app->getDocument(); + + if (!$this->app->isClient('site') || $doc->getType() !== 'html') + { + return; + } + + $sefDomain = $this->params->get('domain', ''); + + // Don't add a canonical html tag if no alternative domain has added in SEF plugin domain field. + if (empty($sefDomain)) + { + return; + } + + // Check if a canonical html tag already exists (for instance, added by a component). + $canonical = ''; + + foreach ($doc->_links as $linkUrl => $link) + { + if (isset($link['relation']) && $link['relation'] === 'canonical') + { + $canonical = $linkUrl; + break; + } + } + + // If a canonical html tag already exists get the canonical and change it to use the SEF plugin domain field. + if (!empty($canonical)) + { + // Remove current canonical link. + unset($doc->_links[$canonical]); + + // Set the current canonical link but use the SEF system plugin domain field. + $canonical = $sefDomain . JUri::getInstance($canonical)->toString(array('path', 'query', 'fragment')); + } + // If a canonical html doesn't exists already add a canonical html tag using the SEF plugin domain field. + else + { + $canonical = $sefDomain . JUri::getInstance()->toString(array('path', 'query', 'fragment')); + } + + // Add the canonical link. + $doc->addHeadLink(htmlspecialchars($canonical), 'canonical'); + } + + /** + * Convert the site URL to fit to the HTTP request. + * + * @return void + */ + public function onAfterRender() + { + if (!$this->app->isClient('site')) + { + return; + } + + // Replace src links. + $base = JUri::base(true) . '/'; + $buffer = $this->app->getBody(); + + // For feeds we need to search for the URL with domain. + $prefix = $this->app->getDocument()->getType() === 'feed' ? JUri::root() : ''; + + // Replace index.php URI by SEF URI. + if (strpos($buffer, 'href="' . $prefix . 'index.php?') !== false) + { + preg_match_all('#href="' . $prefix . 'index.php\?([^"]+)"#m', $buffer, $matches); + + foreach ($matches[1] as $urlQueryString) + { + $buffer = str_replace( + 'href="' . $prefix . 'index.php?' . $urlQueryString . '"', + 'href="' . trim($prefix, '/') . JRoute::_('index.php?' . $urlQueryString) . '"', + $buffer + ); + } + + $this->checkBuffer($buffer); + } + + // Check for all unknown protocals (a protocol must contain at least one alpahnumeric character followed by a ":"). + $protocols = '[a-zA-Z0-9\-]+:'; + $attributes = array('href=', 'src=', 'poster='); + + foreach ($attributes as $attribute) + { + if (strpos($buffer, $attribute) !== false) + { + $regex = '#\s' . $attribute . '"(?!/|' . $protocols . '|\#|\')([^"]*)"#m'; + $buffer = preg_replace($regex, ' ' . $attribute . '"' . $base . '$1"', $buffer); + $this->checkBuffer($buffer); + } + } + + if (strpos($buffer, 'srcset=') !== false) + { + $regex = '#\s+srcset="([^"]+)"#m'; + + $buffer = preg_replace_callback( + $regex, + function ($match) use ($base, $protocols) + { + preg_match_all('#(?:[^\s]+)\s*(?:[\d\.]+[wx])?(?:\,\s*)?#i', $match[1], $matches); + + foreach ($matches[0] as &$src) + { + $src = preg_replace('#^(?!/|' . $protocols . '|\#|\')(.+)#', $base . '$1', $src); + } + + return ' srcset="' . implode($matches[0]) . '"'; + }, + $buffer + ); + + $this->checkBuffer($buffer); + } + + // Replace all unknown protocals in javascript window open events. + if (strpos($buffer, 'window.open(') !== false) + { + $regex = '#onclick="window.open\(\'(?!/|' . $protocols . '|\#)([^/]+[^\']*?\')#m'; + $buffer = preg_replace($regex, 'onclick="window.open(\'' . $base . '$1', $buffer); + $this->checkBuffer($buffer); + } + + // Replace all unknown protocols in onmouseover and onmouseout attributes. + $attributes = array('onmouseover=', 'onmouseout='); + + foreach ($attributes as $attribute) + { + if (strpos($buffer, $attribute) !== false) + { + $regex = '#' . $attribute . '"this.src=([\']+)(?!/|' . $protocols . '|\#|\')([^"]+)"#m'; + $buffer = preg_replace($regex, $attribute . '"this.src=$1' . $base . '$2"', $buffer); + $this->checkBuffer($buffer); + } + } + + // Replace all unknown protocols in CSS background image. + if (strpos($buffer, 'style=') !== false) + { + $regex_url = '\s*url\s*\(([\'\"]|\&\#0?3[49];)?(?!/|\&\#0?3[49];|' . $protocols . '|\#)([^\)\'\"]+)([\'\"]|\&\#0?3[49];)?\)'; + $regex = '#style=\s*([\'\"])(.*):' . $regex_url . '#m'; + $buffer = preg_replace($regex, 'style=$1$2: url($3' . $base . '$4$5)', $buffer); + $this->checkBuffer($buffer); + } + + // Replace all unknown protocols in OBJECT param tag. + if (strpos($buffer, ' -- fix it only inside the tag. + $regex = '#(]\s*value\s*=\s*"(?!/|' . $protocols . '|\#|\')([^"]*)"#m'; + $buffer = preg_replace($regex, '$1name="$2" value="' . $base . '$3"', $buffer); + $this->checkBuffer($buffer); + + // OBJECT -- fix it only inside the tag. + $regex = '#(]*)value\s*=\s*"(?!/|' . $protocols . '|\#|\')([^"]*)"\s*name\s*=\s*"(movie|src|url)"#m'; + $buffer = preg_replace($regex, 'checkBuffer($buffer); + } + + // Replace all unknown protocols in OBJECT tag. + if (strpos($buffer, 'checkBuffer($buffer); + } + + // Use the replaced HTML body. + $this->app->setBody($buffer); + } + + /** + * Check the buffer. + * + * @param string $buffer Buffer to be checked. + * + * @return void + */ + private function checkBuffer($buffer) + { + if ($buffer === null) + { + switch (preg_last_error()) + { + case PREG_BACKTRACK_LIMIT_ERROR: + $message = 'PHP regular expression limit reached (pcre.backtrack_limit)'; + break; + case PREG_RECURSION_LIMIT_ERROR: + $message = 'PHP regular expression limit reached (pcre.recursion_limit)'; + break; + case PREG_BAD_UTF8_ERROR: + $message = 'Bad UTF8 passed to PCRE function'; + break; + default: + $message = 'Unknown PCRE error calling PCRE function'; + } + + throw new RuntimeException($message); + } + } + + /** + * Replace the matched tags. + * + * @param array &$matches An array of matches (see preg_match_all). + * + * @return string + * + * @deprecated 4.0 No replacement. + */ + protected static function route(&$matches) + { + JLog::add(__METHOD__ . ' is deprecated, no replacement.', JLog::WARNING, 'deprecated'); + + $url = $matches[1]; + $url = str_replace('&', '&', $url); + $route = JRoute::_('index.php?' . $url); + + return 'href="' . $route; + } +} diff --git a/plugins/system/sef/sef.xml b/plugins/system/sef/sef.xml new file mode 100644 index 0000000..be0f436 --- /dev/null +++ b/plugins/system/sef/sef.xml @@ -0,0 +1,34 @@ + + + plg_system_sef + Joomla! Project + December 2007 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.0.0 + PLG_SEF_XML_DESCRIPTION + + sef.php + + + en-GB.plg_system_sef.ini + en-GB.plg_system_sef.sys.ini + + + +
+ +
+
+
+
diff --git a/plugins/system/stats/field/base.php b/plugins/system/stats/field/base.php new file mode 100644 index 0000000..56d5ba2 --- /dev/null +++ b/plugins/system/stats/field/base.php @@ -0,0 +1,36 @@ +getTemplate(); + + return array( + JPATH_ADMINISTRATOR . '/templates/' . $template . '/html/layouts/plugins/system/stats', + dirname(__DIR__) . '/layouts', + JPATH_SITE . '/layouts' + ); + } +} diff --git a/plugins/system/stats/field/data.php b/plugins/system/stats/field/data.php new file mode 100644 index 0000000..c7f00e9 --- /dev/null +++ b/plugins/system/stats/field/data.php @@ -0,0 +1,57 @@ +trigger('onGetStatsData', array('stats.field.data')); + + $data['statsData'] = $result ? reset($result) : array(); + + return $data; + } +} diff --git a/plugins/system/stats/field/uniqueid.php b/plugins/system/stats/field/uniqueid.php new file mode 100644 index 0000000..246b310 --- /dev/null +++ b/plugins/system/stats/field/uniqueid.php @@ -0,0 +1,36 @@ + section in form XML. + * @var boolean $hidden Is this field hidden in the form? + * @var string $hint Placeholder for the field. + * @var string $id DOM id of the field. + * @var string $label Label of the field. + * @var string $labelclass Classes to apply to the label. + * @var boolean $multiple Does this field support multiple values? + * @var string $name Name of the input field. + * @var string $onchange Onchange attribute for the field. + * @var string $onclick Onclick attribute for the field. + * @var string $pattern Pattern (Reg Ex) of value of the form field. + * @var boolean $readonly Is this field read only? + * @var boolean $repeat Allows extensions to duplicate elements. + * @var boolean $required Is this field required? + * @var integer $size Size attribute of the input. + * @var boolean $spellcheck Spellcheck state for the form field. + * @var string $validate Validation rules to apply. + * @var string $value Value attribute of the field. + * @var array $options Options available for this field. + * @var array $statsData Statistics that will be sent to the stats server + */ + +JHtml::_('jquery.framework'); +?> + +render('stats', compact('statsData')); diff --git a/plugins/system/stats/layouts/field/uniqueid.php b/plugins/system/stats/layouts/field/uniqueid.php new file mode 100644 index 0000000..537521d --- /dev/null +++ b/plugins/system/stats/layouts/field/uniqueid.php @@ -0,0 +1,46 @@ + section in form XML. + * @var boolean $hidden Is this field hidden in the form? + * @var string $hint Placeholder for the field. + * @var string $id DOM id of the field. + * @var string $label Label of the field. + * @var string $labelclass Classes to apply to the label. + * @var boolean $multiple Does this field support multiple values? + * @var string $name Name of the input field. + * @var string $onchange Onchange attribute for the field. + * @var string $onclick Onclick attribute for the field. + * @var string $pattern Pattern (Reg Ex) of value of the form field. + * @var boolean $readonly Is this field read only? + * @var boolean $repeat Allows extensions to duplicate elements. + * @var boolean $required Is this field required? + * @var integer $size Size attribute of the input. + * @var boolean $spellcheck Spellcheck state for the form field. + * @var string $validate Validation rules to apply. + * @var string $value Value attribute of the field. + * @var array $options Options available for this field. + */ +?> + + + + \ No newline at end of file diff --git a/plugins/system/stats/layouts/message.php b/plugins/system/stats/layouts/message.php new file mode 100644 index 0000000..c6a0834 --- /dev/null +++ b/plugins/system/stats/layouts/message.php @@ -0,0 +1,38 @@ + + diff --git a/plugins/system/stats/layouts/stats.php b/plugins/system/stats/layouts/stats.php new file mode 100644 index 0000000..dc067c9 --- /dev/null +++ b/plugins/system/stats/layouts/stats.php @@ -0,0 +1,27 @@ + + diff --git a/plugins/system/stats/stats.php b/plugins/system/stats/stats.php new file mode 100644 index 0000000..d886c0b --- /dev/null +++ b/plugins/system/stats/stats.php @@ -0,0 +1,564 @@ +app->isClient('administrator') || !$this->isAllowedUser()) + { + return; + } + + if (!$this->isDebugEnabled() && !$this->isUpdateRequired()) + { + return; + } + + if (JUri::getInstance()->getVar('tmpl') === 'component') + { + return; + } + + // Load plugin language files only when needed (ex: they are not needed in site client). + $this->loadLanguage(); + + JHtml::_('jquery.framework'); + JHtml::_('script', 'plg_system_stats/stats.js', array('version' => 'auto', 'relative' => true)); + } + + /** + * User selected to always send data + * + * @return void + * + * @since 3.5 + * + * @throws Exception If user is not allowed. + * @throws RuntimeException If there is an error saving the params or sending the data. + */ + public function onAjaxSendAlways() + { + if (!$this->isAllowedUser() || !$this->isAjaxRequest()) + { + throw new Exception(JText::_('JGLOBAL_AUTH_ACCESS_DENIED'), 403); + } + + $this->params->set('mode', static::MODE_ALLOW_ALWAYS); + + if (!$this->saveParams()) + { + throw new RuntimeException('Unable to save plugin settings', 500); + } + + $this->sendStats(); + + echo json_encode(array('sent' => 1)); + } + + /** + * User selected to never send data. + * + * @return void + * + * @since 3.5 + * + * @throws Exception If user is not allowed. + * @throws RuntimeException If there is an error saving the params. + */ + public function onAjaxSendNever() + { + if (!$this->isAllowedUser() || !$this->isAjaxRequest()) + { + throw new Exception(JText::_('JGLOBAL_AUTH_ACCESS_DENIED'), 403); + } + + $this->params->set('mode', static::MODE_ALLOW_NEVER); + + if (!$this->saveParams()) + { + throw new RuntimeException('Unable to save plugin settings', 500); + } + + echo json_encode(array('sent' => 0)); + } + + /** + * User selected to send data once. + * + * @return void + * + * @since 3.5 + * + * @throws Exception If user is not allowed. + * @throws RuntimeException If there is an error saving the params or sending the data. + */ + public function onAjaxSendOnce() + { + if (!$this->isAllowedUser() || !$this->isAjaxRequest()) + { + throw new Exception(JText::_('JGLOBAL_AUTH_ACCESS_DENIED'), 403); + } + + $this->params->set('mode', static::MODE_ALLOW_ONCE); + + if (!$this->saveParams()) + { + throw new RuntimeException('Unable to save plugin settings', 500); + } + + $this->sendStats(); + + echo json_encode(array('sent' => 1)); + } + + /** + * Send the stats to the server. + * On first load | on demand mode it will show a message asking users to select mode. + * + * @return void + * + * @since 3.5 + * + * @throws Exception If user is not allowed. + * @throws RuntimeException If there is an error saving the params or sending the data. + */ + public function onAjaxSendStats() + { + if (!$this->isAllowedUser() || !$this->isAjaxRequest()) + { + throw new Exception(JText::_('JGLOBAL_AUTH_ACCESS_DENIED'), 403); + } + + // User has not selected the mode. Show message. + if ((int) $this->params->get('mode') !== static::MODE_ALLOW_ALWAYS) + { + $data = array( + 'sent' => 0, + 'html' => $this->getRenderer('message')->render($this->getLayoutData()) + ); + + echo json_encode($data); + + return; + } + + if (!$this->saveParams()) + { + throw new RuntimeException('Unable to save plugin settings', 500); + } + + $this->sendStats(); + + echo json_encode(array('sent' => 1)); + } + + /** + * Get the data through events + * + * @param string $context Context where this will be called from + * + * @return array + * + * @since 3.5 + */ + public function onGetStatsData($context) + { + return $this->getStatsData(); + } + + /** + * Debug a layout of this plugin + * + * @param string $layoutId Layout identifier + * @param array $data Optional data for the layout + * + * @return string + * + * @since 3.5 + */ + public function debug($layoutId, $data = array()) + { + $data = array_merge($this->getLayoutData(), $data); + + return $this->getRenderer($layoutId)->debug($data); + } + + /** + * Get the data for the layout + * + * @return array + * + * @since 3.5 + */ + protected function getLayoutData() + { + return array( + 'plugin' => $this, + 'pluginParams' => $this->params, + 'statsData' => $this->getStatsData() + ); + } + + /** + * Get the layout paths + * + * @return array + * + * @since 3.5 + */ + protected function getLayoutPaths() + { + $template = JFactory::getApplication()->getTemplate(); + + return array( + JPATH_ADMINISTRATOR . '/templates/' . $template . '/html/layouts/plugins/' . $this->_type . '/' . $this->_name, + __DIR__ . '/layouts', + ); + } + + /** + * Get the plugin renderer + * + * @param string $layoutId Layout identifier + * + * @return JLayout + * + * @since 3.5 + */ + protected function getRenderer($layoutId = 'default') + { + $renderer = new JLayoutFile($layoutId); + + $renderer->setIncludePaths($this->getLayoutPaths()); + + return $renderer; + } + + /** + * Get the data that will be sent to the stats server. + * + * @return array + * + * @since 3.5 + */ + private function getStatsData() + { + return array( + 'unique_id' => $this->getUniqueId(), + 'php_version' => PHP_VERSION, + 'db_type' => $this->db->name, + 'db_version' => $this->db->getVersion(), + 'cms_version' => JVERSION, + 'server_os' => php_uname('s') . ' ' . php_uname('r') + ); + } + + /** + * Get the unique id. Generates one if none is set. + * + * @return integer + * + * @since 3.5 + */ + private function getUniqueId() + { + if (null === $this->uniqueId) + { + $this->uniqueId = $this->params->get('unique_id', hash('sha1', JUserHelper::genRandomPassword(28) . time())); + } + + return $this->uniqueId; + } + + /** + * Check if current user is allowed to send the data + * + * @return boolean + * + * @since 3.5 + */ + private function isAllowedUser() + { + return JFactory::getUser()->authorise('core.admin'); + } + + /** + * Check if the debug is enabled + * + * @return boolean + * + * @since 3.5 + */ + private function isDebugEnabled() + { + return defined('PLG_SYSTEM_STATS_DEBUG'); + } + + /** + * Check if last_run + interval > now + * + * @return boolean + * + * @since 3.5 + */ + private function isUpdateRequired() + { + $last = (int) $this->params->get('lastrun', 0); + $interval = (int) $this->params->get('interval', 12); + $mode = (int) $this->params->get('mode', 0); + + if ($mode === static::MODE_ALLOW_NEVER) + { + return false; + } + + // Never updated or debug enabled + if (!$last || $this->isDebugEnabled()) + { + return true; + } + + return (abs(time() - $last) > $interval * 3600); + } + + /** + * Check valid AJAX request + * + * @return boolean + * + * @since 3.5 + */ + private function isAjaxRequest() + { + return strtolower($this->app->input->server->get('HTTP_X_REQUESTED_WITH', '')) === 'xmlhttprequest'; + } + + /** + * Render a layout of this plugin + * + * @param string $layoutId Layout identifier + * @param array $data Optional data for the layout + * + * @return string + * + * @since 3.5 + */ + public function render($layoutId, $data = array()) + { + $data = array_merge($this->getLayoutData(), $data); + + return $this->getRenderer($layoutId)->render($data); + } + + /** + * Save the plugin parameters + * + * @return boolean + * + * @since 3.5 + */ + private function saveParams() + { + // Update params + $this->params->set('lastrun', time()); + $this->params->set('unique_id', $this->getUniqueId()); + $interval = (int) $this->params->get('interval', 12); + $this->params->set('interval', $interval ?: 12); + + $query = $this->db->getQuery(true) + ->update($this->db->quoteName('#__extensions')) + ->set($this->db->quoteName('params') . ' = ' . $this->db->quote($this->params->toString('JSON'))) + ->where($this->db->quoteName('type') . ' = ' . $this->db->quote('plugin')) + ->where($this->db->quoteName('folder') . ' = ' . $this->db->quote('system')) + ->where($this->db->quoteName('element') . ' = ' . $this->db->quote('stats')); + + try + { + // Lock the tables to prevent multiple plugin executions causing a race condition + $this->db->lockTable('#__extensions'); + } + catch (Exception $e) + { + // If we can't lock the tables it's too risky to continue execution + return false; + } + + try + { + // Update the plugin parameters + $result = $this->db->setQuery($query)->execute(); + + $this->clearCacheGroups(array('com_plugins'), array(0, 1)); + } + catch (Exception $exc) + { + // If we failed to execute + $this->db->unlockTables(); + $result = false; + } + + try + { + // Unlock the tables after writing + $this->db->unlockTables(); + } + catch (Exception $e) + { + // If we can't lock the tables assume we have somehow failed + $result = false; + } + + return $result; + } + + /** + * Send the stats to the stats server + * + * @return boolean + * + * @since 3.5 + * + * @throws RuntimeException If there is an error sending the data. + */ + private function sendStats() + { + try + { + // Don't let the request take longer than 2 seconds to avoid page timeout issues + $response = JHttpFactory::getHttp()->post($this->serverUrl, $this->getStatsData(), null, 2); + } + catch (UnexpectedValueException $e) + { + // There was an error sending stats. Should we do anything? + throw new RuntimeException('Could not send site statistics to remote server: ' . $e->getMessage(), 500); + } + catch (RuntimeException $e) + { + // There was an error connecting to the server or in the post request + throw new RuntimeException('Could not connect to statistics server: ' . $e->getMessage(), 500); + } + catch (Exception $e) + { + // An unexpected error in processing; don't let this failure kill the site + throw new RuntimeException('Unexpected error connecting to statistics server: ' . $e->getMessage(), 500); + } + + if ($response->code !== 200) + { + $data = json_decode($response->body); + + throw new RuntimeException('Could not send site statistics to remote server: ' . $data->message, $response->code); + } + + return true; + } + + /** + * Clears cache groups. We use it to clear the plugins cache after we update the last run timestamp. + * + * @param array $clearGroups The cache groups to clean + * @param array $cacheClients The cache clients (site, admin) to clean + * + * @return void + * + * @since 3.5 + */ + private function clearCacheGroups(array $clearGroups, array $cacheClients = array(0, 1)) + { + foreach ($clearGroups as $group) + { + foreach ($cacheClients as $client_id) + { + try + { + $options = array( + 'defaultgroup' => $group, + 'cachebase' => $client_id ? JPATH_ADMINISTRATOR . '/cache' : $this->app->get('cache_path', JPATH_SITE . '/cache') + ); + + $cache = JCache::getInstance('callback', $options); + $cache->clean(); + } + catch (Exception $e) + { + // Ignore it + } + } + } + } +} diff --git a/plugins/system/stats/stats.xml b/plugins/system/stats/stats.xml new file mode 100644 index 0000000..d4bde9b --- /dev/null +++ b/plugins/system/stats/stats.xml @@ -0,0 +1,68 @@ + + + plg_system_stats + Joomla! Project + November 2013 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.5.0 + PLG_SYSTEM_STATS_XML_DESCRIPTION + + field + layouts + stats.php + + + en-GB/en-GB.plg_system_stats.ini + en-GB/en-GB.plg_system_stats.sys.ini + + + +
+ + + + + + + + + + + + + +
+
+
+
diff --git a/plugins/system/t3/admin/bootstrap/css/bootstrap-responsive.css b/plugins/system/t3/admin/bootstrap/css/bootstrap-responsive.css new file mode 100644 index 0000000..daafa91 --- /dev/null +++ b/plugins/system/t3/admin/bootstrap/css/bootstrap-responsive.css @@ -0,0 +1,1040 @@ +/*! + * Bootstrap Responsive v2.1.0 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ + +.clearfix { + *zoom: 1; +} + +.clearfix:before, +.clearfix:after { + display: table; + line-height: 0; + content: ""; +} + +.clearfix:after { + clear: both; +} + +.hide-text { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} + +.input-block-level { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.hidden { + display: none; + visibility: hidden; +} + +.visible-phone { + display: none !important; +} + +.visible-tablet { + display: none !important; +} + +.hidden-desktop { + display: none !important; +} + +.visible-desktop { + display: inherit !important; +} + +@media (min-width: 768px) and (max-width: 979px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important ; + } + .visible-tablet { + display: inherit !important; + } + .hidden-tablet { + display: none !important; + } +} + +@media (max-width: 767px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important; + } + .visible-phone { + display: inherit !important; + } + .hidden-phone { + display: none !important; + } +} + +@media (min-width: 1200px) { + .row { + margin-left: -30px; + *zoom: 1; + } + .row:before, + .row:after { + display: table; + line-height: 0; + content: ""; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + margin-left: 30px; + } + .container, + .navbar-static-top .container, + .navbar-fixed-top .container, + .navbar-fixed-bottom .container { + width: 1170px; + } + .span12 { + width: 1170px; + } + .span11 { + width: 1070px; + } + .span10 { + width: 970px; + } + .span9 { + width: 870px; + } + .span8 { + width: 770px; + } + .span7 { + width: 670px; + } + .span6 { + width: 570px; + } + .span5 { + width: 470px; + } + .span4 { + width: 370px; + } + .span3 { + width: 270px; + } + .span2 { + width: 170px; + } + .span1 { + width: 70px; + } + .offset12 { + margin-left: 1230px; + } + .offset11 { + margin-left: 1130px; + } + .offset10 { + margin-left: 1030px; + } + .offset9 { + margin-left: 930px; + } + .offset8 { + margin-left: 830px; + } + .offset7 { + margin-left: 730px; + } + .offset6 { + margin-left: 630px; + } + .offset5 { + margin-left: 530px; + } + .offset4 { + margin-left: 430px; + } + .offset3 { + margin-left: 330px; + } + .offset2 { + margin-left: 230px; + } + .offset1 { + margin-left: 130px; + } + .row-fluid { + width: 100%; + *zoom: 1; + } + .row-fluid:before, + .row-fluid:after { + display: table; + line-height: 0; + content: ""; + } + .row-fluid:after { + clear: both; + } + .row-fluid [class*="span"] { + display: block; + float: left; + width: 100%; + min-height: 30px; + margin-left: 2.564102564102564%; + *margin-left: 2.5109110747408616%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .row-fluid [class*="span"]:first-child { + margin-left: 0; + } + .row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; + } + .row-fluid .span11 { + width: 91.45299145299145%; + *width: 91.39979996362975%; + } + .row-fluid .span10 { + width: 82.90598290598291%; + *width: 82.8527914166212%; + } + .row-fluid .span9 { + width: 74.35897435897436%; + *width: 74.30578286961266%; + } + .row-fluid .span8 { + width: 65.81196581196582%; + *width: 65.75877432260411%; + } + .row-fluid .span7 { + width: 57.26495726495726%; + *width: 57.21176577559556%; + } + .row-fluid .span6 { + width: 48.717948717948715%; + *width: 48.664757228587014%; + } + .row-fluid .span5 { + width: 40.17094017094017%; + *width: 40.11774868157847%; + } + .row-fluid .span4 { + width: 31.623931623931625%; + *width: 31.570740134569924%; + } + .row-fluid .span3 { + width: 23.076923076923077%; + *width: 23.023731587561375%; + } + .row-fluid .span2 { + width: 14.52991452991453%; + *width: 14.476723040552828%; + } + .row-fluid .span1 { + width: 5.982905982905983%; + *width: 5.929714493544281%; + } + .row-fluid .offset12 { + margin-left: 105.12820512820512%; + *margin-left: 105.02182214948171%; + } + .row-fluid .offset12:first-child { + margin-left: 102.56410256410257%; + *margin-left: 102.45771958537915%; + } + .row-fluid .offset11 { + margin-left: 96.58119658119658%; + *margin-left: 96.47481360247316%; + } + .row-fluid .offset11:first-child { + margin-left: 94.01709401709402%; + *margin-left: 93.91071103837061%; + } + .row-fluid .offset10 { + margin-left: 88.03418803418803%; + *margin-left: 87.92780505546462%; + } + .row-fluid .offset10:first-child { + margin-left: 85.47008547008548%; + *margin-left: 85.36370249136206%; + } + .row-fluid .offset9 { + margin-left: 79.48717948717949%; + *margin-left: 79.38079650845607%; + } + .row-fluid .offset9:first-child { + margin-left: 76.92307692307693%; + *margin-left: 76.81669394435352%; + } + .row-fluid .offset8 { + margin-left: 70.94017094017094%; + *margin-left: 70.83378796144753%; + } + .row-fluid .offset8:first-child { + margin-left: 68.37606837606839%; + *margin-left: 68.26968539734497%; + } + .row-fluid .offset7 { + margin-left: 62.393162393162385%; + *margin-left: 62.28677941443899%; + } + .row-fluid .offset7:first-child { + margin-left: 59.82905982905982%; + *margin-left: 59.72267685033642%; + } + .row-fluid .offset6 { + margin-left: 53.84615384615384%; + *margin-left: 53.739770867430444%; + } + .row-fluid .offset6:first-child { + margin-left: 51.28205128205128%; + *margin-left: 51.175668303327875%; + } + .row-fluid .offset5 { + margin-left: 45.299145299145295%; + *margin-left: 45.1927623204219%; + } + .row-fluid .offset5:first-child { + margin-left: 42.73504273504273%; + *margin-left: 42.62865975631933%; + } + .row-fluid .offset4 { + margin-left: 36.75213675213675%; + *margin-left: 36.645753773413354%; + } + .row-fluid .offset4:first-child { + margin-left: 34.18803418803419%; + *margin-left: 34.081651209310785%; + } + .row-fluid .offset3 { + margin-left: 28.205128205128204%; + *margin-left: 28.0987452264048%; + } + .row-fluid .offset3:first-child { + margin-left: 25.641025641025642%; + *margin-left: 25.53464266230224%; + } + .row-fluid .offset2 { + margin-left: 19.65811965811966%; + *margin-left: 19.551736679396257%; + } + .row-fluid .offset2:first-child { + margin-left: 17.094017094017094%; + *margin-left: 16.98763411529369%; + } + .row-fluid .offset1 { + margin-left: 11.11111111111111%; + *margin-left: 11.004728132387708%; + } + .row-fluid .offset1:first-child { + margin-left: 8.547008547008547%; + *margin-left: 8.440625568285142%; + } + input, + textarea, + .uneditable-input { + margin-left: 0; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 30px; + } + input.span12, + textarea.span12, + .uneditable-input.span12 { + width: 1156px; + } + input.span11, + textarea.span11, + .uneditable-input.span11 { + width: 1056px; + } + input.span10, + textarea.span10, + .uneditable-input.span10 { + width: 956px; + } + input.span9, + textarea.span9, + .uneditable-input.span9 { + width: 856px; + } + input.span8, + textarea.span8, + .uneditable-input.span8 { + width: 756px; + } + input.span7, + textarea.span7, + .uneditable-input.span7 { + width: 656px; + } + input.span6, + textarea.span6, + .uneditable-input.span6 { + width: 556px; + } + input.span5, + textarea.span5, + .uneditable-input.span5 { + width: 456px; + } + input.span4, + textarea.span4, + .uneditable-input.span4 { + width: 356px; + } + input.span3, + textarea.span3, + .uneditable-input.span3 { + width: 256px; + } + input.span2, + textarea.span2, + .uneditable-input.span2 { + width: 156px; + } + input.span1, + textarea.span1, + .uneditable-input.span1 { + width: 56px; + } + .thumbnails { + margin-left: -30px; + } + .thumbnails > li { + margin-left: 30px; + } + .row-fluid .thumbnails { + margin-left: 0; + } +} + +@media (min-width: 768px) and (max-width: 979px) { + .row { + margin-left: -20px; + *zoom: 1; + } + .row:before, + .row:after { + display: table; + line-height: 0; + content: ""; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + margin-left: 20px; + } + .container, + .navbar-static-top .container, + .navbar-fixed-top .container, + .navbar-fixed-bottom .container { + width: 724px; + } + .span12 { + width: 724px; + } + .span11 { + width: 662px; + } + .span10 { + width: 600px; + } + .span9 { + width: 538px; + } + .span8 { + width: 476px; + } + .span7 { + width: 414px; + } + .span6 { + width: 352px; + } + .span5 { + width: 290px; + } + .span4 { + width: 228px; + } + .span3 { + width: 166px; + } + .span2 { + width: 104px; + } + .span1 { + width: 42px; + } + .offset12 { + margin-left: 764px; + } + .offset11 { + margin-left: 702px; + } + .offset10 { + margin-left: 640px; + } + .offset9 { + margin-left: 578px; + } + .offset8 { + margin-left: 516px; + } + .offset7 { + margin-left: 454px; + } + .offset6 { + margin-left: 392px; + } + .offset5 { + margin-left: 330px; + } + .offset4 { + margin-left: 268px; + } + .offset3 { + margin-left: 206px; + } + .offset2 { + margin-left: 144px; + } + .offset1 { + margin-left: 82px; + } + .row-fluid { + width: 100%; + *zoom: 1; + } + .row-fluid:before, + .row-fluid:after { + display: table; + line-height: 0; + content: ""; + } + .row-fluid:after { + clear: both; + } + .row-fluid [class*="span"] { + display: block; + float: left; + width: 100%; + min-height: 30px; + margin-left: 2.7624309392265194%; + *margin-left: 2.709239449864817%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .row-fluid [class*="span"]:first-child { + margin-left: 0; + } + .row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; + } + .row-fluid .span11 { + width: 91.43646408839778%; + *width: 91.38327259903608%; + } + .row-fluid .span10 { + width: 82.87292817679558%; + *width: 82.81973668743387%; + } + .row-fluid .span9 { + width: 74.30939226519337%; + *width: 74.25620077583166%; + } + .row-fluid .span8 { + width: 65.74585635359117%; + *width: 65.69266486422946%; + } + .row-fluid .span7 { + width: 57.18232044198895%; + *width: 57.12912895262725%; + } + .row-fluid .span6 { + width: 48.61878453038674%; + *width: 48.56559304102504%; + } + .row-fluid .span5 { + width: 40.05524861878453%; + *width: 40.00205712942283%; + } + .row-fluid .span4 { + width: 31.491712707182323%; + *width: 31.43852121782062%; + } + .row-fluid .span3 { + width: 22.92817679558011%; + *width: 22.87498530621841%; + } + .row-fluid .span2 { + width: 14.3646408839779%; + *width: 14.311449394616199%; + } + .row-fluid .span1 { + width: 5.801104972375691%; + *width: 5.747913483013988%; + } + .row-fluid .offset12 { + margin-left: 105.52486187845304%; + *margin-left: 105.41847889972962%; + } + .row-fluid .offset12:first-child { + margin-left: 102.76243093922652%; + *margin-left: 102.6560479605031%; + } + .row-fluid .offset11 { + margin-left: 96.96132596685082%; + *margin-left: 96.8549429881274%; + } + .row-fluid .offset11:first-child { + margin-left: 94.1988950276243%; + *margin-left: 94.09251204890089%; + } + .row-fluid .offset10 { + margin-left: 88.39779005524862%; + *margin-left: 88.2914070765252%; + } + .row-fluid .offset10:first-child { + margin-left: 85.6353591160221%; + *margin-left: 85.52897613729868%; + } + .row-fluid .offset9 { + margin-left: 79.8342541436464%; + *margin-left: 79.72787116492299%; + } + .row-fluid .offset9:first-child { + margin-left: 77.07182320441989%; + *margin-left: 76.96544022569647%; + } + .row-fluid .offset8 { + margin-left: 71.2707182320442%; + *margin-left: 71.16433525332079%; + } + .row-fluid .offset8:first-child { + margin-left: 68.50828729281768%; + *margin-left: 68.40190431409427%; + } + .row-fluid .offset7 { + margin-left: 62.70718232044199%; + *margin-left: 62.600799341718584%; + } + .row-fluid .offset7:first-child { + margin-left: 59.94475138121547%; + *margin-left: 59.838368402492065%; + } + .row-fluid .offset6 { + margin-left: 54.14364640883978%; + *margin-left: 54.037263430116376%; + } + .row-fluid .offset6:first-child { + margin-left: 51.38121546961326%; + *margin-left: 51.27483249088986%; + } + .row-fluid .offset5 { + margin-left: 45.58011049723757%; + *margin-left: 45.47372751851417%; + } + .row-fluid .offset5:first-child { + margin-left: 42.81767955801105%; + *margin-left: 42.71129657928765%; + } + .row-fluid .offset4 { + margin-left: 37.01657458563536%; + *margin-left: 36.91019160691196%; + } + .row-fluid .offset4:first-child { + margin-left: 34.25414364640884%; + *margin-left: 34.14776066768544%; + } + .row-fluid .offset3 { + margin-left: 28.45303867403315%; + *margin-left: 28.346655695309746%; + } + .row-fluid .offset3:first-child { + margin-left: 25.69060773480663%; + *margin-left: 25.584224756083227%; + } + .row-fluid .offset2 { + margin-left: 19.88950276243094%; + *margin-left: 19.783119783707537%; + } + .row-fluid .offset2:first-child { + margin-left: 17.12707182320442%; + *margin-left: 17.02068884448102%; + } + .row-fluid .offset1 { + margin-left: 11.32596685082873%; + *margin-left: 11.219583872105325%; + } + .row-fluid .offset1:first-child { + margin-left: 8.56353591160221%; + *margin-left: 8.457152932878806%; + } + input, + textarea, + .uneditable-input { + margin-left: 0; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 20px; + } + input.span12, + textarea.span12, + .uneditable-input.span12 { + width: 710px; + } + input.span11, + textarea.span11, + .uneditable-input.span11 { + width: 648px; + } + input.span10, + textarea.span10, + .uneditable-input.span10 { + width: 586px; + } + input.span9, + textarea.span9, + .uneditable-input.span9 { + width: 524px; + } + input.span8, + textarea.span8, + .uneditable-input.span8 { + width: 462px; + } + input.span7, + textarea.span7, + .uneditable-input.span7 { + width: 400px; + } + input.span6, + textarea.span6, + .uneditable-input.span6 { + width: 338px; + } + input.span5, + textarea.span5, + .uneditable-input.span5 { + width: 276px; + } + input.span4, + textarea.span4, + .uneditable-input.span4 { + width: 214px; + } + input.span3, + textarea.span3, + .uneditable-input.span3 { + width: 152px; + } + input.span2, + textarea.span2, + .uneditable-input.span2 { + width: 90px; + } + input.span1, + textarea.span1, + .uneditable-input.span1 { + width: 28px; + } +} + +@media (max-width: 767px) { + body { + padding-right: 20px; + padding-left: 20px; + } + .navbar-fixed-top, + .navbar-fixed-bottom { + margin-right: -20px; + margin-left: -20px; + } + .container-fluid { + padding: 0; + } + .dl-horizontal dt { + float: none; + width: auto; + clear: none; + text-align: left; + } + .dl-horizontal dd { + margin-left: 0; + } + .container { + width: auto; + } + .row-fluid { + width: 100%; + } + .row, + .thumbnails { + margin-left: 0; + } + .thumbnails > li { + float: none; + margin-left: 0; + } + [class*="span"], + .row-fluid [class*="span"] { + display: block; + float: none; + width: auto; + margin-left: 0; + } + .span12, + .row-fluid .span12 { + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .input-large, + .input-xlarge, + .input-xxlarge, + input[class*="span"], + select[class*="span"], + textarea[class*="span"], + .uneditable-input { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .input-prepend input, + .input-append input, + .input-prepend input[class*="span"], + .input-append input[class*="span"] { + display: inline-block; + width: auto; + } + .modal { + position: fixed; + top: 20px; + right: 20px; + left: 20px; + width: auto; + margin: 0; + } + .modal.fade.in { + top: auto; + } +} + +@media (max-width: 480px) { + .nav-collapse { + -webkit-transform: translate3d(0, 0, 0); + } + .page-header h1 small { + display: block; + line-height: 20px; + } + input[type="checkbox"], + input[type="radio"] { + border: 1px solid #ccc; + } + .form-horizontal .control-group > label { + float: none; + width: auto; + padding-top: 0; + text-align: left; + } + .form-horizontal .controls { + margin-left: 0; + } + .form-horizontal .control-list { + padding-top: 0; + } + .form-horizontal .form-actions { + padding-right: 10px; + padding-left: 10px; + } + .modal { + top: 10px; + right: 10px; + left: 10px; + } + .modal-header .close { + padding: 10px; + margin: -10px; + } + .carousel-caption { + position: static; + } +} + +@media (max-width: 979px) { + body { + padding-top: 0; + } + .navbar-fixed-top, + .navbar-fixed-bottom { + position: static; + } + .navbar-fixed-top { + margin-bottom: 20px; + } + .navbar-fixed-bottom { + margin-top: 20px; + } + .navbar-fixed-top .navbar-inner, + .navbar-fixed-bottom .navbar-inner { + padding: 5px; + } + .navbar .container { + width: auto; + padding: 0; + } + .navbar .brand { + padding-right: 10px; + padding-left: 10px; + margin: 0 0 0 -5px; + } + .nav-collapse { + clear: both; + } + .nav-collapse .nav { + float: none; + margin: 0 0 10px; + } + .nav-collapse .nav > li { + float: none; + } + .nav-collapse .nav > li > a { + margin-bottom: 2px; + } + .nav-collapse .nav > .divider-vertical { + display: none; + } + .nav-collapse .nav .nav-header { + color: #555555; + text-shadow: none; + } + .nav-collapse .nav > li > a, + .nav-collapse .dropdown-menu a { + padding: 9px 15px; + font-weight: bold; + color: #555555; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + } + .nav-collapse .btn { + padding: 4px 10px 4px; + font-weight: normal; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + } + .nav-collapse .dropdown-menu li + li a { + margin-bottom: 2px; + } + .nav-collapse .nav > li > a:hover, + .nav-collapse .dropdown-menu a:hover { + background-color: #f2f2f2; + } + .navbar-inverse .nav-collapse .nav > li > a:hover, + .navbar-inverse .nav-collapse .dropdown-menu a:hover { + background-color: #111111; + } + .nav-collapse.in .btn-group { + padding: 0; + margin-top: 5px; + } + .nav-collapse .dropdown-menu { + position: static; + top: auto; + left: auto; + display: block; + float: none; + max-width: none; + padding: 0; + margin: 0 15px; + background-color: transparent; + border: none; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + } + .nav-collapse .dropdown-menu:before, + .nav-collapse .dropdown-menu:after { + display: none; + } + .nav-collapse .dropdown-menu .divider { + display: none; + } + .nav-collapse .navbar-form, + .nav-collapse .navbar-search { + float: none; + padding: 10px 15px; + margin: 10px 0; + border-top: 1px solid #f2f2f2; + border-bottom: 1px solid #f2f2f2; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + } + .navbar .nav-collapse .nav.pull-right { + float: none; + margin-left: 0; + } + .nav-collapse, + .nav-collapse.collapse { + height: 0; + overflow: hidden; + } + .navbar .btn-navbar { + display: block; + } + .navbar-static .navbar-inner { + padding-right: 10px; + padding-left: 10px; + } +} + +@media (min-width: 980px) { + .nav-collapse.collapse { + height: auto !important; + overflow: visible !important; + } +} diff --git a/plugins/system/t3/admin/bootstrap/css/bootstrap-responsive.min.css b/plugins/system/t3/admin/bootstrap/css/bootstrap-responsive.min.css new file mode 100644 index 0000000..ab59da3 --- /dev/null +++ b/plugins/system/t3/admin/bootstrap/css/bootstrap-responsive.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap Responsive v2.1.0 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:auto;margin-left:0}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade.in{top:auto}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-group>label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#555;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#555;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:block;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} diff --git a/plugins/system/t3/admin/bootstrap/css/bootstrap.css b/plugins/system/t3/admin/bootstrap/css/bootstrap.css new file mode 100644 index 0000000..6e53b8c --- /dev/null +++ b/plugins/system/t3/admin/bootstrap/css/bootstrap.css @@ -0,0 +1,5165 @@ +/*! + * Bootstrap v2.1.1 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ +.clearfix { + *zoom: 1; +} +.clearfix:before, +.clearfix:after { + display: table; + content: ""; + line-height: 0; +} +.clearfix:after { + clear: both; +} +.hide-text { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.input-block-level { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section { + display: block; +} +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} +audio:not([controls]) { + display: none; +} +html { + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +a:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +a:hover, +a:active { + outline: 0; +} +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + /* Responsive images (ensure images don't scale beyond their parents) */ + + max-width: 100%; + /* Part 1: Set a maxium relative to the parent */ + + width: auto\9; + /* IE7-8 need help adjusting responsive images */ + + height: auto; + /* Part 2: Scale the height according to the width, otherwise you get stretching */ + + vertical-align: middle; + border: 0; + -ms-interpolation-mode: bicubic; +} +#map_canvas img { + max-width: none; +} +button, +input, +select, +textarea { + margin: 0; + font-size: 100%; + vertical-align: middle; +} +button, +input { + *overflow: visible; + line-height: normal; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + padding: 0; + border: 0; +} +button, +input[type="button"], +input[type="reset"], +input[type="submit"] { + cursor: pointer; + -webkit-appearance: button; +} +input[type="search"] { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; +} +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; +} +textarea { + overflow: auto; + vertical-align: top; +} +.row { + margin-left: -20px; + *zoom: 1; +} +.row:before, +.row:after { + display: table; + content: ""; + line-height: 0; +} +.row:after { + clear: both; +} +[class*="span"] { + float: left; + min-height: 1px; + margin-left: 20px; +} +.container, +.navbar-static-top .container, +.navbar-fixed-top .container, +.navbar-fixed-bottom .container { + width: 940px; +} +.span12 { + width: 940px; +} +.span11 { + width: 860px; +} +.span10 { + width: 780px; +} +.span9 { + width: 700px; +} +.span8 { + width: 620px; +} +.span7 { + width: 540px; +} +.span6 { + width: 460px; +} +.span5 { + width: 380px; +} +.span4 { + width: 300px; +} +.span3 { + width: 220px; +} +.span2 { + width: 140px; +} +.span1 { + width: 60px; +} +.offset12 { + margin-left: 980px; +} +.offset11 { + margin-left: 900px; +} +.offset10 { + margin-left: 820px; +} +.offset9 { + margin-left: 740px; +} +.offset8 { + margin-left: 660px; +} +.offset7 { + margin-left: 580px; +} +.offset6 { + margin-left: 500px; +} +.offset5 { + margin-left: 420px; +} +.offset4 { + margin-left: 340px; +} +.offset3 { + margin-left: 260px; +} +.offset2 { + margin-left: 180px; +} +.offset1 { + margin-left: 100px; +} +.row-fluid { + width: 100%; + *zoom: 1; +} +.row-fluid:before, +.row-fluid:after { + display: table; + content: ""; + line-height: 0; +} +.row-fluid:after { + clear: both; +} +.row-fluid [class*="span"] { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + float: left; + margin-left: 2.127659574468085%; + *margin-left: 2.074468085106383%; +} +.row-fluid [class*="span"]:first-child { + margin-left: 0; +} +.row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; +} +.row-fluid .span11 { + width: 91.48936170212765%; + *width: 91.43617021276594%; +} +.row-fluid .span10 { + width: 82.97872340425532%; + *width: 82.92553191489361%; +} +.row-fluid .span9 { + width: 74.46808510638297%; + *width: 74.41489361702126%; +} +.row-fluid .span8 { + width: 65.95744680851064%; + *width: 65.90425531914893%; +} +.row-fluid .span7 { + width: 57.44680851063829%; + *width: 57.39361702127659%; +} +.row-fluid .span6 { + width: 48.93617021276595%; + *width: 48.88297872340425%; +} +.row-fluid .span5 { + width: 40.42553191489362%; + *width: 40.37234042553192%; +} +.row-fluid .span4 { + width: 31.914893617021278%; + *width: 31.861702127659576%; +} +.row-fluid .span3 { + width: 23.404255319148934%; + *width: 23.351063829787233%; +} +.row-fluid .span2 { + width: 14.893617021276595%; + *width: 14.840425531914894%; +} +.row-fluid .span1 { + width: 6.382978723404255%; + *width: 6.329787234042553%; +} +.row-fluid .offset12 { + margin-left: 104.25531914893617%; + *margin-left: 104.14893617021275%; +} +.row-fluid .offset12:first-child { + margin-left: 102.12765957446808%; + *margin-left: 102.02127659574467%; +} +.row-fluid .offset11 { + margin-left: 95.74468085106382%; + *margin-left: 95.6382978723404%; +} +.row-fluid .offset11:first-child { + margin-left: 93.61702127659574%; + *margin-left: 93.51063829787232%; +} +.row-fluid .offset10 { + margin-left: 87.23404255319149%; + *margin-left: 87.12765957446807%; +} +.row-fluid .offset10:first-child { + margin-left: 85.1063829787234%; + *margin-left: 84.99999999999999%; +} +.row-fluid .offset9 { + margin-left: 78.72340425531914%; + *margin-left: 78.61702127659572%; +} +.row-fluid .offset9:first-child { + margin-left: 76.59574468085106%; + *margin-left: 76.48936170212764%; +} +.row-fluid .offset8 { + margin-left: 70.2127659574468%; + *margin-left: 70.10638297872339%; +} +.row-fluid .offset8:first-child { + margin-left: 68.08510638297872%; + *margin-left: 67.9787234042553%; +} +.row-fluid .offset7 { + margin-left: 61.70212765957446%; + *margin-left: 61.59574468085106%; +} +.row-fluid .offset7:first-child { + margin-left: 59.574468085106375%; + *margin-left: 59.46808510638297%; +} +.row-fluid .offset6 { + margin-left: 53.191489361702125%; + *margin-left: 53.085106382978715%; +} +.row-fluid .offset6:first-child { + margin-left: 51.063829787234035%; + *margin-left: 50.95744680851063%; +} +.row-fluid .offset5 { + margin-left: 44.68085106382979%; + *margin-left: 44.57446808510638%; +} +.row-fluid .offset5:first-child { + margin-left: 42.5531914893617%; + *margin-left: 42.4468085106383%; +} +.row-fluid .offset4 { + margin-left: 36.170212765957444%; + *margin-left: 36.06382978723405%; +} +.row-fluid .offset4:first-child { + margin-left: 34.04255319148936%; + *margin-left: 33.93617021276596%; +} +.row-fluid .offset3 { + margin-left: 27.659574468085104%; + *margin-left: 27.5531914893617%; +} +.row-fluid .offset3:first-child { + margin-left: 25.53191489361702%; + *margin-left: 25.425531914893618%; +} +.row-fluid .offset2 { + margin-left: 19.148936170212764%; + *margin-left: 19.04255319148936%; +} +.row-fluid .offset2:first-child { + margin-left: 17.02127659574468%; + *margin-left: 16.914893617021278%; +} +.row-fluid .offset1 { + margin-left: 10.638297872340425%; + *margin-left: 10.53191489361702%; +} +.row-fluid .offset1:first-child { + margin-left: 8.51063829787234%; + *margin-left: 8.404255319148938%; +} +[class*="span"].hide, +.row-fluid [class*="span"].hide { + display: none; +} +[class*="span"].pull-right, +.row-fluid [class*="span"].pull-right { + float: right; +} +.container { + margin-right: auto; + margin-left: auto; + *zoom: 1; +} +.container:before, +.container:after { + display: table; + content: ""; + line-height: 0; +} +.container:after { + clear: both; +} +.container-fluid { + padding-right: 20px; + padding-left: 20px; + *zoom: 1; +} +.container-fluid:before, +.container-fluid:after { + display: table; + content: ""; + line-height: 0; +} +.container-fluid:after { + clear: both; +} +p { + margin: 0 0 10px; +} +.lead { + margin-bottom: 20px; + font-size: 21px; + font-weight: 200; + line-height: 30px; +} +small { + font-size: 85%; +} +strong { + font-weight: bold; +} +em { + font-style: italic; +} +cite { + font-style: normal; +} +.muted { + color: #999999; +} +.text-warning { + color: #c09853; +} +.text-error { + color: #b94a48; +} +.text-info { + color: #3a87ad; +} +.text-success { + color: #468847; +} +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 10px 0; + font-family: inherit; + font-weight: bold; + line-height: 1; + color: inherit; + text-rendering: optimizelegibility; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small { + font-weight: normal; + line-height: 1; + color: #999999; +} +h1 { + font-size: 36px; + line-height: 40px; +} +h2 { + font-size: 30px; + line-height: 40px; +} +h3 { + font-size: 24px; + line-height: 40px; +} +h4 { + font-size: 18px; + line-height: 20px; +} +h5 { + font-size: 14px; + line-height: 20px; +} +h6 { + font-size: 12px; + line-height: 20px; +} +h1 small { + font-size: 24px; +} +h2 small { + font-size: 18px; +} +h3 small { + font-size: 14px; +} +h4 small { + font-size: 14px; +} +.page-header { + padding-bottom: 9px; + margin: 20px 0 30px; + border-bottom: 1px solid #eeeeee; +} +ul, +ol { + padding: 0; + margin: 0 0 10px 25px; +} +ul ul, +ul ol, +ol ol, +ol ul { + margin-bottom: 0; +} +li { + line-height: 20px; +} +ul.unstyled, +ol.unstyled { + margin-left: 0; + list-style: none; +} +dl { + margin-bottom: 20px; +} +dt, +dd { + line-height: 20px; +} +dt { + font-weight: bold; +} +dd { + margin-left: 10px; +} +.dl-horizontal { + *zoom: 1; +} +.dl-horizontal:before, +.dl-horizontal:after { + display: table; + content: ""; + line-height: 0; +} +.dl-horizontal:after { + clear: both; +} +.dl-horizontal dt { + float: left; + width: 160px; + clear: left; + text-align: right; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.dl-horizontal dd { + margin-left: 180px; +} +hr { + margin: 20px 0; + border: 0; + border-top: 1px solid #eeeeee; + border-bottom: 1px solid #ffffff; +} +abbr[title] { + cursor: help; + border-bottom: 1px dotted #999999; +} +abbr.initialism { + font-size: 90%; + text-transform: uppercase; +} +blockquote { + padding: 0 0 0 15px; + margin: 0 0 20px; + border-left: 5px solid #eeeeee; +} +blockquote p { + margin-bottom: 0; + font-size: 16px; + font-weight: 300; + line-height: 25px; +} +blockquote small { + display: block; + line-height: 20px; + color: #999999; +} +blockquote small:before { + content: '\2014 \00A0'; +} +blockquote.pull-right { + float: right; + padding-right: 15px; + padding-left: 0; + border-right: 5px solid #eeeeee; + border-left: 0; +} +blockquote.pull-right p, +blockquote.pull-right small { + text-align: right; +} +blockquote.pull-right small:before { + content: ''; +} +blockquote.pull-right small:after { + content: '\00A0 \2014'; +} +q:before, +q:after, +blockquote:before, +blockquote:after { + content: ""; +} +address { + display: block; + margin-bottom: 20px; + font-style: normal; + line-height: 20px; +} +code, +pre { + padding: 0 3px 2px; + font-family: Monaco, Menlo, Consolas, "Courier New", monospace; + font-size: 12px; + color: #333333; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +code { + padding: 2px 4px; + color: #d14; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; +} +pre { + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 20px; + word-break: break-all; + word-wrap: break-word; + white-space: pre; + white-space: pre-wrap; + background-color: #f5f5f5; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.15); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +pre.prettyprint { + margin-bottom: 20px; +} +pre code { + padding: 0; + color: inherit; + background-color: transparent; + border: 0; +} +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} +.label, +.badge { + font-size: 11.844px; + font-weight: bold; + line-height: 14px; + color: #ffffff; + vertical-align: baseline; + white-space: nowrap; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #999999; +} +.label { + padding: 1px 4px 2px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.badge { + padding: 1px 9px 2px; + -webkit-border-radius: 9px; + -moz-border-radius: 9px; + border-radius: 9px; +} +a.label:hover, +a.badge:hover { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +.label-important, +.badge-important { + background-color: #b94a48; +} +.label-important[href], +.badge-important[href] { + background-color: #953b39; +} +.label-warning, +.badge-warning { + background-color: #ff8800; +} +.label-warning[href], +.badge-warning[href] { + background-color: #cc6d00; +} +.label-success, +.badge-success { + background-color: #468847; +} +.label-success[href], +.badge-success[href] { + background-color: #356635; +} +.label-info, +.badge-info { + background-color: #3a87ad; +} +.label-info[href], +.badge-info[href] { + background-color: #2d6987; +} +.label-inverse, +.badge-inverse { + background-color: #333333; +} +.label-inverse[href], +.badge-inverse[href] { + background-color: #1a1a1a; +} +.btn .label, +.btn .badge { + position: relative; + top: -1px; +} +.btn-mini .label, +.btn-mini .badge { + top: 0; +} +table { + max-width: 100%; + background-color: transparent; + border-collapse: collapse; + border-spacing: 0; +} +.table { + width: 100%; + margin-bottom: 20px; +} +.table th, +.table td { + padding: 8px; + line-height: 20px; + text-align: left; + vertical-align: top; + border-top: 1px solid #dddddd; +} +.table th { + font-weight: bold; +} +.table thead th { + vertical-align: bottom; +} +.table caption + thead tr:first-child th, +.table caption + thead tr:first-child td, +.table colgroup + thead tr:first-child th, +.table colgroup + thead tr:first-child td, +.table thead:first-child tr:first-child th, +.table thead:first-child tr:first-child td { + border-top: 0; +} +.table tbody + tbody { + border-top: 2px solid #dddddd; +} +.table-condensed th, +.table-condensed td { + padding: 4px 5px; +} +.table-bordered { + border: 1px solid #dddddd; + border-collapse: separate; + *border-collapse: collapse; + border-left: 0; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.table-bordered th, +.table-bordered td { + border-left: 1px solid #dddddd; +} +.table-bordered caption + thead tr:first-child th, +.table-bordered caption + tbody tr:first-child th, +.table-bordered caption + tbody tr:first-child td, +.table-bordered colgroup + thead tr:first-child th, +.table-bordered colgroup + tbody tr:first-child th, +.table-bordered colgroup + tbody tr:first-child td, +.table-bordered thead:first-child tr:first-child th, +.table-bordered tbody:first-child tr:first-child th, +.table-bordered tbody:first-child tr:first-child td { + border-top: 0; +} +.table-bordered thead:first-child tr:first-child th:first-child, +.table-bordered tbody:first-child tr:first-child td:first-child { + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; +} +.table-bordered thead:first-child tr:first-child th:last-child, +.table-bordered tbody:first-child tr:first-child td:last-child { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; +} +.table-bordered thead:last-child tr:last-child th:first-child, +.table-bordered tbody:last-child tr:last-child td:first-child, +.table-bordered tfoot:last-child tr:last-child td:first-child { + -webkit-border-radius: 0 0 0 4px; + -moz-border-radius: 0 0 0 4px; + border-radius: 0 0 0 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; +} +.table-bordered thead:last-child tr:last-child th:last-child, +.table-bordered tbody:last-child tr:last-child td:last-child, +.table-bordered tfoot:last-child tr:last-child td:last-child { + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; +} +.table-bordered caption + thead tr:first-child th:first-child, +.table-bordered caption + tbody tr:first-child td:first-child, +.table-bordered colgroup + thead tr:first-child th:first-child, +.table-bordered colgroup + tbody tr:first-child td:first-child { + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; +} +.table-bordered caption + thead tr:first-child th:last-child, +.table-bordered caption + tbody tr:first-child td:last-child, +.table-bordered colgroup + thead tr:first-child th:last-child, +.table-bordered colgroup + tbody tr:first-child td:last-child { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-radius-topleft: 4px; +} +.table-striped tbody tr:nth-child(odd) td, +.table-striped tbody tr:nth-child(odd) th { + background-color: #f9f9f9; +} +.table-hover tbody tr:hover td, +.table-hover tbody tr:hover th { + background-color: #f5f5f5; +} +table [class*=span], +.row-fluid table [class*=span] { + display: table-cell; + float: none; + margin-left: 0; +} +.table .span1 { + float: none; + width: 44px; + margin-left: 0; +} +.table .span2 { + float: none; + width: 124px; + margin-left: 0; +} +.table .span3 { + float: none; + width: 204px; + margin-left: 0; +} +.table .span4 { + float: none; + width: 284px; + margin-left: 0; +} +.table .span5 { + float: none; + width: 364px; + margin-left: 0; +} +.table .span6 { + float: none; + width: 444px; + margin-left: 0; +} +.table .span7 { + float: none; + width: 524px; + margin-left: 0; +} +.table .span8 { + float: none; + width: 604px; + margin-left: 0; +} +.table .span9 { + float: none; + width: 684px; + margin-left: 0; +} +.table .span10 { + float: none; + width: 764px; + margin-left: 0; +} +.table .span11 { + float: none; + width: 844px; + margin-left: 0; +} +.table .span12 { + float: none; + width: 924px; + margin-left: 0; +} +.table .span13 { + float: none; + width: 1004px; + margin-left: 0; +} +.table .span14 { + float: none; + width: 1084px; + margin-left: 0; +} +.table .span15 { + float: none; + width: 1164px; + margin-left: 0; +} +.table .span16 { + float: none; + width: 1244px; + margin-left: 0; +} +.table .span17 { + float: none; + width: 1324px; + margin-left: 0; +} +.table .span18 { + float: none; + width: 1404px; + margin-left: 0; +} +.table .span19 { + float: none; + width: 1484px; + margin-left: 0; +} +.table .span20 { + float: none; + width: 1564px; + margin-left: 0; +} +.table .span21 { + float: none; + width: 1644px; + margin-left: 0; +} +.table .span22 { + float: none; + width: 1724px; + margin-left: 0; +} +.table .span23 { + float: none; + width: 1804px; + margin-left: 0; +} +.table .span24 { + float: none; + width: 1884px; + margin-left: 0; +} +.table tbody tr.success td { + background-color: #dff0d8; +} +.table tbody tr.error td { + background-color: #f2dede; +} +.table tbody tr.warning td { + background-color: #fcf8e3; +} +.table tbody tr.info td { + background-color: #d9edf7; +} +.table-hover tbody tr.success:hover td { + background-color: #d0e9c6; +} +.table-hover tbody tr.error:hover td { + background-color: #ebcccc; +} +.table-hover tbody tr.warning:hover td { + background-color: #faf2cc; +} +.table-hover tbody tr.info:hover td { + background-color: #c4e3f3; +} +form { + margin: 0 0 20px; +} +fieldset { + padding: 0; + margin: 0; + border: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 21px; + line-height: 40px; + color: #333333; + border: 0; + border-bottom: 1px solid #e5e5e5; +} +legend small { + font-size: 15px; + color: #999999; +} +label, +input, +button, +select, +textarea { + font-size: 14px; + font-weight: normal; + line-height: 20px; +} +input, +button, +select, +textarea { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} +label { + display: block; + margin-bottom: 5px; +} +select, +textarea, +input[type="text"], +input[type="password"], +input[type="datetime"], +input[type="datetime-local"], +input[type="date"], +input[type="month"], +input[type="time"], +input[type="week"], +input[type="number"], +input[type="email"], +input[type="url"], +input[type="search"], +input[type="tel"], +input[type="color"], +.uneditable-input { + display: inline-block; + height: 20px; + padding: 4px 6px; + margin-bottom: 9px; + font-size: 14px; + line-height: 20px; + color: #555555; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +input, +textarea, +.uneditable-input { + width: 206px; +} +textarea { + height: auto; +} +textarea, +input[type="text"], +input[type="password"], +input[type="datetime"], +input[type="datetime-local"], +input[type="date"], +input[type="month"], +input[type="time"], +input[type="week"], +input[type="number"], +input[type="email"], +input[type="url"], +input[type="search"], +input[type="tel"], +input[type="color"], +.uneditable-input { + background-color: #ffffff; + border: 1px solid #cccccc; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border linear .2s, box-shadow linear .2s; + -moz-transition: border linear .2s, box-shadow linear .2s; + -o-transition: border linear .2s, box-shadow linear .2s; + transition: border linear .2s, box-shadow linear .2s; +} +textarea:focus, +input[type="text"]:focus, +input[type="password"]:focus, +input[type="datetime"]:focus, +input[type="datetime-local"]:focus, +input[type="date"]:focus, +input[type="month"]:focus, +input[type="time"]:focus, +input[type="week"]:focus, +input[type="number"]:focus, +input[type="email"]:focus, +input[type="url"]:focus, +input[type="search"]:focus, +input[type="tel"]:focus, +input[type="color"]:focus, +.uneditable-input:focus { + border-color: rgba(82, 168, 236, 0.8); + outline: 0; + outline: thin dotted \9; + /* IE6-9 */ + + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); +} +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + *margin-top: 0; + /* IE7 */ + + margin-top: 1px \9; + /* IE8-9 */ + + line-height: normal; + cursor: pointer; +} +input[type="file"], +input[type="image"], +input[type="submit"], +input[type="reset"], +input[type="button"], +input[type="radio"], +input[type="checkbox"] { + width: auto; +} +select, +input[type="file"] { + height: 30px; + /* In IE7, the height of the select element cannot be changed by height, only font-size */ + + *margin-top: 4px; + /* For IE7, add top margin to align select with labels */ + + line-height: 30px; +} +select { + width: 220px; + border: 1px solid #cccccc; + background-color: #ffffff; +} +select[multiple], +select[size] { + height: auto; +} +select:focus, +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.uneditable-input, +.uneditable-textarea { + color: #999999; + background-color: #fcfcfc; + border-color: #cccccc; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + cursor: not-allowed; +} +.uneditable-input { + overflow: hidden; + white-space: nowrap; +} +.uneditable-textarea { + width: auto; + height: auto; +} +input:-moz-placeholder, +textarea:-moz-placeholder { + color: #999999; +} +input:-ms-input-placeholder, +textarea:-ms-input-placeholder { + color: #999999; +} +input::-webkit-input-placeholder, +textarea::-webkit-input-placeholder { + color: #999999; +} +.radio, +.checkbox { + min-height: 18px; + padding-left: 18px; +} +.radio input[type="radio"], +.checkbox input[type="checkbox"] { + float: left; + margin-left: -18px; +} +.controls > .radio:first-child, +.controls > .checkbox:first-child { + padding-top: 5px; +} +.radio.inline, +.checkbox.inline { + display: inline-block; + padding-top: 5px; + margin-bottom: 0; + vertical-align: middle; +} +.radio.inline + .radio.inline, +.checkbox.inline + .checkbox.inline { + margin-left: 10px; +} +.input-mini { + width: 60px; +} +.input-small { + width: 90px; +} +.input-medium { + width: 150px; +} +.input-large { + width: 210px; +} +.input-xlarge { + width: 270px; +} +.input-xxlarge { + width: 530px; +} +input[class*="span"], +select[class*="span"], +textarea[class*="span"], +.uneditable-input[class*="span"], +.row-fluid input[class*="span"], +.row-fluid select[class*="span"], +.row-fluid textarea[class*="span"], +.row-fluid .uneditable-input[class*="span"] { + float: none; + margin-left: 0; +} +.input-append input[class*="span"], +.input-append .uneditable-input[class*="span"], +.input-prepend input[class*="span"], +.input-prepend .uneditable-input[class*="span"], +.row-fluid input[class*="span"], +.row-fluid select[class*="span"], +.row-fluid textarea[class*="span"], +.row-fluid .uneditable-input[class*="span"], +.row-fluid .input-prepend [class*="span"], +.row-fluid .input-append [class*="span"] { + display: inline-block; +} +input, +textarea, +.uneditable-input { + margin-left: 0; +} +.controls-row [class*="span"] + [class*="span"] { + margin-left: 20px; +} +input.span12, textarea.span12, .uneditable-input.span12 { + width: 926px; +} +input.span11, textarea.span11, .uneditable-input.span11 { + width: 846px; +} +input.span10, textarea.span10, .uneditable-input.span10 { + width: 766px; +} +input.span9, textarea.span9, .uneditable-input.span9 { + width: 686px; +} +input.span8, textarea.span8, .uneditable-input.span8 { + width: 606px; +} +input.span7, textarea.span7, .uneditable-input.span7 { + width: 526px; +} +input.span6, textarea.span6, .uneditable-input.span6 { + width: 446px; +} +input.span5, textarea.span5, .uneditable-input.span5 { + width: 366px; +} +input.span4, textarea.span4, .uneditable-input.span4 { + width: 286px; +} +input.span3, textarea.span3, .uneditable-input.span3 { + width: 206px; +} +input.span2, textarea.span2, .uneditable-input.span2 { + width: 126px; +} +input.span1, textarea.span1, .uneditable-input.span1 { + width: 46px; +} +.controls-row { + *zoom: 1; +} +.controls-row:before, +.controls-row:after { + display: table; + content: ""; + line-height: 0; +} +.controls-row:after { + clear: both; +} +.controls-row [class*="span"] { + float: left; +} +input[disabled], +select[disabled], +textarea[disabled], +input[readonly], +select[readonly], +textarea[readonly] { + cursor: not-allowed; + background-color: #eeeeee; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"][readonly], +input[type="checkbox"][readonly] { + background-color: transparent; +} +.control-group.warning > label, +.control-group.warning .help-block, +.control-group.warning .help-inline { + color: #c09853; +} +.control-group.warning .checkbox, +.control-group.warning .radio, +.control-group.warning input, +.control-group.warning select, +.control-group.warning textarea { + color: #c09853; +} +.control-group.warning input, +.control-group.warning select, +.control-group.warning textarea { + border-color: #c09853; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.control-group.warning input:focus, +.control-group.warning select:focus, +.control-group.warning textarea:focus { + border-color: #a47e3c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; +} +.control-group.warning .input-prepend .add-on, +.control-group.warning .input-append .add-on { + color: #c09853; + background-color: #fcf8e3; + border-color: #c09853; +} +.control-group.error > label, +.control-group.error .help-block, +.control-group.error .help-inline { + color: #b94a48; +} +.control-group.error .checkbox, +.control-group.error .radio, +.control-group.error input, +.control-group.error select, +.control-group.error textarea { + color: #b94a48; +} +.control-group.error input, +.control-group.error select, +.control-group.error textarea { + border-color: #b94a48; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.control-group.error input:focus, +.control-group.error select:focus, +.control-group.error textarea:focus { + border-color: #953b39; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; +} +.control-group.error .input-prepend .add-on, +.control-group.error .input-append .add-on { + color: #b94a48; + background-color: #f2dede; + border-color: #b94a48; +} +.control-group.success > label, +.control-group.success .help-block, +.control-group.success .help-inline { + color: #468847; +} +.control-group.success .checkbox, +.control-group.success .radio, +.control-group.success input, +.control-group.success select, +.control-group.success textarea { + color: #468847; +} +.control-group.success input, +.control-group.success select, +.control-group.success textarea { + border-color: #468847; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.control-group.success input:focus, +.control-group.success select:focus, +.control-group.success textarea:focus { + border-color: #356635; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; +} +.control-group.success .input-prepend .add-on, +.control-group.success .input-append .add-on { + color: #468847; + background-color: #dff0d8; + border-color: #468847; +} +.control-group.info > label, +.control-group.info .help-block, +.control-group.info .help-inline { + color: #3a87ad; +} +.control-group.info .checkbox, +.control-group.info .radio, +.control-group.info input, +.control-group.info select, +.control-group.info textarea { + color: #3a87ad; +} +.control-group.info input, +.control-group.info select, +.control-group.info textarea { + border-color: #3a87ad; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.control-group.info input:focus, +.control-group.info select:focus, +.control-group.info textarea:focus { + border-color: #2d6987; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; +} +.control-group.info .input-prepend .add-on, +.control-group.info .input-append .add-on { + color: #3a87ad; + background-color: #d9edf7; + border-color: #3a87ad; +} +input:focus:required:invalid, +textarea:focus:required:invalid, +select:focus:required:invalid { + color: #b94a48; + border-color: #ee5f5b; +} +input:focus:required:invalid:focus, +textarea:focus:required:invalid:focus, +select:focus:required:invalid:focus { + border-color: #e9322d; + -webkit-box-shadow: 0 0 6px #f8b9b7; + -moz-box-shadow: 0 0 6px #f8b9b7; + box-shadow: 0 0 6px #f8b9b7; +} +.form-actions { + padding: 19px 20px 20px; + margin-top: 20px; + margin-bottom: 20px; + background-color: #f5f5f5; + border-top: 1px solid #e5e5e5; + *zoom: 1; +} +.form-actions:before, +.form-actions:after { + display: table; + content: ""; + line-height: 0; +} +.form-actions:after { + clear: both; +} +.help-block, +.help-inline { + color: #595959; +} +.help-block { + display: block; + margin-bottom: 10px; +} +.help-inline { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + vertical-align: middle; + padding-left: 5px; +} +.input-append, +.input-prepend { + margin-bottom: 5px; + font-size: 0; + white-space: nowrap; +} +.input-append input, +.input-prepend input, +.input-append select, +.input-prepend select, +.input-append .uneditable-input, +.input-prepend .uneditable-input { + position: relative; + margin-bottom: 0; + *margin-left: 0; + font-size: 14px; + vertical-align: top; + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.input-append input:focus, +.input-prepend input:focus, +.input-append select:focus, +.input-prepend select:focus, +.input-append .uneditable-input:focus, +.input-prepend .uneditable-input:focus { + z-index: 2; +} +.input-append .add-on, +.input-prepend .add-on { + display: inline-block; + width: auto; + height: 20px; + min-width: 16px; + padding: 4px 5px; + font-size: 14px; + font-weight: normal; + line-height: 20px; + text-align: center; + text-shadow: 0 1px 0 #ffffff; + background-color: #eeeeee; + border: 1px solid #ccc; +} +.input-append .add-on, +.input-prepend .add-on, +.input-append .btn, +.input-prepend .btn { + vertical-align: top; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.input-append .active, +.input-prepend .active { + background-color: #bbff33; + border-color: #669900; +} +.input-prepend .add-on, +.input-prepend .btn { + margin-right: -1px; +} +.input-prepend .add-on:first-child, +.input-prepend .btn:first-child { + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-append input, +.input-append select, +.input-append .uneditable-input { + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-append .add-on, +.input-append .btn { + margin-left: -1px; +} +.input-append .add-on:last-child, +.input-append .btn:last-child { + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.input-prepend.input-append input, +.input-prepend.input-append select, +.input-prepend.input-append .uneditable-input { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.input-prepend.input-append .add-on:first-child, +.input-prepend.input-append .btn:first-child { + margin-right: -1px; + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-prepend.input-append .add-on:last-child, +.input-prepend.input-append .btn:last-child { + margin-left: -1px; + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +input.search-query { + padding-right: 14px; + padding-right: 4px \9; + padding-left: 14px; + padding-left: 4px \9; + /* IE7-8 doesn't have border-radius, so don't indent the padding */ + + margin-bottom: 0; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} +/* Allow for input prepend/append in search forms */ +.form-search .input-append .search-query, +.form-search .input-prepend .search-query { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.form-search .input-append .search-query { + -webkit-border-radius: 14px 0 0 14px; + -moz-border-radius: 14px 0 0 14px; + border-radius: 14px 0 0 14px; +} +.form-search .input-append .btn { + -webkit-border-radius: 0 14px 14px 0; + -moz-border-radius: 0 14px 14px 0; + border-radius: 0 14px 14px 0; +} +.form-search .input-prepend .search-query { + -webkit-border-radius: 0 14px 14px 0; + -moz-border-radius: 0 14px 14px 0; + border-radius: 0 14px 14px 0; +} +.form-search .input-prepend .btn { + -webkit-border-radius: 14px 0 0 14px; + -moz-border-radius: 14px 0 0 14px; + border-radius: 14px 0 0 14px; +} +.form-search input, +.form-inline input, +.form-horizontal input, +.form-search textarea, +.form-inline textarea, +.form-horizontal textarea, +.form-search select, +.form-inline select, +.form-horizontal select, +.form-search .help-inline, +.form-inline .help-inline, +.form-horizontal .help-inline, +.form-search .uneditable-input, +.form-inline .uneditable-input, +.form-horizontal .uneditable-input, +.form-search .input-prepend, +.form-inline .input-prepend, +.form-horizontal .input-prepend, +.form-search .input-append, +.form-inline .input-append, +.form-horizontal .input-append { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + margin-bottom: 0; + vertical-align: middle; +} +.form-search .hide, +.form-inline .hide, +.form-horizontal .hide { + display: none; +} +.form-search label, +.form-inline label, +.form-search .btn-group, +.form-inline .btn-group { + display: inline-block; +} +.form-search .input-append, +.form-inline .input-append, +.form-search .input-prepend, +.form-inline .input-prepend { + margin-bottom: 0; +} +.form-search .radio, +.form-search .checkbox, +.form-inline .radio, +.form-inline .checkbox { + padding-left: 0; + margin-bottom: 0; + vertical-align: middle; +} +.form-search .radio input[type="radio"], +.form-search .checkbox input[type="checkbox"], +.form-inline .radio input[type="radio"], +.form-inline .checkbox input[type="checkbox"] { + float: left; + margin-right: 3px; + margin-left: 0; +} +.control-group { + margin-bottom: 10px; +} +legend + .control-group { + margin-top: 20px; + -webkit-margin-top-collapse: separate; +} +.form-horizontal .control-group { + margin-bottom: 20px; + *zoom: 1; +} +.form-horizontal .control-group:before, +.form-horizontal .control-group:after { + display: table; + content: ""; + line-height: 0; +} +.form-horizontal .control-group:after { + clear: both; +} +.form-horizontal .control-label { + float: left; + width: 160px; + padding-top: 5px; + text-align: right; +} +.form-horizontal .controls { + *display: inline-block; + *padding-left: 20px; + margin-left: 180px; + *margin-left: 0; +} +.form-horizontal .controls:first-child { + *padding-left: 180px; +} +.form-horizontal .help-block { + margin-bottom: 0; +} +.form-horizontal input + .help-block, +.form-horizontal select + .help-block, +.form-horizontal textarea + .help-block { + margin-top: 10px; +} +.form-horizontal .form-actions { + padding-left: 180px; +} +.btn { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + padding: 4px 14px; + margin-bottom: 0; + font-size: 14px; + line-height: 20px; + *line-height: 20px; + text-align: center; + vertical-align: middle; + cursor: pointer; + color: #333333; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + background-color: #f5f5f5; + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); + background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); + border-color: #e6e6e6 #e6e6e6 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #e6e6e6; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + border: 1px solid #bbbbbb; + *border: 0; + border-bottom-color: #a2a2a2; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + *margin-left: .3em; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); +} +.btn:hover, +.btn:active, +.btn.active, +.btn.disabled, +.btn[disabled] { + color: #333333; + background-color: #e6e6e6; + *background-color: #d9d9d9; +} +.btn:active, +.btn.active { + background-color: #cccccc \9; +} +.btn:first-child { + *margin-left: 0; +} +.btn:hover { + color: #333333; + text-decoration: none; + background-color: #e6e6e6; + *background-color: #d9d9d9; + /* Buttons in IE7 don't get borders, so darken on hover */ + + background-position: 0 -15px; + -webkit-transition: background-position 0.1s linear; + -moz-transition: background-position 0.1s linear; + -o-transition: background-position 0.1s linear; + transition: background-position 0.1s linear; +} +.btn:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn.active, +.btn:active { + background-color: #e6e6e6; + background-color: #d9d9d9 \9; + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); +} +.btn.disabled, +.btn[disabled] { + cursor: default; + background-color: #e6e6e6; + background-image: none; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.btn-large { + padding: 9px 14px; + font-size: 16px; + line-height: normal; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.btn-large [class^="icon-"] { + margin-top: 2px; +} +.btn-small { + padding: 3px 9px; + font-size: 12px; + line-height: 18px; +} +.btn-small [class^="icon-"] { + margin-top: 0; +} +.btn-mini { + padding: 2px 6px; + font-size: 11px; + line-height: 17px; +} +.btn-block { + display: block; + width: 100%; + padding-left: 0; + padding-right: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} +.btn-primary.active, +.btn-warning.active, +.btn-danger.active, +.btn-success.active, +.btn-info.active, +.btn-inverse.active { + color: rgba(255, 255, 255, 0.75); +} +.btn { + border-color: #c5c5c5; + border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); +} +.btn-primary { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #008ada; + background-image: -moz-linear-gradient(top, #0097ee, #0077bb); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0097ee), to(#0077bb)); + background-image: -webkit-linear-gradient(top, #0097ee, #0077bb); + background-image: -o-linear-gradient(top, #0097ee, #0077bb); + background-image: linear-gradient(to bottom, #0097ee, #0077bb); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0097ee', endColorstr='#ff0077bb', GradientType=0); + border-color: #0077bb #0077bb #00466e; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #0077bb; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.btn-primary:hover, +.btn-primary:active, +.btn-primary.active, +.btn-primary.disabled, +.btn-primary[disabled] { + color: #ffffff; + background-color: #0077bb; + *background-color: #0067a2; +} +.btn-primary:active, +.btn-primary.active { + background-color: #005788 \9; +} +.btn-warning { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #ff9d2e; + background-image: -moz-linear-gradient(top, #ffac4d, #ff8800); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffac4d), to(#ff8800)); + background-image: -webkit-linear-gradient(top, #ffac4d, #ff8800); + background-image: -o-linear-gradient(top, #ffac4d, #ff8800); + background-image: linear-gradient(to bottom, #ffac4d, #ff8800); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffac4d', endColorstr='#ffff8800', GradientType=0); + border-color: #ff8800 #ff8800 #b35f00; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #ff8800; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.btn-warning:hover, +.btn-warning:active, +.btn-warning.active, +.btn-warning.disabled, +.btn-warning[disabled] { + color: #ffffff; + background-color: #ff8800; + *background-color: #e67a00; +} +.btn-warning:active, +.btn-warning.active { + background-color: #cc6d00 \9; +} +.btn-danger { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #da4f49; + background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); + background-image: linear-gradient(to bottom, #ee5f5b, #bd362f); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0); + border-color: #bd362f #bd362f #802420; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #bd362f; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.btn-danger:hover, +.btn-danger:active, +.btn-danger.active, +.btn-danger.disabled, +.btn-danger[disabled] { + color: #ffffff; + background-color: #bd362f; + *background-color: #a9302a; +} +.btn-danger:active, +.btn-danger.active { + background-color: #942a25 \9; +} +.btn-success { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #5bb75b; + background-image: -moz-linear-gradient(top, #62c462, #51a351); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); + background-image: -webkit-linear-gradient(top, #62c462, #51a351); + background-image: -o-linear-gradient(top, #62c462, #51a351); + background-image: linear-gradient(to bottom, #62c462, #51a351); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0); + border-color: #51a351 #51a351 #387038; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #51a351; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.btn-success:hover, +.btn-success:active, +.btn-success.active, +.btn-success.disabled, +.btn-success[disabled] { + color: #ffffff; + background-color: #51a351; + *background-color: #499249; +} +.btn-success:active, +.btn-success.active { + background-color: #408140 \9; +} +.btn-info { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #49afcd; + background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); + background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); + background-image: linear-gradient(to bottom, #5bc0de, #2f96b4); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0); + border-color: #2f96b4 #2f96b4 #1f6377; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #2f96b4; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.btn-info:hover, +.btn-info:active, +.btn-info.active, +.btn-info.disabled, +.btn-info[disabled] { + color: #ffffff; + background-color: #2f96b4; + *background-color: #2a85a0; +} +.btn-info:active, +.btn-info.active { + background-color: #24748c \9; +} +.btn-inverse { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #363636; + background-image: -moz-linear-gradient(top, #444444, #222222); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222)); + background-image: -webkit-linear-gradient(top, #444444, #222222); + background-image: -o-linear-gradient(top, #444444, #222222); + background-image: linear-gradient(to bottom, #444444, #222222); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0); + border-color: #222222 #222222 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #222222; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.btn-inverse:hover, +.btn-inverse:active, +.btn-inverse.active, +.btn-inverse.disabled, +.btn-inverse[disabled] { + color: #ffffff; + background-color: #222222; + *background-color: #151515; +} +.btn-inverse:active, +.btn-inverse.active { + background-color: #080808 \9; +} +button.btn, +input[type="submit"].btn { + *padding-top: 3px; + *padding-bottom: 3px; +} +button.btn::-moz-focus-inner, +input[type="submit"].btn::-moz-focus-inner { + padding: 0; + border: 0; +} +button.btn.btn-large, +input[type="submit"].btn.btn-large { + *padding-top: 7px; + *padding-bottom: 7px; +} +button.btn.btn-small, +input[type="submit"].btn.btn-small { + *padding-top: 3px; + *padding-bottom: 3px; +} +button.btn.btn-mini, +input[type="submit"].btn.btn-mini { + *padding-top: 1px; + *padding-bottom: 1px; +} +.btn-link, +.btn-link:active, +.btn-link[disabled] { + background-color: transparent; + background-image: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.btn-link { + border-color: transparent; + cursor: pointer; + color: #0077bb; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.btn-link:hover { + color: #00466e; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:hover { + color: #333333; + text-decoration: none; +} +.btn-group { + position: relative; + font-size: 0; + vertical-align: middle; + white-space: nowrap; + *margin-left: .3em; +} +.btn-group:first-child { + *margin-left: 0; +} +.btn-group + .btn-group { + margin-left: 5px; +} +.btn-toolbar { + font-size: 0; + margin-top: 10px; + margin-bottom: 10px; +} +.btn-toolbar .btn-group { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; +} +.btn-toolbar .btn + .btn, +.btn-toolbar .btn-group + .btn, +.btn-toolbar .btn + .btn-group { + margin-left: 5px; +} +.btn-group > .btn { + position: relative; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.btn-group > .btn + .btn { + margin-left: -1px; +} +.btn-group > .btn, +.btn-group > .dropdown-menu { + font-size: 14px; +} +.btn-group > .btn-mini { + font-size: 11px; +} +.btn-group > .btn-small { + font-size: 12px; +} +.btn-group > .btn-large { + font-size: 16px; +} +.btn-group > .btn:first-child { + margin-left: 0; + -webkit-border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; + border-top-left-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + border-bottom-left-radius: 4px; +} +.btn-group > .btn:last-child, +.btn-group > .dropdown-toggle { + -webkit-border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; + border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; + border-bottom-right-radius: 4px; +} +.btn-group > .btn.large:first-child { + margin-left: 0; + -webkit-border-top-left-radius: 6px; + -moz-border-radius-topleft: 6px; + border-top-left-radius: 6px; + -webkit-border-bottom-left-radius: 6px; + -moz-border-radius-bottomleft: 6px; + border-bottom-left-radius: 6px; +} +.btn-group > .btn.large:last-child, +.btn-group > .large.dropdown-toggle { + -webkit-border-top-right-radius: 6px; + -moz-border-radius-topright: 6px; + border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + -moz-border-radius-bottomright: 6px; + border-bottom-right-radius: 6px; +} +.btn-group > .btn:hover, +.btn-group > .btn:focus, +.btn-group > .btn:active, +.btn-group > .btn.active { + z-index: 2; +} +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group > .btn + .dropdown-toggle { + padding-left: 8px; + padding-right: 8px; + -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + *padding-top: 5px; + *padding-bottom: 5px; +} +.btn-group > .btn-mini + .dropdown-toggle { + padding-left: 5px; + padding-right: 5px; + *padding-top: 2px; + *padding-bottom: 2px; +} +.btn-group > .btn-small + .dropdown-toggle { + *padding-top: 5px; + *padding-bottom: 4px; +} +.btn-group > .btn-large + .dropdown-toggle { + padding-left: 12px; + padding-right: 12px; + *padding-top: 7px; + *padding-bottom: 7px; +} +.btn-group.open .dropdown-toggle { + background-image: none; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); +} +.btn-group.open .btn.dropdown-toggle { + background-color: #e6e6e6; +} +.btn-group.open .btn-primary.dropdown-toggle { + background-color: #0077bb; +} +.btn-group.open .btn-warning.dropdown-toggle { + background-color: #ff8800; +} +.btn-group.open .btn-danger.dropdown-toggle { + background-color: #bd362f; +} +.btn-group.open .btn-success.dropdown-toggle { + background-color: #51a351; +} +.btn-group.open .btn-info.dropdown-toggle { + background-color: #2f96b4; +} +.btn-group.open .btn-inverse.dropdown-toggle { + background-color: #222222; +} +.btn .caret { + margin-top: 8px; + margin-left: 0; +} +.btn-mini .caret, +.btn-small .caret, +.btn-large .caret { + margin-top: 6px; +} +.btn-large .caret { + border-left-width: 5px; + border-right-width: 5px; + border-top-width: 5px; +} +.dropup .btn-large .caret { + border-bottom: 5px solid #000000; + border-top: 0; +} +.btn-primary .caret, +.btn-warning .caret, +.btn-danger .caret, +.btn-info .caret, +.btn-success .caret, +.btn-inverse .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; +} +.btn-group-vertical { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; +} +.btn-group-vertical .btn { + display: block; + float: none; + width: 100%; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.btn-group-vertical .btn + .btn { + margin-left: 0; + margin-top: -1px; +} +.btn-group-vertical .btn:first-child { + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} +.btn-group-vertical .btn:last-child { + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} +.btn-group-vertical .btn-large:first-child { + -webkit-border-radius: 6px 6px 0 0; + -moz-border-radius: 6px 6px 0 0; + border-radius: 6px 6px 0 0; +} +.btn-group-vertical .btn-large:last-child { + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; +} +.nav { + margin-left: 0; + margin-bottom: 20px; + list-style: none; +} +.nav > li > a { + display: block; +} +.nav > li > a:hover { + text-decoration: none; + background-color: #eeeeee; +} +.nav > .pull-right { + float: right; +} +.nav-header { + display: block; + padding: 3px 15px; + font-size: 11px; + font-weight: bold; + line-height: 20px; + color: #999999; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + text-transform: uppercase; +} +.nav li + .nav-header { + margin-top: 9px; +} +.nav-list { + padding-left: 15px; + padding-right: 15px; + margin-bottom: 0; +} +.nav-list > li > a, +.nav-list .nav-header { + margin-left: -15px; + margin-right: -15px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); +} +.nav-list > li > a { + padding: 3px 15px; +} +.nav-list > .active > a, +.nav-list > .active > a:hover { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); + background-color: #0077bb; +} +.nav-list [class^="icon-"] { + margin-right: 2px; +} +.nav-list .divider { + *width: 100%; + height: 1px; + margin: 9px 1px; + *margin: -5px 0 5px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; +} +.nav-tabs, +.nav-pills { + *zoom: 1; +} +.nav-tabs:before, +.nav-pills:before, +.nav-tabs:after, +.nav-pills:after { + display: table; + content: ""; + line-height: 0; +} +.nav-tabs:after, +.nav-pills:after { + clear: both; +} +.nav-tabs > li, +.nav-pills > li { + float: left; +} +.nav-tabs > li > a, +.nav-pills > li > a { + padding-right: 12px; + padding-left: 12px; + margin-right: 2px; + line-height: 14px; +} +.nav-tabs { + border-bottom: 1px solid #ddd; +} +.nav-tabs > li { + margin-bottom: -1px; +} +.nav-tabs > li > a { + padding-top: 8px; + padding-bottom: 8px; + line-height: 20px; + border: 1px solid transparent; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} +.nav-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #dddddd; +} +.nav-tabs > .active > a, +.nav-tabs > .active > a:hover { + color: #555555; + background-color: #ffffff; + border: 1px solid #ddd; + border-bottom-color: transparent; + cursor: default; +} +.nav-pills > li > a { + padding-top: 8px; + padding-bottom: 8px; + margin-top: 2px; + margin-bottom: 2px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.nav-pills > .active > a, +.nav-pills > .active > a:hover { + color: #ffffff; + background-color: #0077bb; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li > a { + margin-right: 0; +} +.nav-tabs.nav-stacked { + border-bottom: 0; +} +.nav-tabs.nav-stacked > li > a { + border: 1px solid #ddd; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.nav-tabs.nav-stacked > li:first-child > a { + -webkit-border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; + border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; + border-top-left-radius: 4px; +} +.nav-tabs.nav-stacked > li:last-child > a { + -webkit-border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; + border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + border-bottom-left-radius: 4px; +} +.nav-tabs.nav-stacked > li > a:hover { + border-color: #ddd; + z-index: 2; +} +.nav-pills.nav-stacked > li > a { + margin-bottom: 3px; +} +.nav-pills.nav-stacked > li:last-child > a { + margin-bottom: 1px; +} +.nav-tabs .dropdown-menu { + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; +} +.nav-pills .dropdown-menu { + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.nav .dropdown-toggle .caret { + border-top-color: #0077bb; + border-bottom-color: #0077bb; + margin-top: 6px; +} +.nav .dropdown-toggle:hover .caret { + border-top-color: #00466e; + border-bottom-color: #00466e; +} +/* move down carets for tabs */ +.nav-tabs .dropdown-toggle .caret { + margin-top: 8px; +} +.nav .active .dropdown-toggle .caret { + border-top-color: #fff; + border-bottom-color: #fff; +} +.nav-tabs .active .dropdown-toggle .caret { + border-top-color: #555555; + border-bottom-color: #555555; +} +.nav > .dropdown.active > a:hover { + cursor: pointer; +} +.nav-tabs .open .dropdown-toggle, +.nav-pills .open .dropdown-toggle, +.nav > li.dropdown.open.active > a:hover { + color: #ffffff; + background-color: #999999; + border-color: #999999; +} +.nav li.dropdown.open .caret, +.nav li.dropdown.open.active .caret, +.nav li.dropdown.open a:hover .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; + opacity: 1; + filter: alpha(opacity=100); +} +.tabs-stacked .open > a:hover { + border-color: #999999; +} +.tabbable { + *zoom: 1; +} +.tabbable:before, +.tabbable:after { + display: table; + content: ""; + line-height: 0; +} +.tabbable:after { + clear: both; +} +.tab-content { + overflow: auto; +} +.tabs-below > .nav-tabs, +.tabs-right > .nav-tabs, +.tabs-left > .nav-tabs { + border-bottom: 0; +} +.tab-content > .tab-pane, +.pill-content > .pill-pane { + display: none; +} +.tab-content > .active, +.pill-content > .active { + display: block; +} +.tabs-below > .nav-tabs { + border-top: 1px solid #ddd; +} +.tabs-below > .nav-tabs > li { + margin-top: -1px; + margin-bottom: 0; +} +.tabs-below > .nav-tabs > li > a { + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} +.tabs-below > .nav-tabs > li > a:hover { + border-bottom-color: transparent; + border-top-color: #ddd; +} +.tabs-below > .nav-tabs > .active > a, +.tabs-below > .nav-tabs > .active > a:hover { + border-color: transparent #ddd #ddd #ddd; +} +.tabs-left > .nav-tabs > li, +.tabs-right > .nav-tabs > li { + float: none; +} +.tabs-left > .nav-tabs > li > a, +.tabs-right > .nav-tabs > li > a { + min-width: 74px; + margin-right: 0; + margin-bottom: 3px; +} +.tabs-left > .nav-tabs { + float: left; + margin-right: 19px; + border-right: 1px solid #ddd; +} +.tabs-left > .nav-tabs > li > a { + margin-right: -1px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} +.tabs-left > .nav-tabs > li > a:hover { + border-color: #eeeeee #dddddd #eeeeee #eeeeee; +} +.tabs-left > .nav-tabs .active > a, +.tabs-left > .nav-tabs .active > a:hover { + border-color: #ddd transparent #ddd #ddd; + *border-right-color: #ffffff; +} +.tabs-right > .nav-tabs { + float: right; + margin-left: 19px; + border-left: 1px solid #ddd; +} +.tabs-right > .nav-tabs > li > a { + margin-left: -1px; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} +.tabs-right > .nav-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #eeeeee #dddddd; +} +.tabs-right > .nav-tabs .active > a, +.tabs-right > .nav-tabs .active > a:hover { + border-color: #ddd #ddd #ddd transparent; + *border-left-color: #ffffff; +} +.nav > .disabled > a { + color: #999999; +} +.nav > .disabled > a:hover { + text-decoration: none; + background-color: transparent; + cursor: default; +} +.navbar { + overflow: visible; + margin-bottom: 20px; + color: #777777; + *position: relative; + *z-index: 2; +} +.navbar-inner { + min-height: 40px; + padding-left: 20px; + padding-right: 20px; + background-color: #fafafa; + background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2)); + background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2); + background-image: -o-linear-gradient(top, #ffffff, #f2f2f2); + background-image: linear-gradient(to bottom, #ffffff, #f2f2f2); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0); + border: 1px solid #d4d4d4; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + *zoom: 1; +} +.navbar-inner:before, +.navbar-inner:after { + display: table; + content: ""; + line-height: 0; +} +.navbar-inner:after { + clear: both; +} +.navbar .container { + width: auto; +} +.nav-collapse.collapse { + height: auto; +} +.navbar .brand { + float: left; + display: block; + padding: 10px 20px 10px; + margin-left: -20px; + font-size: 20px; + font-weight: 200; + color: #777777; + text-shadow: 0 1px 0 #ffffff; +} +.navbar .brand:hover { + text-decoration: none; +} +.navbar-text { + margin-bottom: 0; + line-height: 40px; +} +.navbar-link { + color: #777777; +} +.navbar-link:hover { + color: #333333; +} +.navbar .divider-vertical { + height: 40px; + margin: 0 9px; + border-left: 1px solid #f2f2f2; + border-right: 1px solid #ffffff; +} +.navbar .btn, +.navbar .btn-group { + margin-top: 5px; +} +.navbar .btn-group .btn, +.navbar .input-prepend .btn, +.navbar .input-append .btn { + margin-top: 0; +} +.navbar-form { + margin-bottom: 0; + *zoom: 1; +} +.navbar-form:before, +.navbar-form:after { + display: table; + content: ""; + line-height: 0; +} +.navbar-form:after { + clear: both; +} +.navbar-form input, +.navbar-form select, +.navbar-form .radio, +.navbar-form .checkbox { + margin-top: 5px; +} +.navbar-form input, +.navbar-form select, +.navbar-form .btn { + display: inline-block; + margin-bottom: 0; +} +.navbar-form input[type="image"], +.navbar-form input[type="checkbox"], +.navbar-form input[type="radio"] { + margin-top: 3px; +} +.navbar-form .input-append, +.navbar-form .input-prepend { + margin-top: 6px; + white-space: nowrap; +} +.navbar-form .input-append input, +.navbar-form .input-prepend input { + margin-top: 0; +} +.navbar-search { + position: relative; + float: left; + margin-top: 5px; + margin-bottom: 0; +} +.navbar-search .search-query { + margin-bottom: 0; + padding: 4px 14px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + font-weight: normal; + line-height: 1; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} +.navbar-static-top { + position: static; + width: 100%; + margin-bottom: 0; +} +.navbar-static-top .navbar-inner { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; + margin-bottom: 0; +} +.navbar-fixed-top .navbar-inner, +.navbar-static-top .navbar-inner { + border-width: 0 0 1px; +} +.navbar-fixed-bottom .navbar-inner { + border-width: 1px 0 0; +} +.navbar-fixed-top .navbar-inner, +.navbar-fixed-bottom .navbar-inner { + padding-left: 0; + padding-right: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.navbar-static-top .container, +.navbar-fixed-top .container, +.navbar-fixed-bottom .container { + width: 940px; +} +.navbar-fixed-top { + top: 0; +} +.navbar-fixed-top .navbar-inner, +.navbar-static-top .navbar-inner { + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1); +} +.navbar-fixed-bottom { + bottom: 0; +} +.navbar-fixed-bottom .navbar-inner { + -webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1); +} +.navbar .nav { + position: relative; + left: 0; + display: block; + float: left; + margin: 0 10px 0 0; +} +.navbar .nav.pull-right { + float: right; + margin-right: 0; +} +.navbar .nav > li { + float: left; +} +.navbar .nav > li > a { + float: none; + padding: 10px 15px 10px; + color: #777777; + text-decoration: none; + text-shadow: 0 1px 0 #ffffff; +} +.navbar .nav .dropdown-toggle .caret { + margin-top: 8px; +} +.navbar .nav > li > a:focus, +.navbar .nav > li > a:hover { + background-color: transparent; + color: #333333; + text-decoration: none; +} +.navbar .nav > .active > a, +.navbar .nav > .active > a:hover, +.navbar .nav > .active > a:focus { + color: #555555; + text-decoration: none; + background-color: #e5e5e5; + -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); +} +.navbar .btn-navbar { + display: none; + float: right; + padding: 7px 10px; + margin-left: 5px; + margin-right: 5px; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #ededed; + background-image: -moz-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5)); + background-image: -webkit-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: -o-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: linear-gradient(to bottom, #f2f2f2, #e5e5e5); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0); + border-color: #e5e5e5 #e5e5e5 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #e5e5e5; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); +} +.navbar .btn-navbar:hover, +.navbar .btn-navbar:active, +.navbar .btn-navbar.active, +.navbar .btn-navbar.disabled, +.navbar .btn-navbar[disabled] { + color: #ffffff; + background-color: #e5e5e5; + *background-color: #d9d9d9; +} +.navbar .btn-navbar:active, +.navbar .btn-navbar.active { + background-color: #cccccc \9; +} +.navbar .btn-navbar .icon-bar { + display: block; + width: 18px; + height: 2px; + background-color: #f5f5f5; + -webkit-border-radius: 1px; + -moz-border-radius: 1px; + border-radius: 1px; + -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); +} +.btn-navbar .icon-bar + .icon-bar { + margin-top: 3px; +} +.navbar .nav > li > .dropdown-menu:before { + content: ''; + display: inline-block; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-bottom-color: rgba(0, 0, 0, 0.2); + position: absolute; + top: -7px; + left: 9px; +} +.navbar .nav > li > .dropdown-menu:after { + content: ''; + display: inline-block; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid #ffffff; + position: absolute; + top: -6px; + left: 10px; +} +.navbar-fixed-bottom .nav > li > .dropdown-menu:before { + border-top: 7px solid #ccc; + border-top-color: rgba(0, 0, 0, 0.2); + border-bottom: 0; + bottom: -7px; + top: auto; +} +.navbar-fixed-bottom .nav > li > .dropdown-menu:after { + border-top: 6px solid #ffffff; + border-bottom: 0; + bottom: -6px; + top: auto; +} +.navbar .nav li.dropdown.open > .dropdown-toggle, +.navbar .nav li.dropdown.active > .dropdown-toggle, +.navbar .nav li.dropdown.open.active > .dropdown-toggle { + background-color: #e5e5e5; + color: #555555; +} +.navbar .nav li.dropdown > .dropdown-toggle .caret { + border-top-color: #777777; + border-bottom-color: #777777; +} +.navbar .nav li.dropdown.open > .dropdown-toggle .caret, +.navbar .nav li.dropdown.active > .dropdown-toggle .caret, +.navbar .nav li.dropdown.open.active > .dropdown-toggle .caret { + border-top-color: #555555; + border-bottom-color: #555555; +} +.navbar .pull-right > li > .dropdown-menu, +.navbar .nav > li > .dropdown-menu.pull-right { + left: auto; + right: 0; +} +.navbar .pull-right > li > .dropdown-menu:before, +.navbar .nav > li > .dropdown-menu.pull-right:before { + left: auto; + right: 12px; +} +.navbar .pull-right > li > .dropdown-menu:after, +.navbar .nav > li > .dropdown-menu.pull-right:after { + left: auto; + right: 13px; +} +.navbar .pull-right > li > .dropdown-menu .dropdown-menu, +.navbar .nav > li > .dropdown-menu.pull-right .dropdown-menu { + left: auto; + right: 100%; + margin-left: 0; + margin-right: -1px; + -webkit-border-radius: 6px 0 6px 6px; + -moz-border-radius: 6px 0 6px 6px; + border-radius: 6px 0 6px 6px; +} +.navbar-inverse { + color: #999999; +} +.navbar-inverse .navbar-inner { + background-color: #1b1b1b; + background-image: -moz-linear-gradient(top, #222222, #111111); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111)); + background-image: -webkit-linear-gradient(top, #222222, #111111); + background-image: -o-linear-gradient(top, #222222, #111111); + background-image: linear-gradient(to bottom, #222222, #111111); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0); + border-color: #252525; +} +.navbar-inverse .brand, +.navbar-inverse .nav > li > a { + color: #999999; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.navbar-inverse .brand:hover, +.navbar-inverse .nav > li > a:hover { + color: #ffffff; +} +.navbar-inverse .nav > li > a:focus, +.navbar-inverse .nav > li > a:hover { + background-color: transparent; + color: #ffffff; +} +.navbar-inverse .nav .active > a, +.navbar-inverse .nav .active > a:hover, +.navbar-inverse .nav .active > a:focus { + color: #ffffff; + background-color: #111111; +} +.navbar-inverse .navbar-link { + color: #999999; +} +.navbar-inverse .navbar-link:hover { + color: #ffffff; +} +.navbar-inverse .divider-vertical { + border-left-color: #111111; + border-right-color: #222222; +} +.navbar-inverse .nav li.dropdown.open > .dropdown-toggle, +.navbar-inverse .nav li.dropdown.active > .dropdown-toggle, +.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle { + background-color: #111111; + color: #ffffff; +} +.navbar-inverse .nav li.dropdown > .dropdown-toggle .caret { + border-top-color: #999999; + border-bottom-color: #999999; +} +.navbar-inverse .nav li.dropdown.open > .dropdown-toggle .caret, +.navbar-inverse .nav li.dropdown.active > .dropdown-toggle .caret, +.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; +} +.navbar-inverse .navbar-search .search-query { + color: #ffffff; + background-color: #515151; + border-color: #111111; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + -webkit-transition: none; + -moz-transition: none; + -o-transition: none; + transition: none; +} +.navbar-inverse .navbar-search .search-query:-moz-placeholder { + color: #cccccc; +} +.navbar-inverse .navbar-search .search-query:-ms-input-placeholder { + color: #cccccc; +} +.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder { + color: #cccccc; +} +.navbar-inverse .navbar-search .search-query:focus, +.navbar-inverse .navbar-search .search-query.focused { + padding: 5px 15px; + color: #333333; + text-shadow: 0 1px 0 #ffffff; + background-color: #ffffff; + border: 0; + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + outline: 0; +} +.navbar-inverse .btn-navbar { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #0e0e0e; + background-image: -moz-linear-gradient(top, #151515, #040404); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404)); + background-image: -webkit-linear-gradient(top, #151515, #040404); + background-image: -o-linear-gradient(top, #151515, #040404); + background-image: linear-gradient(to bottom, #151515, #040404); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0); + border-color: #040404 #040404 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #040404; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.navbar-inverse .btn-navbar:hover, +.navbar-inverse .btn-navbar:active, +.navbar-inverse .btn-navbar.active, +.navbar-inverse .btn-navbar.disabled, +.navbar-inverse .btn-navbar[disabled] { + color: #ffffff; + background-color: #040404; + *background-color: #000000; +} +.navbar-inverse .btn-navbar:active, +.navbar-inverse .btn-navbar.active { + background-color: #000000 \9; +} +.breadcrumb { + padding: 8px 15px; + margin: 0 0 20px; + list-style: none; + background-color: #f5f5f5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.breadcrumb li { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + text-shadow: 0 1px 0 #ffffff; +} +.breadcrumb .divider { + padding: 0 5px; + color: #ccc; +} +.breadcrumb .active { + color: #999999; +} +.pagination { + height: 40px; + margin: 20px 0; +} +.pagination ul { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + margin-left: 0; + margin-bottom: 0; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); +} +.pagination ul > li { + display: inline; +} +.pagination ul > li > a, +.pagination ul > li > span { + float: left; + padding: 0 14px; + line-height: 38px; + text-decoration: none; + background-color: #ffffff; + border: 1px solid #dddddd; + border-left-width: 0; +} +.pagination ul > li > a:hover, +.pagination ul > .active > a, +.pagination ul > .active > span { + background-color: #f5f5f5; +} +.pagination ul > .active > a, +.pagination ul > .active > span { + color: #999999; + cursor: default; +} +.pagination ul > .disabled > span, +.pagination ul > .disabled > a, +.pagination ul > .disabled > a:hover { + color: #999999; + background-color: transparent; + cursor: default; +} +.pagination ul > li:first-child > a, +.pagination ul > li:first-child > span { + border-left-width: 1px; + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.pagination ul > li:last-child > a, +.pagination ul > li:last-child > span { + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.pagination-centered { + text-align: center; +} +.pagination-right { + text-align: right; +} +.pager { + margin: 20px 0; + list-style: none; + text-align: center; + *zoom: 1; +} +.pager:before, +.pager:after { + display: table; + content: ""; + line-height: 0; +} +.pager:after { + clear: both; +} +.pager li { + display: inline; +} +.pager a, +.pager span { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} +.pager a:hover { + text-decoration: none; + background-color: #f5f5f5; +} +.pager .next a, +.pager .next span { + float: right; +} +.pager .previous a { + float: left; +} +.pager .disabled a, +.pager .disabled a:hover, +.pager .disabled span { + color: #999999; + background-color: #fff; + cursor: default; +} +.alert { + padding: 8px 35px 8px 14px; + margin-bottom: 20px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + background-color: #fcf8e3; + border: 1px solid #fbeed5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + color: #c09853; +} +.alert h4 { + margin: 0; +} +.alert .close { + position: relative; + top: -2px; + right: -21px; + line-height: 20px; +} +.alert-success { + background-color: #dff0d8; + border-color: #d6e9c6; + color: #468847; +} +.alert-danger, +.alert-error { + background-color: #f2dede; + border-color: #eed3d7; + color: #b94a48; +} +.alert-info { + background-color: #d9edf7; + border-color: #bce8f1; + color: #3a87ad; +} +.alert-block { + padding-top: 14px; + padding-bottom: 14px; +} +.alert-block > p, +.alert-block > ul { + margin-bottom: 0; +} +.alert-block p + p { + margin-top: 5px; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@-moz-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@-ms-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@-o-keyframes progress-bar-stripes { + from { + background-position: 0 0; + } + to { + background-position: 40px 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +.progress { + overflow: hidden; + height: 20px; + margin-bottom: 20px; + background-color: #f7f7f7; + background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); + background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0); + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.progress .bar { + width: 0%; + height: 100%; + color: #ffffff; + float: left; + font-size: 12px; + text-align: center; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #0e90d2; + background-image: -moz-linear-gradient(top, #149bdf, #0480be); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); + background-image: -webkit-linear-gradient(top, #149bdf, #0480be); + background-image: -o-linear-gradient(top, #149bdf, #0480be); + background-image: linear-gradient(to bottom, #149bdf, #0480be); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0); + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-transition: width 0.6s ease; + -moz-transition: width 0.6s ease; + -o-transition: width 0.6s ease; + transition: width 0.6s ease; +} +.progress .bar + .bar { + -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); +} +.progress-striped .bar { + background-color: #149bdf; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + -moz-background-size: 40px 40px; + -o-background-size: 40px 40px; + background-size: 40px 40px; +} +.progress.active .bar { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -moz-animation: progress-bar-stripes 2s linear infinite; + -ms-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-danger .bar, +.progress .bar-danger { + background-color: #dd514c; + background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); + background-image: linear-gradient(to bottom, #ee5f5b, #c43c35); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0); +} +.progress-danger.progress-striped .bar, +.progress-striped .bar-danger { + background-color: #ee5f5b; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-success .bar, +.progress .bar-success { + background-color: #5eb95e; + background-image: -moz-linear-gradient(top, #62c462, #57a957); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); + background-image: -webkit-linear-gradient(top, #62c462, #57a957); + background-image: -o-linear-gradient(top, #62c462, #57a957); + background-image: linear-gradient(to bottom, #62c462, #57a957); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0); +} +.progress-success.progress-striped .bar, +.progress-striped .bar-success { + background-color: #62c462; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-info .bar, +.progress .bar-info { + background-color: #4bb1cf; + background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); + background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); + background-image: -o-linear-gradient(top, #5bc0de, #339bb9); + background-image: linear-gradient(to bottom, #5bc0de, #339bb9); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0); +} +.progress-info.progress-striped .bar, +.progress-striped .bar-info { + background-color: #5bc0de; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-warning .bar, +.progress .bar-warning { + background-color: #ff9d2e; + background-image: -moz-linear-gradient(top, #ffac4d, #ff8800); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffac4d), to(#ff8800)); + background-image: -webkit-linear-gradient(top, #ffac4d, #ff8800); + background-image: -o-linear-gradient(top, #ffac4d, #ff8800); + background-image: linear-gradient(to bottom, #ffac4d, #ff8800); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffac4d', endColorstr='#ffff8800', GradientType=0); +} +.progress-warning.progress-striped .bar, +.progress-striped .bar-warning { + background-color: #ffac4d; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.tooltip { + position: absolute; + z-index: 1030; + display: block; + visibility: visible; + padding: 5px; + font-size: 11px; + opacity: 0; + filter: alpha(opacity=0); +} +.tooltip.in { + opacity: 0.8; + filter: alpha(opacity=80); +} +.tooltip.top { + margin-top: -3px; +} +.tooltip.right { + margin-left: 3px; +} +.tooltip.bottom { + margin-top: 3px; +} +.tooltip.left { + margin-left: -3px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1010; + display: none; + width: 236px; + padding: 1px; + background-color: #ffffff; + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); +} +.popover.top { + margin-bottom: 10px; +} +.popover.right { + margin-left: 10px; +} +.popover.bottom { + margin-top: 10px; +} +.popover.left { + margin-right: 10px; +} +.popover-title { + margin: 0; + padding: 8px 14px; + font-size: 14px; + font-weight: normal; + line-height: 18px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + -webkit-border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + border-radius: 5px 5px 0 0; +} +.popover-content { + padding: 9px 14px; +} +.popover-content p, +.popover-content ul, +.popover-content ol { + margin-bottom: 0; +} +.popover .arrow, +.popover .arrow:after { + position: absolute; + display: inline-block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.popover .arrow:after { + content: ""; + z-index: -1; +} +.popover.top .arrow { + bottom: -10px; + left: 50%; + margin-left: -10px; + border-width: 10px 10px 0; + border-top-color: #ffffff; +} +.popover.top .arrow:after { + border-width: 11px 11px 0; + border-top-color: rgba(0, 0, 0, 0.25); + bottom: -1px; + left: -11px; +} +.popover.right .arrow { + top: 50%; + left: -10px; + margin-top: -10px; + border-width: 10px 10px 10px 0; + border-right-color: #ffffff; +} +.popover.right .arrow:after { + border-width: 11px 11px 11px 0; + border-right-color: rgba(0, 0, 0, 0.25); + bottom: -11px; + left: -1px; +} +.popover.bottom .arrow { + top: -10px; + left: 50%; + margin-left: -10px; + border-width: 0 10px 10px; + border-bottom-color: #ffffff; +} +.popover.bottom .arrow:after { + border-width: 0 11px 11px; + border-bottom-color: rgba(0, 0, 0, 0.25); + top: -1px; + left: -11px; +} +.popover.left .arrow { + top: 50%; + right: -10px; + margin-top: -10px; + border-width: 10px 0 10px 10px; + border-left-color: #ffffff; +} +.popover.left .arrow:after { + border-width: 11px 0 11px 11px; + border-left-color: rgba(0, 0, 0, 0.25); + bottom: -11px; + right: -1px; +} +.dropup, +.dropdown { + position: relative; +} +.dropdown-toggle { + *margin-bottom: -3px; +} +.dropdown-toggle:active, +.open .dropdown-toggle { + outline: 0; +} +.caret { + display: inline-block; + width: 0; + height: 0; + vertical-align: top; + border-top: 4px solid #000000; + border-right: 4px solid transparent; + border-left: 4px solid transparent; + content: ""; +} +.dropdown .caret { + margin-top: 8px; + margin-left: 2px; +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + list-style: none; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + *border-right-width: 2px; + *border-bottom-width: 2px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu .divider { + *width: 100%; + height: 1px; + margin: 9px 1px; + *margin: -5px 0 5px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; +} +.dropdown-menu a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 20px; + color: #333333; + white-space: nowrap; +} +.dropdown-menu li > a:hover, +.dropdown-menu li > a:focus, +.dropdown-submenu:hover > a { + text-decoration: none; + color: #ffffff; + background-color: #0077bb; + background-color: #0071b1; + background-image: -moz-linear-gradient(top, #0077bb, #0067a2); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0077bb), to(#0067a2)); + background-image: -webkit-linear-gradient(top, #0077bb, #0067a2); + background-image: -o-linear-gradient(top, #0077bb, #0067a2); + background-image: linear-gradient(to bottom, #0077bb, #0067a2); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077bb', endColorstr='#ff0067a2', GradientType=0); +} +.dropdown-menu .active > a, +.dropdown-menu .active > a:hover { + color: #ffffff; + text-decoration: none; + outline: 0; + background-color: #0077bb; + background-color: #0071b1; + background-image: -moz-linear-gradient(top, #0077bb, #0067a2); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0077bb), to(#0067a2)); + background-image: -webkit-linear-gradient(top, #0077bb, #0067a2); + background-image: -o-linear-gradient(top, #0077bb, #0067a2); + background-image: linear-gradient(to bottom, #0077bb, #0067a2); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077bb', endColorstr='#ff0067a2', GradientType=0); +} +.dropdown-menu .disabled > a, +.dropdown-menu .disabled > a:hover { + color: #999999; +} +.dropdown-menu .disabled > a:hover { + text-decoration: none; + background-color: transparent; + cursor: default; +} +.open { + *z-index: 1000; +} +.open > .dropdown-menu { + display: block; +} +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + border-top: 0; + border-bottom: 4px solid #000000; + content: ""; +} +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 1px; +} +.dropdown-submenu { + position: relative; +} +.dropdown-submenu > .dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + -webkit-border-radius: 0 6px 6px 6px; + -moz-border-radius: 0 6px 6px 6px; + border-radius: 0 6px 6px 6px; +} +.dropdown-submenu:hover > .dropdown-menu { + display: block; +} +.dropdown-submenu > a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} +.dropdown-submenu:hover > a:after { + border-left-color: #ffffff; +} +.dropdown .dropdown-menu .nav-header { + padding-left: 20px; + padding-right: 20px; +} +.typeahead { + margin-top: 2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.accordion { + margin-bottom: 20px; +} +.accordion-group { + margin-bottom: 2px; + border: 1px solid #e5e5e5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.accordion-heading { + border-bottom: 0; +} +.accordion-heading .accordion-toggle { + display: block; + padding: 8px 15px; +} +.accordion-toggle { + cursor: pointer; +} +.accordion-inner { + padding: 9px 15px; + border-top: 1px solid #e5e5e5; +} +.carousel { + position: relative; + margin-bottom: 20px; + line-height: 1; +} +.carousel-inner { + overflow: hidden; + width: 100%; + position: relative; +} +.carousel .item { + display: none; + position: relative; + -webkit-transition: 0.6s ease-in-out left; + -moz-transition: 0.6s ease-in-out left; + -o-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; +} +.carousel .item > img { + display: block; + line-height: 1; +} +.carousel .active, +.carousel .next, +.carousel .prev { + display: block; +} +.carousel .active { + left: 0; +} +.carousel .next, +.carousel .prev { + position: absolute; + top: 0; + width: 100%; +} +.carousel .next { + left: 100%; +} +.carousel .prev { + left: -100%; +} +.carousel .next.left, +.carousel .prev.right { + left: 0; +} +.carousel .active.left { + left: -100%; +} +.carousel .active.right { + left: 100%; +} +.carousel-control { + position: absolute; + top: 40%; + left: 15px; + width: 40px; + height: 40px; + margin-top: -20px; + font-size: 60px; + font-weight: 100; + line-height: 30px; + color: #ffffff; + text-align: center; + background: #222222; + border: 3px solid #ffffff; + -webkit-border-radius: 23px; + -moz-border-radius: 23px; + border-radius: 23px; + opacity: 0.5; + filter: alpha(opacity=50); +} +.carousel-control.right { + left: auto; + right: 15px; +} +.carousel-control:hover { + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); +} +.carousel-caption { + position: absolute; + left: 0; + right: 0; + bottom: 0; + padding: 15px; + background: #333333; + background: rgba(0, 0, 0, 0.75); +} +.carousel-caption h4, +.carousel-caption p { + color: #ffffff; + line-height: 20px; +} +.carousel-caption h4 { + margin: 0 0 5px; +} +.carousel-caption p { + margin-bottom: 0; +} + +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} +.well-large { + padding: 24px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.well-small { + padding: 9px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.close { + float: right; + font-size: 20px; + font-weight: bold; + line-height: 20px; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} +.close:hover { + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.4; + filter: alpha(opacity=40); +} +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} +.pull-right { + float: right; +} +.pull-left { + float: left; +} +.hide { + display: none; +} +.show { + display: block; +} +.invisible { + visibility: hidden; +} +.affix { + position: fixed; +} +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + -moz-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition: height 0.35s ease; + -moz-transition: height 0.35s ease; + -o-transition: height 0.35s ease; + transition: height 0.35s ease; +} +.collapse.in { + height: auto; +} +.hidden { + display: none; + visibility: hidden; +} +.visible-phone { + display: none !important; +} +.visible-tablet { + display: none !important; +} +.hidden-desktop { + display: none !important; +} +.visible-desktop { + display: inherit !important; +} +@media (min-width: 768px) and (max-width: 979px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important ; + } + .visible-tablet { + display: inherit !important; + } + .hidden-tablet { + display: none !important; + } +} +@media (max-width: 767px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important; + } + .visible-phone { + display: inherit !important; + } + .hidden-phone { + display: none !important; + } +} +@media (max-width: 767px) { + body { + padding-left: 20px; + padding-right: 20px; + } + .navbar-fixed-top, + .navbar-fixed-bottom, + .navbar-static-top { + margin-left: -20px; + margin-right: -20px; + } + .container-fluid { + padding: 0; + } + .dl-horizontal dt { + float: none; + clear: none; + width: auto; + text-align: left; + } + .dl-horizontal dd { + margin-left: 0; + } + .container { + width: auto; + } + .row-fluid { + width: 100%; + } + .row, + .thumbnails { + margin-left: 0; + } + .thumbnails > li { + float: none; + margin-left: 0; + } + [class*="span"], + .row-fluid [class*="span"] { + float: none; + display: block; + width: 100%; + margin-left: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .span12, + .row-fluid .span12 { + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .input-large, + .input-xlarge, + .input-xxlarge, + input[class*="span"], + select[class*="span"], + textarea[class*="span"], + .uneditable-input { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .input-prepend input, + .input-append input, + .input-prepend input[class*="span"], + .input-append input[class*="span"] { + display: inline-block; + width: auto; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 0; + } + .modal { + position: fixed; + top: 20px; + left: 20px; + right: 20px; + width: auto; + margin: 0; + } + .modal.fade.in { + top: auto; + } +} +@media (max-width: 480px) { + .nav-collapse { + -webkit-transform: translate3d(0, 0, 0); + } + .page-header h1 small { + display: block; + line-height: 20px; + } + input[type="checkbox"], + input[type="radio"] { + border: 1px solid #ccc; + } + .form-horizontal .control-label { + float: none; + width: auto; + padding-top: 0; + text-align: left; + } + .form-horizontal .controls { + margin-left: 0; + } + .form-horizontal .control-list { + padding-top: 0; + } + .form-horizontal .form-actions { + padding-left: 10px; + padding-right: 10px; + } + .modal { + top: 10px; + left: 10px; + right: 10px; + } + .modal-header .close { + padding: 10px; + margin: -10px; + } + .carousel-caption { + position: static; + } +} +@media (min-width: 768px) and (max-width: 979px) { + .row { + margin-left: -20px; + *zoom: 1; + } + .row:before, + .row:after { + display: table; + content: ""; + line-height: 0; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + min-height: 1px; + margin-left: 20px; + } + .container, + .navbar-static-top .container, + .navbar-fixed-top .container, + .navbar-fixed-bottom .container { + width: 724px; + } + .span12 { + width: 724px; + } + .span11 { + width: 662px; + } + .span10 { + width: 600px; + } + .span9 { + width: 538px; + } + .span8 { + width: 476px; + } + .span7 { + width: 414px; + } + .span6 { + width: 352px; + } + .span5 { + width: 290px; + } + .span4 { + width: 228px; + } + .span3 { + width: 166px; + } + .span2 { + width: 104px; + } + .span1 { + width: 42px; + } + .offset12 { + margin-left: 764px; + } + .offset11 { + margin-left: 702px; + } + .offset10 { + margin-left: 640px; + } + .offset9 { + margin-left: 578px; + } + .offset8 { + margin-left: 516px; + } + .offset7 { + margin-left: 454px; + } + .offset6 { + margin-left: 392px; + } + .offset5 { + margin-left: 330px; + } + .offset4 { + margin-left: 268px; + } + .offset3 { + margin-left: 206px; + } + .offset2 { + margin-left: 144px; + } + .offset1 { + margin-left: 82px; + } + .row-fluid { + width: 100%; + *zoom: 1; + } + .row-fluid:before, + .row-fluid:after { + display: table; + content: ""; + line-height: 0; + } + .row-fluid:after { + clear: both; + } + .row-fluid [class*="span"] { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + float: left; + margin-left: 2.7624309392265194%; + *margin-left: 2.709239449864817%; + } + .row-fluid [class*="span"]:first-child { + margin-left: 0; + } + .row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; + } + .row-fluid .span11 { + width: 91.43646408839778%; + *width: 91.38327259903608%; + } + .row-fluid .span10 { + width: 82.87292817679558%; + *width: 82.81973668743387%; + } + .row-fluid .span9 { + width: 74.30939226519337%; + *width: 74.25620077583166%; + } + .row-fluid .span8 { + width: 65.74585635359117%; + *width: 65.69266486422946%; + } + .row-fluid .span7 { + width: 57.18232044198895%; + *width: 57.12912895262725%; + } + .row-fluid .span6 { + width: 48.61878453038674%; + *width: 48.56559304102504%; + } + .row-fluid .span5 { + width: 40.05524861878453%; + *width: 40.00205712942283%; + } + .row-fluid .span4 { + width: 31.491712707182323%; + *width: 31.43852121782062%; + } + .row-fluid .span3 { + width: 22.92817679558011%; + *width: 22.87498530621841%; + } + .row-fluid .span2 { + width: 14.3646408839779%; + *width: 14.311449394616199%; + } + .row-fluid .span1 { + width: 5.801104972375691%; + *width: 5.747913483013988%; + } + .row-fluid .offset12 { + margin-left: 105.52486187845304%; + *margin-left: 105.41847889972962%; + } + .row-fluid .offset12:first-child { + margin-left: 102.76243093922652%; + *margin-left: 102.6560479605031%; + } + .row-fluid .offset11 { + margin-left: 96.96132596685082%; + *margin-left: 96.8549429881274%; + } + .row-fluid .offset11:first-child { + margin-left: 94.1988950276243%; + *margin-left: 94.09251204890089%; + } + .row-fluid .offset10 { + margin-left: 88.39779005524862%; + *margin-left: 88.2914070765252%; + } + .row-fluid .offset10:first-child { + margin-left: 85.6353591160221%; + *margin-left: 85.52897613729868%; + } + .row-fluid .offset9 { + margin-left: 79.8342541436464%; + *margin-left: 79.72787116492299%; + } + .row-fluid .offset9:first-child { + margin-left: 77.07182320441989%; + *margin-left: 76.96544022569647%; + } + .row-fluid .offset8 { + margin-left: 71.2707182320442%; + *margin-left: 71.16433525332079%; + } + .row-fluid .offset8:first-child { + margin-left: 68.50828729281768%; + *margin-left: 68.40190431409427%; + } + .row-fluid .offset7 { + margin-left: 62.70718232044199%; + *margin-left: 62.600799341718584%; + } + .row-fluid .offset7:first-child { + margin-left: 59.94475138121547%; + *margin-left: 59.838368402492065%; + } + .row-fluid .offset6 { + margin-left: 54.14364640883978%; + *margin-left: 54.037263430116376%; + } + .row-fluid .offset6:first-child { + margin-left: 51.38121546961326%; + *margin-left: 51.27483249088986%; + } + .row-fluid .offset5 { + margin-left: 45.58011049723757%; + *margin-left: 45.47372751851417%; + } + .row-fluid .offset5:first-child { + margin-left: 42.81767955801105%; + *margin-left: 42.71129657928765%; + } + .row-fluid .offset4 { + margin-left: 37.01657458563536%; + *margin-left: 36.91019160691196%; + } + .row-fluid .offset4:first-child { + margin-left: 34.25414364640884%; + *margin-left: 34.14776066768544%; + } + .row-fluid .offset3 { + margin-left: 28.45303867403315%; + *margin-left: 28.346655695309746%; + } + .row-fluid .offset3:first-child { + margin-left: 25.69060773480663%; + *margin-left: 25.584224756083227%; + } + .row-fluid .offset2 { + margin-left: 19.88950276243094%; + *margin-left: 19.783119783707537%; + } + .row-fluid .offset2:first-child { + margin-left: 17.12707182320442%; + *margin-left: 17.02068884448102%; + } + .row-fluid .offset1 { + margin-left: 11.32596685082873%; + *margin-left: 11.219583872105325%; + } + .row-fluid .offset1:first-child { + margin-left: 8.56353591160221%; + *margin-left: 8.457152932878806%; + } + input, + textarea, + .uneditable-input { + margin-left: 0; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 20px; + } + input.span12, textarea.span12, .uneditable-input.span12 { + width: 710px; + } + input.span11, textarea.span11, .uneditable-input.span11 { + width: 648px; + } + input.span10, textarea.span10, .uneditable-input.span10 { + width: 586px; + } + input.span9, textarea.span9, .uneditable-input.span9 { + width: 524px; + } + input.span8, textarea.span8, .uneditable-input.span8 { + width: 462px; + } + input.span7, textarea.span7, .uneditable-input.span7 { + width: 400px; + } + input.span6, textarea.span6, .uneditable-input.span6 { + width: 338px; + } + input.span5, textarea.span5, .uneditable-input.span5 { + width: 276px; + } + input.span4, textarea.span4, .uneditable-input.span4 { + width: 214px; + } + input.span3, textarea.span3, .uneditable-input.span3 { + width: 152px; + } + input.span2, textarea.span2, .uneditable-input.span2 { + width: 90px; + } + input.span1, textarea.span1, .uneditable-input.span1 { + width: 28px; + } +} +@media (min-width: 1200px) { + .row { + margin-left: -30px; + *zoom: 1; + } + .row:before, + .row:after { + display: table; + content: ""; + line-height: 0; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + min-height: 1px; + margin-left: 30px; + } + .container, + .navbar-static-top .container, + .navbar-fixed-top .container, + .navbar-fixed-bottom .container { + width: 1170px; + } + .span12 { + width: 1170px; + } + .span11 { + width: 1070px; + } + .span10 { + width: 970px; + } + .span9 { + width: 870px; + } + .span8 { + width: 770px; + } + .span7 { + width: 670px; + } + .span6 { + width: 570px; + } + .span5 { + width: 470px; + } + .span4 { + width: 370px; + } + .span3 { + width: 270px; + } + .span2 { + width: 170px; + } + .span1 { + width: 70px; + } + .offset12 { + margin-left: 1230px; + } + .offset11 { + margin-left: 1130px; + } + .offset10 { + margin-left: 1030px; + } + .offset9 { + margin-left: 930px; + } + .offset8 { + margin-left: 830px; + } + .offset7 { + margin-left: 730px; + } + .offset6 { + margin-left: 630px; + } + .offset5 { + margin-left: 530px; + } + .offset4 { + margin-left: 430px; + } + .offset3 { + margin-left: 330px; + } + .offset2 { + margin-left: 230px; + } + .offset1 { + margin-left: 130px; + } + .row-fluid { + width: 100%; + *zoom: 1; + } + .row-fluid:before, + .row-fluid:after { + display: table; + content: ""; + line-height: 0; + } + .row-fluid:after { + clear: both; + } + .row-fluid [class*="span"] { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + float: left; + margin-left: 2.564102564102564%; + *margin-left: 2.5109110747408616%; + } + .row-fluid [class*="span"]:first-child { + margin-left: 0; + } + .row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; + } + .row-fluid .span11 { + width: 91.45299145299145%; + *width: 91.39979996362975%; + } + .row-fluid .span10 { + width: 82.90598290598291%; + *width: 82.8527914166212%; + } + .row-fluid .span9 { + width: 74.35897435897436%; + *width: 74.30578286961266%; + } + .row-fluid .span8 { + width: 65.81196581196582%; + *width: 65.75877432260411%; + } + .row-fluid .span7 { + width: 57.26495726495726%; + *width: 57.21176577559556%; + } + .row-fluid .span6 { + width: 48.717948717948715%; + *width: 48.664757228587014%; + } + .row-fluid .span5 { + width: 40.17094017094017%; + *width: 40.11774868157847%; + } + .row-fluid .span4 { + width: 31.623931623931625%; + *width: 31.570740134569924%; + } + .row-fluid .span3 { + width: 23.076923076923077%; + *width: 23.023731587561375%; + } + .row-fluid .span2 { + width: 14.52991452991453%; + *width: 14.476723040552828%; + } + .row-fluid .span1 { + width: 5.982905982905983%; + *width: 5.929714493544281%; + } + .row-fluid .offset12 { + margin-left: 105.12820512820512%; + *margin-left: 105.02182214948171%; + } + .row-fluid .offset12:first-child { + margin-left: 102.56410256410257%; + *margin-left: 102.45771958537915%; + } + .row-fluid .offset11 { + margin-left: 96.58119658119658%; + *margin-left: 96.47481360247316%; + } + .row-fluid .offset11:first-child { + margin-left: 94.01709401709402%; + *margin-left: 93.91071103837061%; + } + .row-fluid .offset10 { + margin-left: 88.03418803418803%; + *margin-left: 87.92780505546462%; + } + .row-fluid .offset10:first-child { + margin-left: 85.47008547008548%; + *margin-left: 85.36370249136206%; + } + .row-fluid .offset9 { + margin-left: 79.48717948717949%; + *margin-left: 79.38079650845607%; + } + .row-fluid .offset9:first-child { + margin-left: 76.92307692307693%; + *margin-left: 76.81669394435352%; + } + .row-fluid .offset8 { + margin-left: 70.94017094017094%; + *margin-left: 70.83378796144753%; + } + .row-fluid .offset8:first-child { + margin-left: 68.37606837606839%; + *margin-left: 68.26968539734497%; + } + .row-fluid .offset7 { + margin-left: 62.393162393162385%; + *margin-left: 62.28677941443899%; + } + .row-fluid .offset7:first-child { + margin-left: 59.82905982905982%; + *margin-left: 59.72267685033642%; + } + .row-fluid .offset6 { + margin-left: 53.84615384615384%; + *margin-left: 53.739770867430444%; + } + .row-fluid .offset6:first-child { + margin-left: 51.28205128205128%; + *margin-left: 51.175668303327875%; + } + .row-fluid .offset5 { + margin-left: 45.299145299145295%; + *margin-left: 45.1927623204219%; + } + .row-fluid .offset5:first-child { + margin-left: 42.73504273504273%; + *margin-left: 42.62865975631933%; + } + .row-fluid .offset4 { + margin-left: 36.75213675213675%; + *margin-left: 36.645753773413354%; + } + .row-fluid .offset4:first-child { + margin-left: 34.18803418803419%; + *margin-left: 34.081651209310785%; + } + .row-fluid .offset3 { + margin-left: 28.205128205128204%; + *margin-left: 28.0987452264048%; + } + .row-fluid .offset3:first-child { + margin-left: 25.641025641025642%; + *margin-left: 25.53464266230224%; + } + .row-fluid .offset2 { + margin-left: 19.65811965811966%; + *margin-left: 19.551736679396257%; + } + .row-fluid .offset2:first-child { + margin-left: 17.094017094017094%; + *margin-left: 16.98763411529369%; + } + .row-fluid .offset1 { + margin-left: 11.11111111111111%; + *margin-left: 11.004728132387708%; + } + .row-fluid .offset1:first-child { + margin-left: 8.547008547008547%; + *margin-left: 8.440625568285142%; + } + input, + textarea, + .uneditable-input { + margin-left: 0; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 30px; + } + input.span12, textarea.span12, .uneditable-input.span12 { + width: 1156px; + } + input.span11, textarea.span11, .uneditable-input.span11 { + width: 1056px; + } + input.span10, textarea.span10, .uneditable-input.span10 { + width: 956px; + } + input.span9, textarea.span9, .uneditable-input.span9 { + width: 856px; + } + input.span8, textarea.span8, .uneditable-input.span8 { + width: 756px; + } + input.span7, textarea.span7, .uneditable-input.span7 { + width: 656px; + } + input.span6, textarea.span6, .uneditable-input.span6 { + width: 556px; + } + input.span5, textarea.span5, .uneditable-input.span5 { + width: 456px; + } + input.span4, textarea.span4, .uneditable-input.span4 { + width: 356px; + } + input.span3, textarea.span3, .uneditable-input.span3 { + width: 256px; + } + input.span2, textarea.span2, .uneditable-input.span2 { + width: 156px; + } + input.span1, textarea.span1, .uneditable-input.span1 { + width: 56px; + } + .thumbnails { + margin-left: -30px; + } + .thumbnails > li { + margin-left: 30px; + } + .row-fluid .thumbnails { + margin-left: 0; + } +} +@media (max-width: 979px) { + body { + padding-top: 0; + } + .navbar-fixed-top, + .navbar-fixed-bottom { + position: static; + } + .navbar-fixed-top { + margin-bottom: 20px; + } + .navbar-fixed-bottom { + margin-top: 20px; + } + .navbar-fixed-top .navbar-inner, + .navbar-fixed-bottom .navbar-inner { + padding: 5px; + } + .navbar .container { + width: auto; + padding: 0; + } + .navbar .brand { + padding-left: 10px; + padding-right: 10px; + margin: 0 0 0 -5px; + } + .nav-collapse { + clear: both; + } + .nav-collapse .nav { + float: none; + margin: 0 0 10px; + } + .nav-collapse .nav > li { + float: none; + } + .nav-collapse .nav > li > a { + margin-bottom: 2px; + } + .nav-collapse .nav > .divider-vertical { + display: none; + } + .nav-collapse .nav .nav-header { + color: #777777; + text-shadow: none; + } + .nav-collapse .nav > li > a, + .nav-collapse .dropdown-menu a { + padding: 9px 15px; + font-weight: bold; + color: #777777; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + } + .nav-collapse .btn { + padding: 4px 10px 4px; + font-weight: normal; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + } + .nav-collapse .dropdown-menu li + li a { + margin-bottom: 2px; + } + .nav-collapse .nav > li > a:hover, + .nav-collapse .dropdown-menu a:hover { + background-color: #f2f2f2; + } + .navbar-inverse .nav-collapse .nav > li > a:hover, + .navbar-inverse .nav-collapse .dropdown-menu a:hover { + background-color: #111111; + } + .nav-collapse.in .btn-group { + margin-top: 5px; + padding: 0; + } + .nav-collapse .dropdown-menu { + position: static; + top: auto; + left: auto; + float: none; + display: block; + max-width: none; + margin: 0 15px; + padding: 0; + background-color: transparent; + border: none; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + } + .nav-collapse .dropdown-menu:before, + .nav-collapse .dropdown-menu:after { + display: none; + } + .nav-collapse .dropdown-menu .divider { + display: none; + } + .nav-collapse .nav > li > .dropdown-menu:before, + .nav-collapse .nav > li > .dropdown-menu:after { + display: none; + } + .nav-collapse .navbar-form, + .nav-collapse .navbar-search { + float: none; + padding: 10px 15px; + margin: 10px 0; + border-top: 1px solid #f2f2f2; + border-bottom: 1px solid #f2f2f2; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + } + .navbar-inverse .nav-collapse .navbar-form, + .navbar-inverse .nav-collapse .navbar-search { + border-top-color: #111111; + border-bottom-color: #111111; + } + .navbar .nav-collapse .nav.pull-right { + float: none; + margin-left: 0; + } + .nav-collapse, + .nav-collapse.collapse { + overflow: hidden; + height: 0; + } + .navbar .btn-navbar { + display: block; + } + .navbar-static .navbar-inner { + padding-left: 10px; + padding-right: 10px; + } +} +@media (min-width: 980px) { + .nav-collapse.collapse { + height: auto !important; + overflow: visible !important; + } +} diff --git a/plugins/system/t3/admin/bootstrap/css/bootstrap.min.css b/plugins/system/t3/admin/bootstrap/css/bootstrap.min.css new file mode 100644 index 0000000..deaf490 --- /dev/null +++ b/plugins/system/t3/admin/bootstrap/css/bootstrap.min.css @@ -0,0 +1,667 @@ +/*! + * Bootstrap v2.1.1 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ +.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0;} +.clearfix:after{clear:both;} +.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;} +.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} +article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;} +audio,canvas,video{display:inline-block;*display:inline;*zoom:1;} +audio:not([controls]){display:none;} +html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;} +a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +a:hover,a:active{outline:0;} +sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline;} +sup{top:-0.5em;} +sub{bottom:-0.25em;} +img{max-width:100%;width:auto\9;height:auto;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic;} +#map_canvas img{max-width:none;} +button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;} +button,input{*overflow:visible;line-height:normal;} +button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0;} +button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;} +input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield;} +input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none;} +textarea{overflow:auto;vertical-align:top;} +.row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:"";line-height:0;} +.row:after{clear:both;} +[class*="span"]{float:left;min-height:1px;margin-left:20px;} +.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;} +.span12{width:940px;} +.span11{width:860px;} +.span10{width:780px;} +.span9{width:700px;} +.span8{width:620px;} +.span7{width:540px;} +.span6{width:460px;} +.span5{width:380px;} +.span4{width:300px;} +.span3{width:220px;} +.span2{width:140px;} +.span1{width:60px;} +.offset12{margin-left:980px;} +.offset11{margin-left:900px;} +.offset10{margin-left:820px;} +.offset9{margin-left:740px;} +.offset8{margin-left:660px;} +.offset7{margin-left:580px;} +.offset6{margin-left:500px;} +.offset5{margin-left:420px;} +.offset4{margin-left:340px;} +.offset3{margin-left:260px;} +.offset2{margin-left:180px;} +.offset1{margin-left:100px;} +.row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0;} +.row-fluid:after{clear:both;} +.row-fluid [class*="span"]{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;} +.row-fluid [class*="span"]:first-child{margin-left:0;} +.row-fluid .span12{width:100%;*width:99.94680851063829%;} +.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%;} +.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%;} +.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%;} +.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%;} +.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%;} +.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%;} +.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%;} +.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%;} +.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%;} +.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%;} +.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%;} +.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%;} +.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%;} +.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%;} +.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%;} +.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%;} +.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%;} +.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%;} +.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%;} +.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%;} +.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%;} +.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%;} +.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%;} +.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%;} +.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%;} +.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%;} +.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%;} +.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%;} +.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%;} +.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%;} +.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%;} +.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%;} +.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%;} +.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%;} +.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%;} +[class*="span"].hide,.row-fluid [class*="span"].hide{display:none;} +[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right;} +.container{margin-right:auto;margin-left:auto;*zoom:1;}.container:before,.container:after{display:table;content:"";line-height:0;} +.container:after{clear:both;} +.container-fluid{padding-right:20px;padding-left:20px;*zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";line-height:0;} +.container-fluid:after{clear:both;} +p{margin:0 0 10px;} +.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px;} +small{font-size:85%;} +strong{font-weight:bold;} +em{font-style:italic;} +cite{font-style:normal;} +.muted{color:#999999;} +.text-warning{color:#c09853;} +.text-error{color:#b94a48;} +.text-info{color:#3a87ad;} +.text-success{color:#468847;} +h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:1;color:inherit;text-rendering:optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999999;} +h1{font-size:36px;line-height:40px;} +h2{font-size:30px;line-height:40px;} +h3{font-size:24px;line-height:40px;} +h4{font-size:18px;line-height:20px;} +h5{font-size:14px;line-height:20px;} +h6{font-size:12px;line-height:20px;} +h1 small{font-size:24px;} +h2 small{font-size:18px;} +h3 small{font-size:14px;} +h4 small{font-size:14px;} +.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eeeeee;} +ul,ol{padding:0;margin:0 0 10px 25px;} +ul ul,ul ol,ol ol,ol ul{margin-bottom:0;} +li{line-height:20px;} +ul.unstyled,ol.unstyled{margin-left:0;list-style:none;} +dl{margin-bottom:20px;} +dt,dd{line-height:20px;} +dt{font-weight:bold;} +dd{margin-left:10px;} +.dl-horizontal{*zoom:1;}.dl-horizontal:before,.dl-horizontal:after{display:table;content:"";line-height:0;} +.dl-horizontal:after{clear:both;} +.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} +.dl-horizontal dd{margin-left:180px;} +hr{margin:20px 0;border:0;border-top:1px solid #eeeeee;border-bottom:1px solid #ffffff;} +abbr[title]{cursor:help;border-bottom:1px dotted #999999;} +abbr.initialism{font-size:90%;text-transform:uppercase;} +blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eeeeee;}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px;} +blockquote small{display:block;line-height:20px;color:#999999;}blockquote small:before{content:'\2014 \00A0';} +blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eeeeee;border-left:0;}blockquote.pull-right p,blockquote.pull-right small{text-align:right;} +blockquote.pull-right small:before{content:'';} +blockquote.pull-right small:after{content:'\00A0 \2014';} +q:before,q:after,blockquote:before,blockquote:after{content:"";} +address{display:block;margin-bottom:20px;font-style:normal;line-height:20px;} +code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8;} +pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}pre.prettyprint{margin-bottom:20px;} +pre code{padding:0;color:inherit;background-color:transparent;border:0;} +.pre-scrollable{max-height:340px;overflow-y:scroll;} +.label,.badge{font-size:11.844px;font-weight:bold;line-height:14px;color:#ffffff;vertical-align:baseline;white-space:nowrap;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#999999;} +.label{padding:1px 4px 2px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.badge{padding:1px 9px 2px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;} +a.label:hover,a.badge:hover{color:#ffffff;text-decoration:none;cursor:pointer;} +.label-important,.badge-important{background-color:#b94a48;} +.label-important[href],.badge-important[href]{background-color:#953b39;} +.label-warning,.badge-warning{background-color:#ff8800;} +.label-warning[href],.badge-warning[href]{background-color:#cc6d00;} +.label-success,.badge-success{background-color:#468847;} +.label-success[href],.badge-success[href]{background-color:#356635;} +.label-info,.badge-info{background-color:#3a87ad;} +.label-info[href],.badge-info[href]{background-color:#2d6987;} +.label-inverse,.badge-inverse{background-color:#333333;} +.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a;} +.btn .label,.btn .badge{position:relative;top:-1px;} +.btn-mini .label,.btn-mini .badge{top:0;} +table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0;} +.table{width:100%;margin-bottom:20px;}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #dddddd;} +.table th{font-weight:bold;} +.table thead th{vertical-align:bottom;} +.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0;} +.table tbody+tbody{border-top:2px solid #dddddd;} +.table-condensed th,.table-condensed td{padding:4px 5px;} +.table-bordered{border:1px solid #dddddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.table-bordered th,.table-bordered td{border-left:1px solid #dddddd;} +.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0;} +.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px;} +.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px;} +.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child,.table-bordered tfoot:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;} +.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child,.table-bordered tfoot:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;} +.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px;} +.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topleft:4px;} +.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9;} +.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5;} +table [class*=span],.row-fluid table [class*=span]{display:table-cell;float:none;margin-left:0;} +.table .span1{float:none;width:44px;margin-left:0;} +.table .span2{float:none;width:124px;margin-left:0;} +.table .span3{float:none;width:204px;margin-left:0;} +.table .span4{float:none;width:284px;margin-left:0;} +.table .span5{float:none;width:364px;margin-left:0;} +.table .span6{float:none;width:444px;margin-left:0;} +.table .span7{float:none;width:524px;margin-left:0;} +.table .span8{float:none;width:604px;margin-left:0;} +.table .span9{float:none;width:684px;margin-left:0;} +.table .span10{float:none;width:764px;margin-left:0;} +.table .span11{float:none;width:844px;margin-left:0;} +.table .span12{float:none;width:924px;margin-left:0;} +.table .span13{float:none;width:1004px;margin-left:0;} +.table .span14{float:none;width:1084px;margin-left:0;} +.table .span15{float:none;width:1164px;margin-left:0;} +.table .span16{float:none;width:1244px;margin-left:0;} +.table .span17{float:none;width:1324px;margin-left:0;} +.table .span18{float:none;width:1404px;margin-left:0;} +.table .span19{float:none;width:1484px;margin-left:0;} +.table .span20{float:none;width:1564px;margin-left:0;} +.table .span21{float:none;width:1644px;margin-left:0;} +.table .span22{float:none;width:1724px;margin-left:0;} +.table .span23{float:none;width:1804px;margin-left:0;} +.table .span24{float:none;width:1884px;margin-left:0;} +.table tbody tr.success td{background-color:#dff0d8;} +.table tbody tr.error td{background-color:#f2dede;} +.table tbody tr.warning td{background-color:#fcf8e3;} +.table tbody tr.info td{background-color:#d9edf7;} +.table-hover tbody tr.success:hover td{background-color:#d0e9c6;} +.table-hover tbody tr.error:hover td{background-color:#ebcccc;} +.table-hover tbody tr.warning:hover td{background-color:#faf2cc;} +.table-hover tbody tr.info:hover td{background-color:#c4e3f3;} +form{margin:0 0 20px;} +fieldset{padding:0;margin:0;border:0;} +legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333333;border:0;border-bottom:1px solid #e5e5e5;}legend small{font-size:15px;color:#999999;} +label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px;} +input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;} +label{display:block;margin-bottom:5px;} +select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:9px;font-size:14px;line-height:20px;color:#555555;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +input,textarea,.uneditable-input{width:206px;} +textarea{height:auto;} +textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#ffffff;border:1px solid #cccccc;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-webkit-transition:border linear .2s, box-shadow linear .2s;-moz-transition:border linear .2s, box-shadow linear .2s;-o-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82, 168, 236, 0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);} +input[type="radio"],input[type="checkbox"]{margin:4px 0 0;*margin-top:0;margin-top:1px \9;line-height:normal;cursor:pointer;} +input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto;} +select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px;} +select{width:220px;border:1px solid #cccccc;background-color:#ffffff;} +select[multiple],select[size]{height:auto;} +select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +.uneditable-input,.uneditable-textarea{color:#999999;background-color:#fcfcfc;border-color:#cccccc;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);cursor:not-allowed;} +.uneditable-input{overflow:hidden;white-space:nowrap;} +.uneditable-textarea{width:auto;height:auto;} +input:-moz-placeholder,textarea:-moz-placeholder{color:#999999;} +input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999999;} +input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999999;} +.radio,.checkbox{min-height:18px;padding-left:18px;} +.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-18px;} +.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px;} +.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle;} +.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px;} +.input-mini{width:60px;} +.input-small{width:90px;} +.input-medium{width:150px;} +.input-large{width:210px;} +.input-xlarge{width:270px;} +.input-xxlarge{width:530px;} +input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0;} +.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block;} +input,textarea,.uneditable-input{margin-left:0;} +.controls-row [class*="span"]+[class*="span"]{margin-left:20px;} +input.span12, textarea.span12, .uneditable-input.span12{width:926px;} +input.span11, textarea.span11, .uneditable-input.span11{width:846px;} +input.span10, textarea.span10, .uneditable-input.span10{width:766px;} +input.span9, textarea.span9, .uneditable-input.span9{width:686px;} +input.span8, textarea.span8, .uneditable-input.span8{width:606px;} +input.span7, textarea.span7, .uneditable-input.span7{width:526px;} +input.span6, textarea.span6, .uneditable-input.span6{width:446px;} +input.span5, textarea.span5, .uneditable-input.span5{width:366px;} +input.span4, textarea.span4, .uneditable-input.span4{width:286px;} +input.span3, textarea.span3, .uneditable-input.span3{width:206px;} +input.span2, textarea.span2, .uneditable-input.span2{width:126px;} +input.span1, textarea.span1, .uneditable-input.span1{width:46px;} +.controls-row{*zoom:1;}.controls-row:before,.controls-row:after{display:table;content:"";line-height:0;} +.controls-row:after{clear:both;} +.controls-row [class*="span"]{float:left;} +input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eeeeee;} +input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent;} +.control-group.warning>label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853;} +.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853;} +.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;} +.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853;} +.control-group.error>label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48;} +.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48;} +.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;} +.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48;} +.control-group.success>label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847;} +.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847;} +.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;} +.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847;} +.control-group.info>label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad;} +.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad;} +.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;} +.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad;} +input:focus:required:invalid,textarea:focus:required:invalid,select:focus:required:invalid{color:#b94a48;border-color:#ee5f5b;}input:focus:required:invalid:focus,textarea:focus:required:invalid:focus,select:focus:required:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7;} +.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1;}.form-actions:before,.form-actions:after{display:table;content:"";line-height:0;} +.form-actions:after{clear:both;} +.help-block,.help-inline{color:#595959;} +.help-block{display:block;margin-bottom:10px;} +.help-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding-left:5px;} +.input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap;}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;font-size:14px;vertical-align:top;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2;} +.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #ffffff;background-color:#eeeeee;border:1px solid #ccc;} +.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.input-append .active,.input-prepend .active{background-color:#bbff33;border-color:#669900;} +.input-prepend .add-on,.input-prepend .btn{margin-right:-1px;} +.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.input-append .add-on,.input-append .btn{margin-left:-1px;} +.input-append .add-on:last-child,.input-append .btn:last-child{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;} +.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;} +input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;} +.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px;} +.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0;} +.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0;} +.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px;} +.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;*zoom:1;margin-bottom:0;vertical-align:middle;} +.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none;} +.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block;} +.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0;} +.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle;} +.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0;} +.control-group{margin-bottom:10px;} +legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate;} +.form-horizontal .control-group{margin-bottom:20px;*zoom:1;}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;content:"";line-height:0;} +.form-horizontal .control-group:after{clear:both;} +.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right;} +.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0;}.form-horizontal .controls:first-child{*padding-left:180px;} +.form-horizontal .help-block{margin-bottom:0;} +.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block{margin-top:10px;} +.form-horizontal .form-actions{padding-left:180px;} +.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 14px;margin-bottom:0;font-size:14px;line-height:20px;*line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333333;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top, #ffffff, #e6e6e6);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(top, #ffffff, #e6e6e6);background-image:-o-linear-gradient(top, #ffffff, #e6e6e6);background-image:linear-gradient(to bottom, #ffffff, #e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border:1px solid #bbbbbb;*border:0;border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333333;background-color:#e6e6e6;*background-color:#d9d9d9;} +.btn:active,.btn.active{background-color:#cccccc \9;} +.btn:first-child{*margin-left:0;} +.btn:hover{color:#333333;text-decoration:none;background-color:#e6e6e6;*background-color:#d9d9d9;background-position:0 -15px;-webkit-transition:background-position 0.1s linear;-moz-transition:background-position 0.1s linear;-o-transition:background-position 0.1s linear;transition:background-position 0.1s linear;} +.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +.btn.active,.btn:active{background-color:#e6e6e6;background-color:#d9d9d9 \9;background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);} +.btn.disabled,.btn[disabled]{cursor:default;background-color:#e6e6e6;background-image:none;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} +.btn-large{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.btn-large [class^="icon-"]{margin-top:2px;} +.btn-small{padding:3px 9px;font-size:12px;line-height:18px;} +.btn-small [class^="icon-"]{margin-top:0;} +.btn-mini{padding:2px 6px;font-size:11px;line-height:17px;} +.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} +.btn-block+.btn-block{margin-top:5px;} +input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%;} +.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255, 255, 255, 0.75);} +.btn{border-color:#c5c5c5;border-color:rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);} +.btn-primary{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#008ada;background-image:-moz-linear-gradient(top, #0097ee, #0077bb);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0097ee), to(#0077bb));background-image:-webkit-linear-gradient(top, #0097ee, #0077bb);background-image:-o-linear-gradient(top, #0097ee, #0077bb);background-image:linear-gradient(to bottom, #0097ee, #0077bb);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0097ee', endColorstr='#ff0077bb', GradientType=0);border-color:#0077bb #0077bb #00466e;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#0077bb;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#ffffff;background-color:#0077bb;*background-color:#0067a2;} +.btn-primary:active,.btn-primary.active{background-color:#005788 \9;} +.btn-warning{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#ff9d2e;background-image:-moz-linear-gradient(top, #ffac4d, #ff8800);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffac4d), to(#ff8800));background-image:-webkit-linear-gradient(top, #ffac4d, #ff8800);background-image:-o-linear-gradient(top, #ffac4d, #ff8800);background-image:linear-gradient(to bottom, #ffac4d, #ff8800);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffac4d', endColorstr='#ffff8800', GradientType=0);border-color:#ff8800 #ff8800 #b35f00;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#ff8800;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#ffffff;background-color:#ff8800;*background-color:#e67a00;} +.btn-warning:active,.btn-warning.active{background-color:#cc6d00 \9;} +.btn-danger{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#da4f49;background-image:-moz-linear-gradient(top, #ee5f5b, #bd362f);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));background-image:-webkit-linear-gradient(top, #ee5f5b, #bd362f);background-image:-o-linear-gradient(top, #ee5f5b, #bd362f);background-image:linear-gradient(to bottom, #ee5f5b, #bd362f);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);border-color:#bd362f #bd362f #802420;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#bd362f;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#ffffff;background-color:#bd362f;*background-color:#a9302a;} +.btn-danger:active,.btn-danger.active{background-color:#942a25 \9;} +.btn-success{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#5bb75b;background-image:-moz-linear-gradient(top, #62c462, #51a351);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));background-image:-webkit-linear-gradient(top, #62c462, #51a351);background-image:-o-linear-gradient(top, #62c462, #51a351);background-image:linear-gradient(to bottom, #62c462, #51a351);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);border-color:#51a351 #51a351 #387038;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#51a351;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#ffffff;background-color:#51a351;*background-color:#499249;} +.btn-success:active,.btn-success.active{background-color:#408140 \9;} +.btn-info{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#49afcd;background-image:-moz-linear-gradient(top, #5bc0de, #2f96b4);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));background-image:-webkit-linear-gradient(top, #5bc0de, #2f96b4);background-image:-o-linear-gradient(top, #5bc0de, #2f96b4);background-image:linear-gradient(to bottom, #5bc0de, #2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#2f96b4;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#ffffff;background-color:#2f96b4;*background-color:#2a85a0;} +.btn-info:active,.btn-info.active{background-color:#24748c \9;} +.btn-inverse{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#363636;background-image:-moz-linear-gradient(top, #444444, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));background-image:-webkit-linear-gradient(top, #444444, #222222);background-image:-o-linear-gradient(top, #444444, #222222);background-image:linear-gradient(to bottom, #444444, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);border-color:#222222 #222222 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#222222;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#ffffff;background-color:#222222;*background-color:#151515;} +.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9;} +button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px;}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0;} +button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px;} +button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px;} +button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px;} +.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} +.btn-link{border-color:transparent;cursor:pointer;color:#0077bb;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.btn-link:hover{color:#00466e;text-decoration:underline;background-color:transparent;} +.btn-link[disabled]:hover{color:#333333;text-decoration:none;} +.btn-group{position:relative;font-size:0;vertical-align:middle;white-space:nowrap;*margin-left:.3em;}.btn-group:first-child{*margin-left:0;} +.btn-group+.btn-group{margin-left:5px;} +.btn-toolbar{font-size:0;margin-top:10px;margin-bottom:10px;}.btn-toolbar .btn-group{display:inline-block;*display:inline;*zoom:1;} +.btn-toolbar .btn+.btn,.btn-toolbar .btn-group+.btn,.btn-toolbar .btn+.btn-group{margin-left:5px;} +.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.btn-group>.btn+.btn{margin-left:-1px;} +.btn-group>.btn,.btn-group>.dropdown-menu{font-size:14px;} +.btn-group>.btn-mini{font-size:11px;} +.btn-group>.btn-small{font-size:12px;} +.btn-group>.btn-large{font-size:16px;} +.btn-group>.btn:first-child{margin-left:0;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;} +.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;} +.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-top-left-radius:6px;-moz-border-radius-topleft:6px;border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-moz-border-radius-bottomleft:6px;border-bottom-left-radius:6px;} +.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;-moz-border-radius-topright:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;-moz-border-radius-bottomright:6px;border-bottom-right-radius:6px;} +.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2;} +.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0;} +.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);*padding-top:5px;*padding-bottom:5px;} +.btn-group>.btn-mini+.dropdown-toggle{padding-left:5px;padding-right:5px;*padding-top:2px;*padding-bottom:2px;} +.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px;} +.btn-group>.btn-large+.dropdown-toggle{padding-left:12px;padding-right:12px;*padding-top:7px;*padding-bottom:7px;} +.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);} +.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6;} +.btn-group.open .btn-primary.dropdown-toggle{background-color:#0077bb;} +.btn-group.open .btn-warning.dropdown-toggle{background-color:#ff8800;} +.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f;} +.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351;} +.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4;} +.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222222;} +.btn .caret{margin-top:8px;margin-left:0;} +.btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px;} +.btn-large .caret{border-left-width:5px;border-right-width:5px;border-top-width:5px;} +.dropup .btn-large .caret{border-bottom:5px solid #000000;border-top:0;} +.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;} +.btn-group-vertical{display:inline-block;*display:inline;*zoom:1;} +.btn-group-vertical .btn{display:block;float:none;width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.btn-group-vertical .btn+.btn{margin-left:0;margin-top:-1px;} +.btn-group-vertical .btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;} +.btn-group-vertical .btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;} +.btn-group-vertical .btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0;} +.btn-group-vertical .btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;} +.nav{margin-left:0;margin-bottom:20px;list-style:none;} +.nav>li>a{display:block;} +.nav>li>a:hover{text-decoration:none;background-color:#eeeeee;} +.nav>.pull-right{float:right;} +.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999999;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);text-transform:uppercase;} +.nav li+.nav-header{margin-top:9px;} +.nav-list{padding-left:15px;padding-right:15px;margin-bottom:0;} +.nav-list>li>a,.nav-list .nav-header{margin-left:-15px;margin-right:-15px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);} +.nav-list>li>a{padding:3px 15px;} +.nav-list>.active>a,.nav-list>.active>a:hover{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.2);background-color:#0077bb;} +.nav-list [class^="icon-"]{margin-right:2px;} +.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;} +.nav-tabs,.nav-pills{*zoom:1;}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;content:"";line-height:0;} +.nav-tabs:after,.nav-pills:after{clear:both;} +.nav-tabs>li,.nav-pills>li{float:left;} +.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px;} +.nav-tabs{border-bottom:1px solid #ddd;} +.nav-tabs>li{margin-bottom:-1px;} +.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;}.nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #dddddd;} +.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555555;background-color:#ffffff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default;} +.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#ffffff;background-color:#0077bb;} +.nav-stacked>li{float:none;} +.nav-stacked>li>a{margin-right:0;} +.nav-tabs.nav-stacked{border-bottom:0;} +.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;} +.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;} +.nav-tabs.nav-stacked>li>a:hover{border-color:#ddd;z-index:2;} +.nav-pills.nav-stacked>li>a{margin-bottom:3px;} +.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px;} +.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;} +.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} +.nav .dropdown-toggle .caret{border-top-color:#0077bb;border-bottom-color:#0077bb;margin-top:6px;} +.nav .dropdown-toggle:hover .caret{border-top-color:#00466e;border-bottom-color:#00466e;} +.nav-tabs .dropdown-toggle .caret{margin-top:8px;} +.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff;} +.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555555;border-bottom-color:#555555;} +.nav>.dropdown.active>a:hover{cursor:pointer;} +.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#ffffff;background-color:#999999;border-color:#999999;} +.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;opacity:1;filter:alpha(opacity=100);} +.tabs-stacked .open>a:hover{border-color:#999999;} +.tabbable{*zoom:1;}.tabbable:before,.tabbable:after{display:table;content:"";line-height:0;} +.tabbable:after{clear:both;} +.tab-content{overflow:auto;} +.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0;} +.tab-content>.tab-pane,.pill-content>.pill-pane{display:none;} +.tab-content>.active,.pill-content>.active{display:block;} +.tabs-below>.nav-tabs{border-top:1px solid #ddd;} +.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0;} +.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.tabs-below>.nav-tabs>li>a:hover{border-bottom-color:transparent;border-top-color:#ddd;} +.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd;} +.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none;} +.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px;} +.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd;} +.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;} +.tabs-left>.nav-tabs>li>a:hover{border-color:#eeeeee #dddddd #eeeeee #eeeeee;} +.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#ffffff;} +.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd;} +.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;} +.tabs-right>.nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #eeeeee #dddddd;} +.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#ffffff;} +.nav>.disabled>a{color:#999999;} +.nav>.disabled>a:hover{text-decoration:none;background-color:transparent;cursor:default;} +.navbar{overflow:visible;margin-bottom:20px;color:#777777;*position:relative;*z-index:2;} +.navbar-inner{min-height:40px;padding-left:20px;padding-right:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top, #ffffff, #f2f2f2);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2));background-image:-webkit-linear-gradient(top, #ffffff, #f2f2f2);background-image:-o-linear-gradient(top, #ffffff, #f2f2f2);background-image:linear-gradient(to bottom, #ffffff, #f2f2f2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0);border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 4px rgba(0, 0, 0, 0.065);-moz-box-shadow:0 1px 4px rgba(0, 0, 0, 0.065);box-shadow:0 1px 4px rgba(0, 0, 0, 0.065);*zoom:1;}.navbar-inner:before,.navbar-inner:after{display:table;content:"";line-height:0;} +.navbar-inner:after{clear:both;} +.navbar .container{width:auto;} +.nav-collapse.collapse{height:auto;} +.navbar .brand{float:left;display:block;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777777;text-shadow:0 1px 0 #ffffff;}.navbar .brand:hover{text-decoration:none;} +.navbar-text{margin-bottom:0;line-height:40px;} +.navbar-link{color:#777777;}.navbar-link:hover{color:#333333;} +.navbar .divider-vertical{height:40px;margin:0 9px;border-left:1px solid #f2f2f2;border-right:1px solid #ffffff;} +.navbar .btn,.navbar .btn-group{margin-top:5px;} +.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn{margin-top:0;} +.navbar-form{margin-bottom:0;*zoom:1;}.navbar-form:before,.navbar-form:after{display:table;content:"";line-height:0;} +.navbar-form:after{clear:both;} +.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px;} +.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0;} +.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px;} +.navbar-form .input-append,.navbar-form .input-prepend{margin-top:6px;white-space:nowrap;}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0;} +.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0;}.navbar-search .search-query{margin-bottom:0;padding:4px 14px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;} +.navbar-static-top{position:static;width:100%;margin-bottom:0;}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0;} +.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px;} +.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0;} +.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-left:0;padding-right:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;} +.navbar-fixed-top{top:0;} +.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);} +.navbar-fixed-bottom{bottom:0;}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1);} +.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0;} +.navbar .nav.pull-right{float:right;margin-right:0;} +.navbar .nav>li{float:left;} +.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777777;text-decoration:none;text-shadow:0 1px 0 #ffffff;} +.navbar .nav .dropdown-toggle .caret{margin-top:8px;} +.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{background-color:transparent;color:#333333;text-decoration:none;} +.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0, 0, 0, 0.125);-moz-box-shadow:inset 0 3px 8px rgba(0, 0, 0, 0.125);box-shadow:inset 0 3px 8px rgba(0, 0, 0, 0.125);} +.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-left:5px;margin-right:5px;color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#ededed;background-image:-moz-linear-gradient(top, #f2f2f2, #e5e5e5);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5));background-image:-webkit-linear-gradient(top, #f2f2f2, #e5e5e5);background-image:-o-linear-gradient(top, #f2f2f2, #e5e5e5);background-image:linear-gradient(to bottom, #f2f2f2, #e5e5e5);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0);border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#e5e5e5;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#ffffff;background-color:#e5e5e5;*background-color:#d9d9d9;} +.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#cccccc \9;} +.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);-moz-box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);} +.btn-navbar .icon-bar+.icon-bar{margin-top:3px;} +.navbar .nav>li>.dropdown-menu:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0, 0, 0, 0.2);position:absolute;top:-7px;left:9px;} +.navbar .nav>li>.dropdown-menu:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #ffffff;position:absolute;top:-6px;left:10px;} +.navbar-fixed-bottom .nav>li>.dropdown-menu:before{border-top:7px solid #ccc;border-top-color:rgba(0, 0, 0, 0.2);border-bottom:0;bottom:-7px;top:auto;} +.navbar-fixed-bottom .nav>li>.dropdown-menu:after{border-top:6px solid #ffffff;border-bottom:0;bottom:-6px;top:auto;} +.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{background-color:#e5e5e5;color:#555555;} +.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777777;border-bottom-color:#777777;} +.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555555;border-bottom-color:#555555;} +.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{left:auto;right:0;}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{left:auto;right:12px;} +.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{left:auto;right:13px;} +.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{left:auto;right:100%;margin-left:0;margin-right:-1px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px;} +.navbar-inverse{color:#999999;}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top, #222222, #111111);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111));background-image:-webkit-linear-gradient(top, #222222, #111111);background-image:-o-linear-gradient(top, #222222, #111111);background-image:linear-gradient(to bottom, #222222, #111111);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0);border-color:#252525;} +.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999999;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#ffffff;} +.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{background-color:transparent;color:#ffffff;} +.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#ffffff;background-color:#111111;} +.navbar-inverse .navbar-link{color:#999999;}.navbar-inverse .navbar-link:hover{color:#ffffff;} +.navbar-inverse .divider-vertical{border-left-color:#111111;border-right-color:#222222;} +.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{background-color:#111111;color:#ffffff;} +.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999999;border-bottom-color:#999999;} +.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;} +.navbar-inverse .navbar-search .search-query{color:#ffffff;background-color:#515151;border-color:#111111;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none;}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#cccccc;} +.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#cccccc;} +.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#cccccc;} +.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333333;text-shadow:0 1px 0 #ffffff;background-color:#ffffff;border:0;-webkit-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);-moz-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);box-shadow:0 0 3px rgba(0, 0, 0, 0.15);outline:0;} +.navbar-inverse .btn-navbar{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#0e0e0e;background-image:-moz-linear-gradient(top, #151515, #040404);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404));background-image:-webkit-linear-gradient(top, #151515, #040404);background-image:-o-linear-gradient(top, #151515, #040404);background-image:linear-gradient(to bottom, #151515, #040404);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0);border-color:#040404 #040404 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#040404;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#ffffff;background-color:#040404;*background-color:#000000;} +.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000000 \9;} +.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.breadcrumb li{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 0 #ffffff;} +.breadcrumb .divider{padding:0 5px;color:#ccc;} +.breadcrumb .active{color:#999999;} +.pagination{height:40px;margin:20px 0;} +.pagination ul{display:inline-block;*display:inline;*zoom:1;margin-left:0;margin-bottom:0;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);} +.pagination ul>li{display:inline;} +.pagination ul>li>a,.pagination ul>li>span{float:left;padding:0 14px;line-height:38px;text-decoration:none;background-color:#ffffff;border:1px solid #dddddd;border-left-width:0;} +.pagination ul>li>a:hover,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5;} +.pagination ul>.active>a,.pagination ul>.active>span{color:#999999;cursor:default;} +.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover{color:#999999;background-color:transparent;cursor:default;} +.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;} +.pagination-centered{text-align:center;} +.pagination-right{text-align:right;} +.pager{margin:20px 0;list-style:none;text-align:center;*zoom:1;}.pager:before,.pager:after{display:table;content:"";line-height:0;} +.pager:after{clear:both;} +.pager li{display:inline;} +.pager a,.pager span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;} +.pager a:hover{text-decoration:none;background-color:#f5f5f5;} +.pager .next a,.pager .next span{float:right;} +.pager .previous a{float:left;} +.pager .disabled a,.pager .disabled a:hover,.pager .disabled span{color:#999999;background-color:#fff;cursor:default;} +.alert{padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;color:#c09853;} +.alert h4{margin:0;} +.alert .close{position:relative;top:-2px;right:-21px;line-height:20px;} +.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#468847;} +.alert-danger,.alert-error{background-color:#f2dede;border-color:#eed3d7;color:#b94a48;} +.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#3a87ad;} +.alert-block{padding-top:14px;padding-bottom:14px;} +.alert-block>p,.alert-block>ul{margin-bottom:0;} +.alert-block p+p{margin-top:5px;} +@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0;} to{background-position:0 0;}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0;} to{background-position:0 0;}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0;} to{background-position:0 0;}}@-o-keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}@keyframes progress-bar-stripes{from{background-position:40px 0;} to{background-position:0 0;}}.progress{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f7f7f7;background-image:-moz-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));background-image:-webkit-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-o-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:linear-gradient(to bottom, #f5f5f5, #f9f9f9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.progress .bar{width:0%;height:100%;color:#ffffff;float:left;font-size:12px;text-align:center;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top, #149bdf, #0480be);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));background-image:-webkit-linear-gradient(top, #149bdf, #0480be);background-image:-o-linear-gradient(top, #149bdf, #0480be);background-image:linear-gradient(to bottom, #149bdf, #0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width 0.6s ease;-moz-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease;} +.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);-moz-box-shadow:inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);box-shadow:inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);} +.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px;} +.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite;} +.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top, #ee5f5b, #c43c35);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));background-image:-webkit-linear-gradient(top, #ee5f5b, #c43c35);background-image:-o-linear-gradient(top, #ee5f5b, #c43c35);background-image:linear-gradient(to bottom, #ee5f5b, #c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0);} +.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top, #62c462, #57a957);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));background-image:-webkit-linear-gradient(top, #62c462, #57a957);background-image:-o-linear-gradient(top, #62c462, #57a957);background-image:linear-gradient(to bottom, #62c462, #57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0);} +.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top, #5bc0de, #339bb9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));background-image:-webkit-linear-gradient(top, #5bc0de, #339bb9);background-image:-o-linear-gradient(top, #5bc0de, #339bb9);background-image:linear-gradient(to bottom, #5bc0de, #339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0);} +.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.progress-warning .bar,.progress .bar-warning{background-color:#ff9d2e;background-image:-moz-linear-gradient(top, #ffac4d, #ff8800);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffac4d), to(#ff8800));background-image:-webkit-linear-gradient(top, #ffac4d, #ff8800);background-image:-o-linear-gradient(top, #ffac4d, #ff8800);background-image:linear-gradient(to bottom, #ffac4d, #ff8800);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffac4d', endColorstr='#ffff8800', GradientType=0);} +.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#ffac4d;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.tooltip{position:absolute;z-index:1030;display:block;visibility:visible;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);}.tooltip.in{opacity:0.8;filter:alpha(opacity=80);} +.tooltip.top{margin-top:-3px;} +.tooltip.right{margin-left:3px;} +.tooltip.bottom{margin-top:3px;} +.tooltip.left{margin-left:-3px;} +.tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;text-decoration:none;background-color:#000000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid;} +.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000000;} +.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000000;} +.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000000;} +.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000000;} +.popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;background-color:#ffffff;-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);}.popover.top{margin-bottom:10px;} +.popover.right{margin-left:10px;} +.popover.bottom{margin-top:10px;} +.popover.left{margin-right:10px;} +.popover-title{margin:0;padding:8px 14px;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0;} +.popover-content{padding:9px 14px;}.popover-content p,.popover-content ul,.popover-content ol{margin-bottom:0;} +.popover .arrow,.popover .arrow:after{position:absolute;display:inline-block;width:0;height:0;border-color:transparent;border-style:solid;} +.popover .arrow:after{content:"";z-index:-1;} +.popover.top .arrow{bottom:-10px;left:50%;margin-left:-10px;border-width:10px 10px 0;border-top-color:#ffffff;}.popover.top .arrow:after{border-width:11px 11px 0;border-top-color:rgba(0, 0, 0, 0.25);bottom:-1px;left:-11px;} +.popover.right .arrow{top:50%;left:-10px;margin-top:-10px;border-width:10px 10px 10px 0;border-right-color:#ffffff;}.popover.right .arrow:after{border-width:11px 11px 11px 0;border-right-color:rgba(0, 0, 0, 0.25);bottom:-11px;left:-1px;} +.popover.bottom .arrow{top:-10px;left:50%;margin-left:-10px;border-width:0 10px 10px;border-bottom-color:#ffffff;}.popover.bottom .arrow:after{border-width:0 11px 11px;border-bottom-color:rgba(0, 0, 0, 0.25);top:-1px;left:-11px;} +.popover.left .arrow{top:50%;right:-10px;margin-top:-10px;border-width:10px 0 10px 10px;border-left-color:#ffffff;}.popover.left .arrow:after{border-width:11px 0 11px 11px;border-left-color:rgba(0, 0, 0, 0.25);bottom:-11px;right:-1px;} +.dropup,.dropdown{position:relative;} +.dropdown-toggle{*margin-bottom:-3px;} +.dropdown-toggle:active,.open .dropdown-toggle{outline:0;} +.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000000;border-right:4px solid transparent;border-left:4px solid transparent;content:"";} +.dropdown .caret{margin-top:8px;margin-left:2px;} +.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#ffffff;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;}.dropdown-menu.pull-right{right:0;left:auto;} +.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;} +.dropdown-menu a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333333;white-space:nowrap;} +.dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{text-decoration:none;color:#ffffff;background-color:#0077bb;background-color:#0071b1;background-image:-moz-linear-gradient(top, #0077bb, #0067a2);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0077bb), to(#0067a2));background-image:-webkit-linear-gradient(top, #0077bb, #0067a2);background-image:-o-linear-gradient(top, #0077bb, #0067a2);background-image:linear-gradient(to bottom, #0077bb, #0067a2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077bb', endColorstr='#ff0067a2', GradientType=0);} +.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#ffffff;text-decoration:none;outline:0;background-color:#0077bb;background-color:#0071b1;background-image:-moz-linear-gradient(top, #0077bb, #0067a2);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0077bb), to(#0067a2));background-image:-webkit-linear-gradient(top, #0077bb, #0067a2);background-image:-o-linear-gradient(top, #0077bb, #0067a2);background-image:linear-gradient(to bottom, #0077bb, #0067a2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077bb', endColorstr='#ff0067a2', GradientType=0);} +.dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999999;} +.dropdown-menu .disabled>a:hover{text-decoration:none;background-color:transparent;cursor:default;} +.open{*z-index:1000;}.open >.dropdown-menu{display:block;} +.pull-right>.dropdown-menu{right:0;left:auto;} +.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000000;content:"";} +.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px;} +.dropdown-submenu{position:relative;} +.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;} +.dropdown-submenu:hover>.dropdown-menu{display:block;} +.dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#cccccc;margin-top:5px;margin-right:-10px;} +.dropdown-submenu:hover>a:after{border-left-color:#ffffff;} +.dropdown .dropdown-menu .nav-header{padding-left:20px;padding-right:20px;} +.typeahead{margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.accordion{margin-bottom:20px;} +.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.accordion-heading{border-bottom:0;} +.accordion-heading .accordion-toggle{display:block;padding:8px 15px;} +.accordion-toggle{cursor:pointer;} +.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5;} +.carousel{position:relative;margin-bottom:20px;line-height:1;} +.carousel-inner{overflow:hidden;width:100%;position:relative;} +.carousel .item{display:none;position:relative;-webkit-transition:0.6s ease-in-out left;-moz-transition:0.6s ease-in-out left;-o-transition:0.6s ease-in-out left;transition:0.6s ease-in-out left;} +.carousel .item>img{display:block;line-height:1;} +.carousel .active,.carousel .next,.carousel .prev{display:block;} +.carousel .active{left:0;} +.carousel .next,.carousel .prev{position:absolute;top:0;width:100%;} +.carousel .next{left:100%;} +.carousel .prev{left:-100%;} +.carousel .next.left,.carousel .prev.right{left:0;} +.carousel .active.left{left:-100%;} +.carousel .active.right{left:100%;} +.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#ffffff;text-align:center;background:#222222;border:3px solid #ffffff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:0.5;filter:alpha(opacity=50);}.carousel-control.right{left:auto;right:15px;} +.carousel-control:hover{color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90);} +.carousel-caption{position:absolute;left:0;right:0;bottom:0;padding:15px;background:#333333;background:rgba(0, 0, 0, 0.75);} +.carousel-caption h4,.carousel-caption p{color:#ffffff;line-height:20px;} +.carousel-caption h4{margin:0 0 5px;} +.carousel-caption p{margin-bottom:0;} +.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);} +.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} +.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000000;text-shadow:0 1px 0 #ffffff;opacity:0.2;filter:alpha(opacity=20);}.close:hover{color:#000000;text-decoration:none;cursor:pointer;opacity:0.4;filter:alpha(opacity=40);} +button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none;} +.pull-right{float:right;} +.pull-left{float:left;} +.hide{display:none;} +.show{display:block;} +.invisible{visibility:hidden;} +.affix{position:fixed;} +.fade{opacity:0;-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;}.fade.in{opacity:1;} +.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height 0.35s ease;-moz-transition:height 0.35s ease;-o-transition:height 0.35s ease;transition:height 0.35s ease;}.collapse.in{height:auto;} +.hidden{display:none;visibility:hidden;} +.visible-phone{display:none !important;} +.visible-tablet{display:none !important;} +.hidden-desktop{display:none !important;} +.visible-desktop{display:inherit !important;} +@media (min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit !important;} .visible-desktop{display:none !important ;} .visible-tablet{display:inherit !important;} .hidden-tablet{display:none !important;}}@media (max-width:767px){.hidden-desktop{display:inherit !important;} .visible-desktop{display:none !important;} .visible-phone{display:inherit !important;} .hidden-phone{display:none !important;}}@media (max-width:767px){body{padding-left:20px;padding-right:20px;} .navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-left:-20px;margin-right:-20px;} .container-fluid{padding:0;} .dl-horizontal dt{float:none;clear:none;width:auto;text-align:left;} .dl-horizontal dd{margin-left:0;} .container{width:auto;} .row-fluid{width:100%;} .row,.thumbnails{margin-left:0;} .thumbnails>li{float:none;margin-left:0;} [class*="span"],.row-fluid [class*="span"]{float:none;display:block;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} .span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} .input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} .input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto;} .controls-row [class*="span"]+[class*="span"]{margin-left:0;} .modal{position:fixed;top:20px;left:20px;right:20px;width:auto;margin:0;}.modal.fade.in{top:auto;}}@media (max-width:480px){.nav-collapse{-webkit-transform:translate3d(0, 0, 0);} .page-header h1 small{display:block;line-height:20px;} input[type="checkbox"],input[type="radio"]{border:1px solid #ccc;} .form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left;} .form-horizontal .controls{margin-left:0;} .form-horizontal .control-list{padding-top:0;} .form-horizontal .form-actions{padding-left:10px;padding-right:10px;} .modal{top:10px;left:10px;right:10px;} .modal-header .close{padding:10px;margin:-10px;} .carousel-caption{position:static;}}@media (min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:"";line-height:0;} .row:after{clear:both;} [class*="span"]{float:left;min-height:1px;margin-left:20px;} .container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px;} .span12{width:724px;} .span11{width:662px;} .span10{width:600px;} .span9{width:538px;} .span8{width:476px;} .span7{width:414px;} .span6{width:352px;} .span5{width:290px;} .span4{width:228px;} .span3{width:166px;} .span2{width:104px;} .span1{width:42px;} .offset12{margin-left:764px;} .offset11{margin-left:702px;} .offset10{margin-left:640px;} .offset9{margin-left:578px;} .offset8{margin-left:516px;} .offset7{margin-left:454px;} .offset6{margin-left:392px;} .offset5{margin-left:330px;} .offset4{margin-left:268px;} .offset3{margin-left:206px;} .offset2{margin-left:144px;} .offset1{margin-left:82px;} .row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0;} .row-fluid:after{clear:both;} .row-fluid [class*="span"]{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;} .row-fluid [class*="span"]:first-child{margin-left:0;} .row-fluid .span12{width:100%;*width:99.94680851063829%;} .row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%;} .row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%;} .row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%;} .row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%;} .row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%;} .row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%;} .row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%;} .row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%;} .row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%;} .row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%;} .row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%;} .row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%;} .row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%;} .row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%;} .row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%;} .row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%;} .row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%;} .row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%;} .row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%;} .row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%;} .row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%;} .row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%;} .row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%;} .row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%;} .row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%;} .row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%;} .row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%;} .row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%;} .row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%;} .row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%;} .row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%;} .row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%;} .row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%;} .row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%;} .row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%;} input,textarea,.uneditable-input{margin-left:0;} .controls-row [class*="span"]+[class*="span"]{margin-left:20px;} input.span12, textarea.span12, .uneditable-input.span12{width:710px;} input.span11, textarea.span11, .uneditable-input.span11{width:648px;} input.span10, textarea.span10, .uneditable-input.span10{width:586px;} input.span9, textarea.span9, .uneditable-input.span9{width:524px;} input.span8, textarea.span8, .uneditable-input.span8{width:462px;} input.span7, textarea.span7, .uneditable-input.span7{width:400px;} input.span6, textarea.span6, .uneditable-input.span6{width:338px;} input.span5, textarea.span5, .uneditable-input.span5{width:276px;} input.span4, textarea.span4, .uneditable-input.span4{width:214px;} input.span3, textarea.span3, .uneditable-input.span3{width:152px;} input.span2, textarea.span2, .uneditable-input.span2{width:90px;} input.span1, textarea.span1, .uneditable-input.span1{width:28px;}}@media (min-width:1200px){.row{margin-left:-30px;*zoom:1;}.row:before,.row:after{display:table;content:"";line-height:0;} .row:after{clear:both;} [class*="span"]{float:left;min-height:1px;margin-left:30px;} .container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px;} .span12{width:1170px;} .span11{width:1070px;} .span10{width:970px;} .span9{width:870px;} .span8{width:770px;} .span7{width:670px;} .span6{width:570px;} .span5{width:470px;} .span4{width:370px;} .span3{width:270px;} .span2{width:170px;} .span1{width:70px;} .offset12{margin-left:1230px;} .offset11{margin-left:1130px;} .offset10{margin-left:1030px;} .offset9{margin-left:930px;} .offset8{margin-left:830px;} .offset7{margin-left:730px;} .offset6{margin-left:630px;} .offset5{margin-left:530px;} .offset4{margin-left:430px;} .offset3{margin-left:330px;} .offset2{margin-left:230px;} .offset1{margin-left:130px;} .row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0;} .row-fluid:after{clear:both;} .row-fluid [class*="span"]{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;} .row-fluid [class*="span"]:first-child{margin-left:0;} .row-fluid .span12{width:100%;*width:99.94680851063829%;} .row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%;} .row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%;} .row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%;} .row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%;} .row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%;} .row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%;} .row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%;} .row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%;} .row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%;} .row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%;} .row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%;} .row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%;} .row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%;} .row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%;} .row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%;} .row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%;} .row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%;} .row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%;} .row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%;} .row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%;} .row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%;} .row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%;} .row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%;} .row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%;} .row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%;} .row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%;} .row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%;} .row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%;} .row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%;} .row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%;} .row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%;} .row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%;} .row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%;} .row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%;} .row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%;} input,textarea,.uneditable-input{margin-left:0;} .controls-row [class*="span"]+[class*="span"]{margin-left:30px;} input.span12, textarea.span12, .uneditable-input.span12{width:1156px;} input.span11, textarea.span11, .uneditable-input.span11{width:1056px;} input.span10, textarea.span10, .uneditable-input.span10{width:956px;} input.span9, textarea.span9, .uneditable-input.span9{width:856px;} input.span8, textarea.span8, .uneditable-input.span8{width:756px;} input.span7, textarea.span7, .uneditable-input.span7{width:656px;} input.span6, textarea.span6, .uneditable-input.span6{width:556px;} input.span5, textarea.span5, .uneditable-input.span5{width:456px;} input.span4, textarea.span4, .uneditable-input.span4{width:356px;} input.span3, textarea.span3, .uneditable-input.span3{width:256px;} input.span2, textarea.span2, .uneditable-input.span2{width:156px;} input.span1, textarea.span1, .uneditable-input.span1{width:56px;} .thumbnails{margin-left:-30px;} .thumbnails>li{margin-left:30px;} .row-fluid .thumbnails{margin-left:0;}}@media (max-width:979px){body{padding-top:0;} .navbar-fixed-top,.navbar-fixed-bottom{position:static;} .navbar-fixed-top{margin-bottom:20px;} .navbar-fixed-bottom{margin-top:20px;} .navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px;} .navbar .container{width:auto;padding:0;} .navbar .brand{padding-left:10px;padding-right:10px;margin:0 0 0 -5px;} .nav-collapse{clear:both;} .nav-collapse .nav{float:none;margin:0 0 10px;} .nav-collapse .nav>li{float:none;} .nav-collapse .nav>li>a{margin-bottom:2px;} .nav-collapse .nav>.divider-vertical{display:none;} .nav-collapse .nav .nav-header{color:#777777;text-shadow:none;} .nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} .nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} .nav-collapse .dropdown-menu li+li a{margin-bottom:2px;} .nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2;} .navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111111;} .nav-collapse.in .btn-group{margin-top:5px;padding:0;} .nav-collapse .dropdown-menu{position:static;top:auto;left:auto;float:none;display:block;max-width:none;margin:0 15px;padding:0;background-color:transparent;border:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} .nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none;} .nav-collapse .dropdown-menu .divider{display:none;} .nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none;} .nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);} .navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111111;border-bottom-color:#111111;} .navbar .nav-collapse .nav.pull-right{float:none;margin-left:0;} .nav-collapse,.nav-collapse.collapse{overflow:hidden;height:0;} .navbar .btn-navbar{display:block;} .navbar-static .navbar-inner{padding-left:10px;padding-right:10px;}}@media (min-width:980px){.nav-collapse.collapse{height:auto !important;overflow:visible !important;}} diff --git a/plugins/system/t3/admin/bootstrap/img/glyphicons-halflings-white.png b/plugins/system/t3/admin/bootstrap/img/glyphicons-halflings-white.png new file mode 100644 index 0000000..3bf6484 Binary files /dev/null and b/plugins/system/t3/admin/bootstrap/img/glyphicons-halflings-white.png differ diff --git a/plugins/system/t3/admin/bootstrap/img/glyphicons-halflings.png b/plugins/system/t3/admin/bootstrap/img/glyphicons-halflings.png new file mode 100644 index 0000000..a996999 Binary files /dev/null and b/plugins/system/t3/admin/bootstrap/img/glyphicons-halflings.png differ diff --git a/plugins/system/t3/admin/bootstrap/index.html b/plugins/system/t3/admin/bootstrap/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/plugins/system/t3/admin/bootstrap/index.html @@ -0,0 +1 @@ + diff --git a/plugins/system/t3/admin/bootstrap/js/bootstrap.js b/plugins/system/t3/admin/bootstrap/js/bootstrap.js new file mode 100644 index 0000000..643e71c --- /dev/null +++ b/plugins/system/t3/admin/bootstrap/js/bootstrap.js @@ -0,0 +1,2280 @@ +/* =================================================== + * bootstrap-transition.js v2.3.2 + * http://twitter.github.com/bootstrap/javascript.html#transitions + * =================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) + * ======================================================= */ + + $(function () { + + $.support.transition = (function () { + + var transitionEnd = (function () { + + var el = document.createElement('bootstrap') + , transEndEventNames = { + 'WebkitTransition' : 'webkitTransitionEnd' + , 'MozTransition' : 'transitionend' + , 'OTransition' : 'oTransitionEnd otransitionend' + , 'transition' : 'transitionend' + } + , name + + for (name in transEndEventNames){ + if (el.style[name] !== undefined) { + return transEndEventNames[name] + } + } + + }()) + + return transitionEnd && { + end: transitionEnd + } + + })() + + }) + +}(window.jQuery);/* ========================================================== + * bootstrap-alert.js v2.3.2 + * http://twitter.github.com/bootstrap/javascript.html#alerts + * ========================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* ALERT CLASS DEFINITION + * ====================== */ + + var dismiss = '[data-dismiss="alert"]' + , Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + + Alert.prototype.close = function (e) { + var $this = $(this) + , selector = $this.attr('data-target') + , $parent + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + $parent = $(selector) + + e && e.preventDefault() + + $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) + + $parent.trigger(e = $.Event('close')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + $parent + .trigger('closed') + .remove() + } + + $.support.transition && $parent.hasClass('fade') ? + $parent.on($.support.transition.end, removeElement) : + removeElement() + } + + + /* ALERT PLUGIN DEFINITION + * ======================= */ + + var old = $.fn.alert + + $.fn.alert = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('alert') + if (!data) $this.data('alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.alert.Constructor = Alert + + + /* ALERT NO CONFLICT + * ================= */ + + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } + + + /* ALERT DATA-API + * ============== */ + + $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) + +}(window.jQuery);/* ============================================================ + * bootstrap-button.js v2.3.2 + * http://twitter.github.com/bootstrap/javascript.html#buttons + * ============================================================ + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* BUTTON PUBLIC CLASS DEFINITION + * ============================== */ + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.button.defaults, options) + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + , $el = this.$element + , data = $el.data() + , val = $el.is('input') ? 'val' : 'html' + + state = state + 'Text' + data.resetText || $el.data('resetText', $el[val]()) + + $el[val](data[state] || this.options[state]) + + // push to event loop to allow forms to submit + setTimeout(function () { + state == 'loadingText' ? + $el.addClass(d).attr(d, d) : + $el.removeClass(d).removeAttr(d) + }, 0) + } + + Button.prototype.toggle = function () { + var $parent = this.$element.closest('[data-toggle="buttons-radio"]') + + $parent && $parent + .find('.active') + .removeClass('active') + + this.$element.toggleClass('active') + } + + + /* BUTTON PLUGIN DEFINITION + * ======================== */ + + var old = $.fn.button + + $.fn.button = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('button') + , options = typeof option == 'object' && option + if (!data) $this.data('button', (data = new Button(this, options))) + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + $.fn.button.defaults = { + loadingText: 'loading...' + } + + $.fn.button.Constructor = Button + + + /* BUTTON NO CONFLICT + * ================== */ + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + + /* BUTTON DATA-API + * =============== */ + + $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + }) + +}(window.jQuery);/* ========================================================== + * bootstrap-carousel.js v2.3.2 + * http://twitter.github.com/bootstrap/javascript.html#carousel + * ========================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* CAROUSEL CLASS DEFINITION + * ========================= */ + + var Carousel = function (element, options) { + this.$element = $(element) + this.$indicators = this.$element.find('.carousel-indicators') + this.options = options + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) + } + + Carousel.prototype = { + + cycle: function (e) { + if (!e) this.paused = false + if (this.interval) clearInterval(this.interval); + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + return this + } + + , getActiveIndex: function () { + this.$active = this.$element.find('.item.active') + this.$items = this.$active.parent().children() + return this.$items.index(this.$active) + } + + , to: function (pos) { + var activeIndex = this.getActiveIndex() + , that = this + + if (pos > (this.$items.length - 1) || pos < 0) return + + if (this.sliding) { + return this.$element.one('slid', function () { + that.to(pos) + }) + } + + if (activeIndex == pos) { + return this.pause().cycle() + } + + return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) + } + + , pause: function (e) { + if (!e) this.paused = true + if (this.$element.find('.next, .prev').length && $.support.transition.end) { + this.$element.trigger($.support.transition.end) + this.cycle(true) + } + clearInterval(this.interval) + this.interval = null + return this + } + + , next: function () { + if (this.sliding) return + return this.slide('next') + } + + , prev: function () { + if (this.sliding) return + return this.slide('prev') + } + + , slide: function (type, next) { + var $active = this.$element.find('.item.active') + , $next = next || $active[type]() + , isCycling = this.interval + , direction = type == 'next' ? 'left' : 'right' + , fallback = type == 'next' ? 'first' : 'last' + , that = this + , e + + this.sliding = true + + isCycling && this.pause() + + $next = $next.length ? $next : this.$element.find('.item')[fallback]() + + e = $.Event('slide', { + relatedTarget: $next[0] + , direction: direction + }) + + if ($next.hasClass('active')) return + + if (this.$indicators.length) { + this.$indicators.find('.active').removeClass('active') + this.$element.one('slid', function () { + var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) + $nextIndicator && $nextIndicator.addClass('active') + }) + } + + if ($.support.transition && this.$element.hasClass('slide')) { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + this.$element.one($.support.transition.end, function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { that.$element.trigger('slid') }, 0) + }) + } else { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid') + } + + isCycling && this.cycle() + + return this + } + + } + + + /* CAROUSEL PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.carousel + + $.fn.carousel = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('carousel') + , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) + , action = typeof option == 'string' ? option : options.slide + if (!data) $this.data('carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.pause().cycle() + }) + } + + $.fn.carousel.defaults = { + interval: 5000 + , pause: 'hover' + } + + $.fn.carousel.Constructor = Carousel + + + /* CAROUSEL NO CONFLICT + * ==================== */ + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + + /* CAROUSEL DATA-API + * ================= */ + + $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { + var $this = $(this), href + , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + , options = $.extend({}, $target.data(), $this.data()) + , slideIndex + + $target.carousel(options) + + if (slideIndex = $this.attr('data-slide-to')) { + $target.data('carousel').pause().to(slideIndex).cycle() + } + + e.preventDefault() + }) + +}(window.jQuery);/* ============================================================= + * bootstrap-collapse.js v2.3.2 + * http://twitter.github.com/bootstrap/javascript.html#collapse + * ============================================================= + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* COLLAPSE PUBLIC CLASS DEFINITION + * ================================ */ + + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.collapse.defaults, options) + + if (this.options.parent) { + this.$parent = $(this.options.parent) + } + + this.options.toggle && this.toggle() + } + + Collapse.prototype = { + + constructor: Collapse + + , dimension: function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + , show: function () { + var dimension + , scroll + , actives + , hasData + + if (this.transitioning || this.$element.hasClass('in')) return + + dimension = this.dimension() + scroll = $.camelCase(['scroll', dimension].join('-')) + actives = this.$parent && this.$parent.find('> .accordion-group > .in') + + if (actives && actives.length) { + hasData = actives.data('collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('collapse', null) + } + + this.$element[dimension](0) + this.transition('addClass', $.Event('show'), 'shown') + $.support.transition && this.$element[dimension](this.$element[0][scroll]) + } + + , hide: function () { + var dimension + if (this.transitioning || !this.$element.hasClass('in')) return + dimension = this.dimension() + this.reset(this.$element[dimension]()) + this.transition('removeClass', $.Event('hide'), 'hidden') + this.$element[dimension](0) + } + + , reset: function (size) { + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + [dimension](size || 'auto') + [0].offsetWidth + + this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') + + return this + } + + , transition: function (method, startEvent, completeEvent) { + var that = this + , complete = function () { + if (startEvent.type == 'show') that.reset() + that.transitioning = 0 + that.$element.trigger(completeEvent) + } + + this.$element.trigger(startEvent) + + if (startEvent.isDefaultPrevented()) return + + this.transitioning = 1 + + this.$element[method]('in') + + $.support.transition && this.$element.hasClass('collapse') ? + this.$element.one($.support.transition.end, complete) : + complete() + } + + , toggle: function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + } + + + /* COLLAPSE PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.collapse + + $.fn.collapse = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('collapse') + , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option) + if (!data) $this.data('collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.collapse.defaults = { + toggle: true + } + + $.fn.collapse.Constructor = Collapse + + + /* COLLAPSE NO CONFLICT + * ==================== */ + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + /* COLLAPSE DATA-API + * ================= */ + + $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { + var $this = $(this), href + , target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + , option = $(target).data('collapse') ? 'toggle' : $this.data() + $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + $(target).collapse(option) + }) + +}(window.jQuery);/* ============================================================ + * bootstrap-dropdown.js v2.3.2 + * http://twitter.github.com/bootstrap/javascript.html#dropdowns + * ============================================================ + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* DROPDOWN CLASS DEFINITION + * ========================= */ + + var toggle = '[data-toggle=dropdown]' + , Dropdown = function (element) { + var $el = $(element).on('click.dropdown.data-api', this.toggle) + $('html').on('click.dropdown.data-api', function () { + $el.parent().removeClass('open') + }) + } + + Dropdown.prototype = { + + constructor: Dropdown + + , toggle: function (e) { + var $this = $(this) + , $parent + , isActive + + if ($this.is('.disabled, :disabled')) return + + $parent = getParent($this) + + isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + if ('ontouchstart' in document.documentElement) { + // if mobile we we use a backdrop because click events don't delegate + $('