Print channels

@return string
499367
private function generateChannels()
	{
		$out = '';
		//Start channel tag
		switch ($this->version)
		{
			case self::RSS2:
				$out .= '<channel>' . PHP_EOL;
			break;

			case self::RSS1:
				$out .= (isset($this->data['ChannelAbout']))?
					"<channel rdf:about=\"{$this->data['ChannelAbout']}\">" :
					"<channel rdf:about=\"{$this->channels['link']}\">";
			break;
		}

		//Print Items of channel
		foreach ($this->channels as $key => $value)
		{
			if ($this->version == self::ATOM && $key == 'link')
			{
				// ATOM prints link element as href attribute
				$out .= $this->makeNode($key,'',array('href'=>$value, 'rel'=>'self', 'type'=>'application/atom+xml'));
				//Add the id for ATOM
				$out .= $this->makeNode('id',$this->uuid($value,'urn:uuid:'));
			}
			else
			{
				$out .= $this->makeNode($key, $value);
			}

		}

		//RSS 1.0 have special tag <rdf:Seq> with channel
		if ($this->version == self::RSS1)
		{
			$out .= "<items>" . PHP_EOL . "<rdf:Seq>" . PHP_EOL;
			foreach ($this->items as $item)
			{
				$thisItems = $item->getElements();
				$out .= "<rdf:li resource=\"{$thisItems['link']['content']}\"/>" . PHP_EOL;
			}
			$out .= "</rdf:Seq>" . PHP_EOL . "</items>" . PHP_EOL . "</channel>" . PHP_EOL;
		}
		return $out;
	}
17722
protected static function printHelp()
    {
        $term = new Terminal();

        echo 'phpDaemon ' . Daemon::$version . ". http://phpdaemon.net\n";

        self::printUsage();

        echo "\nAlso you can use some optional parameters to override the same configuration variables:\n";

        foreach (self::$params as $name => $desc) {
            if (empty($desc)) {
                continue;
            } elseif (!is_array($desc)) {
                $term->drawParam($name, $desc);
            } else {
                $term->drawParam(
                    $name,
                    isset($desc['desc']) ? $desc['desc'] : '',
                    isset($desc['val']) ? $desc['val'] : ''
                );
            }
        }

        echo "\n";
    }
472971
public function print_entries() {
        global $CFG, $USER, $DB, $OUTPUT, $PAGE;
        $sitecontext = context_system::instance();

        // Blog renderer.
        $output = $PAGE->get_renderer('blog');

        $page  = optional_param('blogpage', 0, PARAM_INT);
        $limit = optional_param('limit', get_user_preferences('blogpagesize', 10), PARAM_INT);
        $start = $page * $limit;

        $morelink = '<br />&nbsp;&nbsp;';

        $entries = $this->get_entries($start, $limit);
        $totalentries = $this->count_entries();
        $pagingbar = new paging_bar($totalentries, $page, $limit, $this->get_baseurl());
        $pagingbar->pagevar = 'blogpage';
        $blogheaders = blog_get_headers();

        echo $OUTPUT->render($pagingbar);

        if (has_capability('moodle/blog:create', $sitecontext)) {
            // The user's blog is enabled and they are viewing their own blog.
            $userid = optional_param('userid', null, PARAM_INT);

            if (empty($userid) || (!empty($userid) && $userid == $USER->id)) {

                $courseid = optional_param('courseid', null, PARAM_INT);
                $modid = optional_param('modid', null, PARAM_INT);

                $addurl = new moodle_url("$CFG->wwwroot/blog/edit.php");
                $urlparams = array('action' => 'add',
                                   'userid' => $userid,
                                   'courseid' => $courseid,
                                   'groupid' => optional_param('groupid', null, PARAM_INT),
                                   'modid' => $modid,
                                   'tagid' => optional_param('tagid', null, PARAM_INT),
                                   'tag' => optional_param('tag', null, PARAM_INT),
                                   'search' => optional_param('search', null, PARAM_INT));

                $urlparams = array_filter($urlparams);
                $addurl->params($urlparams);

                $addlink = '<div class="addbloglink">';
                $addlink .= '<a href="'.$addurl->out().'">'. $blogheaders['stradd'].'</a>';
                $addlink .= '</div>';
                echo $addlink;
            }
        }

        if ($entries) {
            $count = 0;
            foreach ($entries as $entry) {
                $blogentry = new blog_entry(null, $entry);

                // Get the required blog entry data to render it.
                $blogentry->prepare_render();
                echo $output->render($blogentry);

                $count++;
            }

            echo $OUTPUT->render($pagingbar);

            if (!$count) {
                print '<br /><div style="text-align:center">'. get_string('noentriesyet', 'blog') .'</div><br />';
            }

            print $morelink.'<br />'."\n";
            return;
        }
    }
184067
public function channel($channel_id = null)
    {
        if (isset($this->channels[$channel_id])) {
            return $this->channels[$channel_id];
        }

        $channel_id = $channel_id ? $channel_id : $this->get_free_channel_id();
        $ch = new AMQPChannel($this->connection, $channel_id, true, $this->channel_rpc_timeout);
        $this->channels[$channel_id] = $ch;

        return $ch;
    }
665408
public function getDisplayString()
    {
        $results[] = $this->getStartDate()->toString($this->agenda->episodeDisplayFormat);
        $results[] = $this->getSubject();
        $results[] = $this->getDiagnosis();

        return implode($this->_('; '), array_filter($results));
    }
94768
public function getStats()
    {
        if (isset($this->stats)) return $this->stats;
        
        $stats = array();
        $stats['channels'] = '1';
        
        foreach (explode("\n", $this->sox('-n', 'stats')) as $line) {
            if (empty($line) || preg_match('/^\S+ WARN/', $line)) continue;
            
            if ($line[0] == ' ') {
                $stats['channels'] = (string)count(preg_split('/\s+/', trim($line))) - 1;
                continue;
            }
            
            list($key, $value) = preg_split('/\s{2,}/', $line) + array(1=>null);
            if (!isset($value)) continue;
            
            $key = strtolower(preg_replace(array('/\s(s|dB)$/', '/\W+/'), array('', '_'), $key));
            $value = preg_replace('/\s.*$/', '', $value);
            $stats[$key] = $value;
        }
        
        foreach (explode("\n", $this->sox('-n', 'stat')) as $line) {
            if (preg_match('/^\S+ WARN/', $line)) continue;
            
            list($key, $value) = explode(':', $line) + array(1=>null);
            if (!isset($value)) continue;
            
            if ($key == 'Samples read') $key = 'samples';
             elseif ($key == 'Length (seconds)') $key = 'length';
             else $key = strtolower(preg_replace('/\s+/', '_', $key));
            
            $stats[$key] = trim($value);
        }
        
        unset($stats['num_samples']);
        $stats['sample_rate'] = (string)round(($stats['samples'] / $stats['channels']) / $stats['length']);
        
        $this->stats = (object)$stats;
        return $this->stats;
    }
755407
public function printNumberOfRecords()
    {
        $content = '';
        $numberOfRecords = $this->getNumberOfRecordsInIndex();
        if ($numberOfRecords) {
            $content .=
                '<p class="box infobox"><i>'
                . LocalizationUtility::translate(
                    'LLL:EXT:ke_search/Resources/Private/Language/locallang_mod.xml:index_contains',
                    'KeSearch'
                )
                . ' '
                . $numberOfRecords
                . ' '
                . LocalizationUtility::translate(
                    'LLL:EXT:ke_search/Resources/Private/Language/locallang_mod.xml:records',
                    'KeSearch'
                )
                . ': ';

            $results_per_type = $this->getNumberOfRecordsInIndexPerType();
            $first = true;
            foreach ($results_per_type as $type => $count) {
                if (!$first) {
                    $content .= ', ';
                }
                $content .= $type . ' (' . $count . ')';
                $first = false;
            }
            $content .= '.<br/>';
            $content .=
                LocalizationUtility::translate(
                    'LLL:EXT:ke_search/Resources/Private/Language/locallang_mod.xml:last_indexing',
                    'KeSearch'
                )
                . ' '
                . $this->getLatestRecordDate() . '.';

            $content .= '</i></p>';
        }

        return $content;
    }
817456
public function printParameters($parameters)
    {
        $length = 0;
        foreach ($parameters as $parameter => $description) {
            if ($length == 0) {
                $length = strlen($parameter);
            }
            if (strlen($parameter) > $length) {
                $length = strlen($parameter);
            }
        }

        print Color::head('Options:') . PHP_EOL;
        foreach ($parameters as $parameter => $description) {
            print Color::colorize(' --' . $parameter . str_repeat(' ', $length - strlen($parameter)), Color::FG_GREEN);
            print Color::colorize("    " . $description) . PHP_EOL;
        }
    }
743515
public function printHeaderExtensions(){
		$hook_extend_indi_header_left = new mw\Hook\Hook('hExtendIndiHeaderLeft');
		$hook_extend_indi_header_right = new mw\Hook\Hook('hExtendIndiHeaderRight');
		$hook_extend_indi_header_left = $hook_extend_indi_header_left->execute($this->ctrl_individual);
		$hook_extend_indi_header_right = $hook_extend_indi_header_right->execute($this->ctrl_individual);
		
		echo '<div id="indi_perso_header">',
			'<div id="indi_perso_header_left">';
		foreach ($hook_extend_indi_header_left as $div) {
			if(count($div)==2){
				echo '<div id="', $div[0], '" class="indi_perso_header_left_div">',
					$div[1], '</div>';
			}
		}
		echo '</div>',
			'<div id="indi_perso_header_right">';
		foreach ($hook_extend_indi_header_right as $div) {
			if(count($div)==2){
				echo '<div id="', $div[0], '" class="indi_perso_header_right_div">',
					$div[1], '</div>';
			}
		}
		echo '</div>',
		'</div>';
	}
581156
protected function formatChannels(array $channels)
    {
        return array_map(function ($channel)
        {
            if ($channel instanceof Channel) {
                return $channel->getName();
            }

            return $channel;

        }, $channels);
    }
647014
function _get_open_channel()
    {
        $channel = self::CHANNEL_EXEC;
        do {
            if (isset($this->channel_status[$channel]) && $this->channel_status[$channel] == NET_SSH2_MSG_CHANNEL_OPEN) {
                return $channel;
            }
        } while ($channel++ < self::CHANNEL_SUBSYSTEM);

        return false;
    }
73587
public function getChannels()
    {
        $response = $this->channel->addMessage('query/apps', false);
        $xml = simplexml_load_string($response);
        $channels = array();
        foreach($xml->app as $app){
            $app_id = $app->attributes()->id;
            $channels[(string)$app_id] = array(
                'name' => (string)$app,
                'launch_url' => $this->location.'launch/'.(string)$app_id, //url to post to for launching channel
                'icon_url' => $this->location.'query/icon/'.(string)$app_id, //url containing image src for channel icon
            );
        }
        return $channels;
    }
1044539
public function getChannels() {
        $response = $this->http()->get('get_channels', [
            'query' => [
                'accountID' => $this->config['accountID'],
                'accountKey' => $this->config['accountKey'],
            ],
        ]);
        return $this->parseResponse($response, true);
    }
36249
public function channels()
    {
        $url = $this->getURL('channels');

        $headers = [
            'body' => [
                'private' => $this->privateKey
            ]
        ];

        $response = $this->processRequest($url, $headers, 'get');

        return $response;
    }
576697
protected function getName()
  {
    if($this->currObj instanceof Channel && $this->currObj->isSpacer())
    {
      return $this->currObj["channel_name"]->section("]", 1, 99)->toString();
    }
    elseif($this->currObj instanceof Client)
    {
      $before = array();
      $behind = array();

      foreach($this->currObj->memberOf() as $group)
      {
        if($group->getProperty("namemode") == TeamSpeak3::GROUP_NAMEMODE_BEFORE)
        {
          $before[] = "[" . $group["name"] . "]";
        }
        elseif($group->getProperty("namemode") == TeamSpeak3::GROUP_NAMEMODE_BEHIND)
        {
          $behind[] = "[" . $group["name"] . "]";
        }
      }

      return trim(implode("", $before) . " " . $this->currObj . " " . implode("", $behind));
    }

    return $this->currObj->toString();
  }
871899
public function getChannel()
    {
        if ($this->_oChannel === null) {
            $this->_oChannel = $this->_getRssFeed()->getChannel();
        }

        return $this->_oChannel;
    }
946750
function _get_open_channel()
    {
        $channel = NET_SSH2_CHANNEL_EXEC;
        do {
            if (isset($this->channel_status[$channel]) && $this->channel_status[$channel] == NET_SSH2_MSG_CHANNEL_OPEN) {
                return $channel;
            }
        } while ($channel++ < NET_SSH2_CHANNEL_SUBSYSTEM);

        return false;
    }