Esempio n. 1
0
 public function route($params)
 {
     return \DF\Url::route($params, $this->di);
 }
Esempio n. 2
0
 public static function getEpisodeLocalUrl($row, $origin = NULL)
 {
     return Url::route(array('module' => 'default', 'controller' => 'show', 'action' => 'episode', 'id' => $row['podcast_id'], 'episode' => $row['id'], 'origin' => $origin));
 }
Esempio n. 3
0
<?php

/**
 * Login Form
 */
return array('method' => 'post', 'elements' => array('username' => array('text', array('label' => 'E-mail Address', 'class' => 'half-width', 'spellcheck' => 'false', 'required' => true)), 'password' => array('password', array('label' => 'Password', 'description' => '<a href="' . \DF\Url::route(array('module' => 'default', 'controller' => 'account', 'action' => 'forgot')) . '">Forgot your password?</a>', 'class' => 'half-width', 'required' => true)), 'submit' => array('submit', array('type' => 'submit', 'label' => 'Log in', 'helper' => 'formButton', 'class' => 'ui-button'))));
Esempio n. 4
0
<?php

return array('method' => 'post', 'enctype' => 'multipart/form-data', 'groups' => array('intro' => array('legend' => 'About Artist Profiles', 'elements' => array('intro_text' => array('markup', array('markup' => '
                    <p>Thank you for submitting your Artist profile to the Ponyville Live system! Here at PVL, our growing network of radio stations, video streams and podcasts are built upon the brilliant work created by the Brony community at large, and our Artist Center is one small way that we can work directly with the artists creating this amazing content.</p>

                    <p>Artist profiles are Ponyville Live\'s way of putting you in charge of how your creative output is presented on our network, and giving you tools to work more closely with us. The Artist profile is especially useful if you are a musician or vocalist. By creating an artist profile, musicians can not only see how all of their music is performing across the network (including which songs are liked the most, played the most, etc), but you can also submit new music directly to all Ponyville Live stations from one single system.</p>

                    <p>Just so you know, we also list every artist who submits a profile on our system in our public Artists Directory, so that we can bring more exposure to your work, and direct people to your social media pages where your art originates. All of the contact information in the "Social Netowrking Links" section below is completely optional, but we encourage you to supply any items that are relevant to the work you create.</p>

                    <h3>Artist Verification</h3>
                    <p>We want to make sure that the person submitting your profile is actually you! For this reason, we require any artist profiles submitted through our system to be verified by our staff.</p>
                    <p>There are several ways to verify your profile after submitting it:</p>
                    <ul>
                        <li>Send a tweet to <a href="http://twitter.com/ponyvillelive" target="_blank">@PonyvilleLive</a> from your Twitter account,</li>
                        <li>Send an e-mail to <a href="mailto:pr@ponyvillelive.com" target="_blank">our PR team</a> with your contact information, or</li>
                        <li>Contact a member of our team on Skype or elsewhere. You can find all of our essential contact information from our <a href="' . \DF\Url::route(array('module' => 'frontend', 'controller' => 'index', 'action' => 'contact')) . '" target="_blank">Contact Us page</a>.</li>
                    </ul>
                    <p>Once your profile has been approved, you will be able to access the Artist Center by logging in to the Ponyville Live! homepage.</p>
                ')))), 'profile' => array('legend' => 'Basic Details', 'description' => 'This basic profile information will be shown to the public in our Artists Directory.', 'elements' => array('name' => array('text', array('label' => 'Your Name', 'class' => 'half-width', 'required' => true)), 'description' => array('textarea', array('label' => 'Describe Yourself', 'description' => 'Tell us about what you do in the pony community, what projects you\'ve worked with, or how you want to contribute in the future.', 'class' => 'full-width half-height')), 'types' => array('multiCheckbox', array('label' => 'Type(s) of Art Created', 'multiOptions' => \Entity\ArtistType::fetchSelect(), 'required' => true)), 'web_url' => array('text', array('label' => 'Personal Web Site Address', 'class' => 'half-width', 'filters' => array('WebAddress'))), 'image_url' => array('file', array('label' => 'Avatar', 'description' => 'This is the small image that appears on your profile. Images should be under 150x150px in size. Larger images will automatically be scaled.')))), 'social' => array('legend' => 'Social Networking Links', 'description' => '
                Adding links to these services allows us to automatically update our users about your new releases and other social activity.<br>
                All fields are optional. Most of the time, your web address for these services will match the format shown in the field.
            ', 'elements' => array('twitter_url' => array('text', array('label' => 'Twitter Address', 'class' => 'half-width', 'filters' => array('WebAddress'), 'placeholder' => 'http://www.twitter.com/YourUsername')), 'tumblr_url' => array('text', array('label' => 'Tumblr Address', 'class' => 'half-width', 'filters' => array('WebAddress'), 'placeholder' => 'http://YourUsername.tumblr.com')), 'facebook_url' => array('text', array('label' => 'Facebook Address', 'class' => 'half-width', 'filters' => array('WebAddress'), 'placeholder' => 'http://www.facebook.com/YourUserName')), 'youtube_url' => array('text', array('label' => 'YouTube Address', 'class' => 'half-width', 'filters' => array('WebAddress'), 'placeholder' => 'http://www.youtube.com/YourUsername')), 'soundcloud_url' => array('text', array('label' => 'SoundCloud Address', 'class' => 'half-width', 'filters' => array('WebAddress'), 'placeholder' => 'http://www.soundcloud.com/YourUsername')), 'deviantart_url' => array('text', array('label' => 'DeviantArt Address', 'class' => 'half-width', 'filters' => array('WebAddress'), 'placeholder' => 'http://YourUsername.deviantart.com')), 'rss_url' => array('text', array('label' => 'RSS Feed Address', 'description' => '<a href="http://www.whatisrss.com/" target="_blank">What is RSS?</a>', 'class' => 'half-width', 'filters' => array('WebAddress'))))), 'sharing' => array('legend' => 'Sharing Settings', 'description' => 'Your Sharing Settings put you in control of how your content is shared across the Ponyville Live! network of stations.', 'elements' => array('about_sharing' => array('markup', array('label' => 'About Sharing Permissions', 'markup' => '
                        <p>The "Permission to Broadcast Content" setting below is your way of instructing the team at all Ponyville Live stations on how to broadcast or present the content you produce.</p>

                        <p>There are several important things to know about this setting:</p>

                        <dl>
                            <dt>This is not a formal or legally binding agreement.</dt>
                            <dd>We aren\'t lawyers, so we\'ll keep it simple: we make every effort to respect your preferences as an artist, but we aren\'t perfect. Much like many Brony community projects, this is a fun non-commercial hobby for us, and we don\'t want to bog it down with complex legalese. Consider this page an indication of preferences and not a legally binding document.</dd>

                            <dt>Stations operate independently from the Ponyville Live network.</dt>
Esempio n. 5
0
 public static function conventionUrls()
 {
     $urls = array();
     $short_names = Convention::getShortNameLookup();
     foreach ($short_names as $short_name => $record) {
         $urls[$short_name] = \DF\Url::route(array('module' => 'default', 'controller' => 'convention', 'action' => 'archive', 'id' => $record['id']));
     }
     return $urls;
 }
Esempio n. 6
0
 /**
  * Redirect to the route specified.
  *
  * @param $route
  * @param int $code
  */
 public function redirectToRoute($route, $code = 302)
 {
     $this->doNotRender();
     return $this->response->redirect(Url::route($route, $this->di), $code);
 }
Esempio n. 7
0
 public function loginAction()
 {
     if (!$_POST) {
         $this->storeReferrer('login', false);
         $this->forceSecure();
     }
     $form = new \DF\Form($this->current_module_config->forms->login);
     if ($this->hasParam('provider')) {
         $provider_name = $this->getParam('provider');
         try {
             $ha_config = $this->_getHybridConfig();
             $hybridauth = new \Hybrid_Auth($ha_config);
             // try to authenticate with the selected provider
             $adapter = $hybridauth->authenticate($provider_name);
             if ($hybridauth->isConnectedWith($provider_name)) {
                 $user_profile = $adapter->getUserProfile();
                 $user = UserExternal::processExternal($provider_name, $user_profile);
                 $this->auth->setUser($user);
             }
         } catch (\Exception $e) {
             if ($e instanceof \PVL\Exception\AccountNotLinked) {
                 $this->alert('<b>Your social network account is not linked to a PVL account yet!</b><br>Sign in below, or create a new PVL account, then link your social accounts from your profile.', 'red');
             } else {
                 $this->alert($e->getMessage(), 'red');
             }
         }
     } else {
         if ($_POST) {
             if ($form->isValid($_POST)) {
                 $login_success = $this->auth->authenticate($form->getValues());
                 if ($login_success) {
                     $user = $this->auth->getLoggedInUser();
                     $this->alert('<b>Logged in successfully. Welcome back, ' . $user->name . '!</b><br>For security purposes, log off when your session is complete.', 'green');
                     if ($this->acl->isAllowed('view administration')) {
                         $default_url = \DF\Url::route(array('module' => 'admin'));
                     } else {
                         $default_url = \DF\Url::route(array('module' => 'default'));
                     }
                     return $this->redirectToStoredReferrer('login', $default_url);
                 }
             }
         }
     }
     // Auto-bounce back if logged in.
     if ($this->auth->isLoggedIn()) {
         return $this->redirectToStoredReferrer('login', \DF\Url::route());
     }
     $this->view->external_providers = UserExternal::getExternalProviders();
     $this->view->form = $form;
 }
Esempio n. 8
0
 public static function api($row)
 {
     if ($row instanceof self) {
         $row = $row->toArray();
     }
     $api = array('id' => (int) $row['id'], 'name' => $row['name'], 'shortcode' => self::getStationShortName($row['name']), 'genre' => $row['genre'], 'category' => $row['category'], 'affiliation' => $row['affiliation'], 'image_url' => \PVL\Url::upload($row['image_url']), 'web_url' => $row['web_url'], 'twitter_url' => $row['twitter_url'], 'irc' => $row['irc'], 'sort_order' => (int) $row['weight']);
     if (isset($row['streams'])) {
         $api['streams'] = array();
         foreach ((array) $row['streams'] as $stream) {
             $api['streams'][] = StationStream::api($stream);
             // Set first stream as default, override if a later stream is explicitly default.
             if ($stream['is_default'] || !isset($api['default_stream_id'])) {
                 $api['default_stream_id'] = (int) $stream['id'];
                 $api['stream_url'] = $stream['stream_url'];
             }
         }
     }
     $api['player_url'] = ShortUrl::stationUrl($api['shortcode']);
     if ($row['requests_enabled']) {
         $api['request_url'] = \DF\Url::route(array('module' => 'default', 'controller' => 'station', 'action' => 'request', 'id' => $row['id']));
     } else {
         $api['request_url'] = '';
     }
     return $api;
 }