Пример #1
0
 public function actionOptions()
 {
     $method = $this->_input->filterSingle('shortName', XenForo_Input::STRING);
     $options = Shorten_URL::getOptions($method);
     if ($options) {
         $optionModel = XenForo_Model::create('XenForo_Model_Option');
         $viewParams = array('method' => $method, 'groups' => $optionModel->prepareOptionGroups($optionModel->getOptionGroupList()), 'preparedOptions' => $optionModel->prepareOptions($options), 'canEditGroup' => false, 'canEditOptionDefinition' => false);
         return $this->responseView('XenForo_ViewAdmin_Option_ListOptions', 'su_method_options', $viewParams);
     }
     return $this->responseError('This method has no options or is not installed!');
 }
Пример #2
0
 public function actionTest()
 {
     $method = $this->_input->filterSingle('method', XenForo_Input::STRING);
     $url = $this->_input->filterSingle('url', XenForo_Input::STRING);
     if (empty($url) || empty($method)) {
         return $this->responseError('Both Method and URL needs to be supplied!');
     }
     XenForo_Application::autoload('Shorten_URL');
     $Details = array();
     $Details['name'] = $method;
     $Details['url'] = Shorten_URL::shorten($url, $method);
     if (!$Details['url']) {
         $Details['url'] = 'ERROR';
     }
     return $this->responseView('XenForo_ViewAdmin_Sutest_Method_Test', 'sutest_method_test', array('details' => $Details));
 }