Build blog pagination files.

@return void
331068
public function build()
    {
        $view = $this->getPostsListView();

        $postsPerPage = @$this->viewsData['postsPerPage'] ?: 5;

        $this->pagesData = array_chunk($this->viewsData['blogPosts'], $postsPerPage);

        foreach ($this->pagesData as $pageIndex => $posts) {
            $this->buildPage($pageIndex, $view, $posts);
        }
    }
1295339
public function compilePaginations()
	{
		foreach ($this->site->getPaginations() as $pagination) 
		{
			$template = $this->twig->loadTemplate( 'index.html.tpl' );
			$content = $template->render(array('site' => $this->site, 'pagination' => $pagination));
			$this->createFile($content, $pagination);
		}
	}
365412
protected function buildFileAndDirectoryListing()
    {
        $collection  = new Collection;
        $files       = $this->scanFiles($this->currentDir);
        $thumbnails  = $this->buildThumbnails($files);
        $directories = $this->scanDirectory($this->currentDir);

        if ($this->getRootDir() <> $this->currentDir) {
            $back_directory    = implode('/', explode('/', $this->currentDir, -1));
            $item              = [];
            $item['thumbnail'] = '';
            $item['filename']  = '...';
            $item['size']      = '';
            $item['type']      = 'back';
            $item['icon']      = 'fa-reply';
            $item['path']      = $this->currentDir;
            $item['url']       = '?folder=' . $back_directory;
            $item['delete']    = current_user()->can('media.delete');
            $item['select']    = current_user()->can('media.view');
            $collection->add($item);
        }

        foreach ($directories as $directory) {
            $directory_name = explode('/', $directory);
            $directory_name = array_pop($directory_name);

            $item              = [];
            $item['thumbnail'] = '';
            $item['filename']  = $directory_name;
            $item['path']      = $directory;
            $item['size']      = '';
            $item['type']      = 'directory';
            $item['icon']      = 'fa-folder';
            $item['url']       = '?folder=' . $directory;
            $item['delete']    = current_user()->can('media.delete');
            $item['select']    = current_user()->can('media.view');

            $collection->add($item);
        }

        foreach ($files as $path) {
            $item     = [];
            $parts    = explode('/', $path);
            $filename = array_pop($parts);
            $size     = Storage::size($path);
            $icon     = file_ext_to_icon(File::extension($path));

            $item['type']      = 'file';
            $item['icon']      = $icon;
            $item['thumbnail'] = '';
            if (file_can_have_thumbnail($path)) {
                $item['type']      = 'image';
                $item['icon']      = 'fa-image';
                $item['thumbnail'] = $thumbnails[$path];
            }

            $item['filename'] = $filename;
            $item['size']     = $size;
            $item['url']      = Storage::url($path);
            $item['path']     = $path;
            $item['delete']   = current_user()->can('media.delete');
            $item['select']   = current_user()->can('media.view');
            $collection->add($item);
        }

        return $collection;
    }
222123
public function build()
    {
        $this->clean();
        $this->prepare();
        $this->runCs();
        $this->runCpd();
        $this->runMd();
        $this->runTests();
    }
492505
public function build()
    {
        $this->app->writeln("\n<comment>Adding root pages</comment>");
        $this->addPages('\\Skosh\\Content\\Page');

        $this->app->writeln("\n<comment>Adding posts</comment>");
        $this->addPages('\\Skosh\\Content\\Post', 'path', '_posts');

        $this->app->writeln("\n<comment>Adding docs</comment>");
        $this->addPages('\\Skosh\\Content\\Doc', 'path', '_doc');

        // Sort pages
        $this->sortPosts();

        // Fire event
        Event::fire('pages.sorted', [$this]);

        $this->app->writeln("\n<comment>Rendering content</comment>");

        foreach ($this->site->pages as $content) {
            $this->renderContent($content);
        }

        // Fire event
        Event::fire('pages.rendered', [$this]);
    }
1081271
public function listFile()
    {
        $this->downloadFile();
        $this->actionListFile();
        $this->setTitleListFile();
        $this->setBreadcrumbListFile();
        $this->setFilterListFile();
        $this->setPagerListFile();

        $this->setData('files', $this->getListFile());
        $this->setData('entities', $this->file->getEntities());

        $this->outputListFile();
    }
563782
public function build()
	{
		$listMapper = $this->getMapper();

		$model      = $this->getModel();
		$items      = $model::with([]);
		$primaryKey = (new $model)->getKeyName();

		// Field ordering
		if (Input::has('_order_by')) {
			$items->orderBy(Input::get('_order_by'), Input::get('_order'));
		}

		// Field filters
		foreach (Input::all() as $key => $value) {
			if (empty($value) || substr($key, 0, 1) == '_' || $key == 'page') {
				continue;
			}

			$items->where($key, 'LIKE', '%' . $value . '%');
		}

		// Result scopes
		if (Input::has('_scope')) {
			$items->{Input::get('_scope')}();
		}

		$items = $items->paginate($listMapper->getAdmin()->getPerPage());
		$this->setPaginator($items);

		$result = [];
		foreach ($items as $item) {
			$row = new ListResult;
			$row->setIdentifier($item->{$primaryKey});

			foreach ($listMapper->getFields() as $field) {
				$clone = clone $field;
				$name  = $clone->getName();
				$value = $item->{$name};

				if ($clone->hasBefore()) {
					$before = $clone->getBefore();
					$value  = $before($value);
				}

				if ($clone->isMultiple()) {
					$value = Value::decode(Config::get('bauhaus::admin.multiple-serializer'), $value);
					$value = implode(', ', $value);
				}

				$clone
					->setContext(BaseField::CONTEXT_LIST)
					->setRowId($item->{$primaryKey})
					->setValue($value);

				$row->addField($name, $clone);
			}

			$result[] = $row;
		}

		$this->setResult($result);
	}
391809
protected function setPagerListBlog()
    {
        $pager = array(
            'total' => $this->data_total,
            'query' => $this->query_filter,
            'limit' => $this->configTheme('blog_limit', 20)
        );

        return $this->data_limit = $this->setPager($pager);
    }
868179
public function build()
	{
		$a = explode("<span class=\"info\">", $this->raw, 2);
		if (isset($a[1])) {
			/**
			 * Get title.
			 */
			$b = explode("<div class=\"title\">", $a[1], 2);
			$b = explode("</div>", $b[1], 2);
			$this->info['title'] = static::e($b[0]);

			/**
			 * Table adaptation.
			 */
			$a = explode("<tbody>", $a[1], 2);
			$a = explode("</tbody>", $a[1], 2);

			/**
			 * Build info.
			 */
			$b = explode("<tr", $a[0]);
			unset($b[0]);
			if (count($b) > 1) {
				foreach ($b as $val) {
					$c = explode("<td>", $val, 2);
					if (isset($c[1])) {
						$c = explode("</td>", $c[1], 2);
						$d = explode("<ul class=\"list-inline gallery-info-list\">", $c[1], 2);
						if (! isset($d[1])) {
							$d = explode("<td>", $c[1], 2);
							$d = explode("</td>", $d[1], 2);
							$c[0] = static::e($c[0]);
							$this->info[$c[0]] = $c[0] === "Pages" ? (int) $d[0] : static::e(strip_tags($d[0]));
						} else {
							$d = explode("</ul>", $d[1], 2);
							$d = explode("<li", $d[0]);
							unset($d[0]);
							foreach ($d as $vax) {
								$vax = explode("<a href=\"", $vax);
								$vax = explode(">", $vax[1], 2);
								$vax = explode("<", $vax[1], 2);
								$this->info[static::e($c[0])][] = static::e($vax[0]);
							}
						}
					}
				}
			} else {
				throw new PururinException("Error Building Cover Info", 1);
			}
		}
		$ch = new Curl("http://pururin.us/assets/images/data/".$this->ins->id."/cover.jpg");
		$ch->setOpt(
			[
				CURLOPT_FOLLOWLOCATION => true,
				CURLOPT_REFERER => $this->ins->url
			]
		);
		$this->binary = $ch->exec();
		return true;
	}
1150422
public function build()
    {
        $values = array( 'access'           => false,
                         'genres'           => false,
                         'publication_date' => false,
                         'title'            => true,
                         'keywords'         => true,
                         'stock_tickers'    => true
        );
        foreach ($values as $value => $isEscaped) {
            if ( ! is_null( $this->{$value} )) {
                $this->addChild( sprintf( 'news:%s', $value ), $this->{$value}, $isEscaped );
            }
        }
    }
305757
public function build(): Pagination
    {
        return new Pagination(
            $this->items_per_page,
            $this->items_count,
            $this->current_page,
            $this->pages_range
        );
    }
939154
public function build()
	{
		parent::build();

		//set the upload url depending on the type of config this is
		$url = $this->validator->getUrlInstance();
		$route = $this->config->getType() === 'settings' ? 'admin_settings_file_upload' : 'admin_file_upload';

		//set the upload url to the proper route
		$this->suppliedOptions['upload_url'] = $url->route($route, array($this->config->getOption('name'), $this->suppliedOptions['field_name']));
	}
648519
public function build()
    {

        $query_params = [];

        $query_params["query"] = $this->q;

        if($this->boost > 1) {
            $query_params["boost"] = $this->boost;
        }

        if(count($this->fields)){
            $query_params["fields"] = $this->fields;
        }

        $this->query->must[] = [
            "query_string" => $query_params
        ];
    }
391391
protected function build()
    {
        $operation = $this->buildOperation('ListProfiles');

        $merchantID = $this->document->createElement('merchantID', $this->merchantId);
        $operation->appendChild($merchantID);

        if ($this->customerId) {
            $xmlMPayTid = $this->document->createElement('customerID', $this->customerId);
            $operation->appendChild($xmlMPayTid);
        }

        if ($this->expiredBy) {
            $xmlMPayTid = $this->document->createElement('expiredBy', $this->expiredBy);
            $operation->appendChild($xmlMPayTid);
        }

        if ($this->begin) {
            $xmlMPayTid = $this->document->createElement('begin', $this->begin);
            $operation->appendChild($xmlMPayTid);
        }

        if ($this->size) {
            $xmlMPayTid = $this->document->createElement('size', $this->size);
            $operation->appendChild($xmlMPayTid);
        }
    }
898307
protected function buildPage($pageIndex, $view, $posts)
    {
        $viewData = array_merge(
            $this->viewsData,
            [
                'paginatedBlogPosts' => $posts,
                'previousPage' => $this->getPreviousPageLink($pageIndex),
                'nextPage' => $this->getNextPageLink($pageIndex),
            ]
        );

        $pageContent = $this->viewFactory->make($view, $viewData)->render();

        $directory = sprintf('%s/blog-page/%d', KATANA_PUBLIC_DIR, $pageIndex + 1);

        $this->filesystem->makeDirectory($directory, 0755, true);

        $this->filesystem->put(
            sprintf('%s/%s', $directory, 'index.html'),
            $pageContent
        );
    }
33387
public function build()
    {
        if ($this->builded) {
            return;
        }

        $collection = $this->processFilter(false);

        $data = $collection->toArray();

        $this->prependRowSelectorColumn();
        $this->appendActionsColumn();

        Column::setOriginalGridModels($collection);

        $this->columns->map(function (Column $column) use (&$data) {
            $data = $column->fill($data);

            $this->columnNames[] = $column->getName();
        });

        $this->buildRows($data);

        $this->builded = true;
    }
17823
protected function generateFiles()
    {
        foreach ($this->files as $key => $file) {
            $file = $this->formatContent($file);

            $this->makeFile($key, $file);
        }
    }